Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fly_sky.hpp
Go to the documentation of this file.
1#pragma once
2
9
10namespace fang::remote
11{
12
24{
25public:
27 // So that it can store then as normalzied decimals
28 using ChannelValues = std::array<double, communication::ibus::kChannelCount>;
29
30 enum class Channel
31 {
33 rightVertical = 1,
34 leftVertical = 2,
36 wheelA = 4,
37 wheelB = 5,
38 switchC = 6,
39 switchD = 7,
40 switchA = 8,
41 switchB = 9
42 };
43
54 enum class Switch
55 {
56 A,
57 B,
58 C,
59 D,
60 wheelA,
61 wheelB
62 };
63
70 FlySky(tap::control::CommandMapper& commandMapper, coolSerial::ByteQueue& byteQueue);
71 void update();
72
74
82
87 double getChannel(Channel channel) const;
88private:
89 static const math::CoolLerp kNormalizer;
90 static constexpr int kBaudrate{115200};
94 void setChannels(communication::ibus::ChannelData channelData);
95 TapRemote::SwitchState channelToSwitchState(double channelData) const;
96
97 tap::control::CommandMapper& commandMapper_;
99 ChannelValues channelValues_{};
100};
101}
Definition dynamic_i_bus_parser.hpp:23
Definition ichannel_data_found_listener.hpp:6
Definition cool_lerp.hpp:14
Definition fly_sky.hpp:24
Switch
Definition fly_sky.hpp:55
std::array< double, communication::ibus::kChannelCount > ChannelValues
Definition fly_sky.hpp:28
Channel
Definition fly_sky.hpp:31
void update()
Definition fly_sky.cpp:16
double getChannel(Channel channel) const
Definition fly_sky.cpp:75
TapRemote::SwitchState getTaprootSwitch(TapRemote::Switch switchId) const
Definition fly_sky.cpp:62
TapRemote::SwitchState getSwitch(Switch switchId) const
Definition fly_sky.cpp:34
void channelDataFound(const communication::ibus::ChannelData &channelData)
Definition fly_sky.cpp:21
Definition remote.hpp:51
Switch
Definition remote.hpp:73
SwitchState
Definition remote.hpp:82
Definition command_mapper.hpp:68
std::array< std::uint16_t, kChannelCount > ChannelData
Definition i_bus_channel_data.hpp:8
Definition fly_sky.cpp:6