3#include "SpektrumSatellite.h"
5namespace tinyrobotics {
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
40template <
class T = uint16_t>
52 if (satellite.getFrame()) {
53 float rollDegrees = toDegrees(satellite.getAileron());
54 float pitchDegrees = toDegrees(satellite.getElevator());
55 float yawDegrees = toDegrees(satellite.getRudder());
56 float throttle = 0.1f * satellite.getThrottle();
59 MessageOrigin::RemoteControl);
62 publish(Message(MessageContent::Roll,
64 MessageOrigin::RemoteControl));
66 publish(Message(MessageContent::Pitch,
68 MessageOrigin::RemoteControl));
71 MessageOrigin::RemoteControl));
74 publish(Message(MessageContent::SteeringAngle, rollDegrees,
76 MessageOrigin::RemoteControl);
81 SpektrumSatellite<T>& satellite;
83 float toDegrees(T value) {
85 return map(value, 0.0f, 1000.0f, -90.0f, 90.0f);
Publishes control messages from a Spektrum satellite receiver to the TinyRobotics message bus.
Definition: SpektrumSatelliteMessageSource.h:41
void update()
Definition: SpektrumSatelliteMessageSource.h:51
Unit
Units for message values.
Definition: Common.h:45
@ AngleDegree
Angle in degrees.
@ Percent
Percentage (0-100)