|
TinyRobotics
|
Publishes control messages from a Spektrum satellite receiver to the TinyRobotics message bus. More...
#include <SpektrumSatelliteMessageSource.h>


Public Member Functions | |
| SpektrumSatelliteMessageSource (SpektrumSatellite< T > &satellite) | |
| void | update () |
Public Member Functions inherited from MessageSource | |
| void | subscribe (MessageHandler &handler, MessageOrigin origin=MessageOrigin::Undefined, MessageContent content=MessageContent::Undefined) |
| Subscribe a message handler to this source, with optional filtering. | |
| void | unsubscribeAll () |
| Remove all registered message handlers. | |
| void | sendMessage (Message< float > &msg) |
| Publish a message to all registered handlers. | |
| void | sendMessage (const Message< Coordinate< float > > &msg) |
| Publish a message to all registered handlers. | |
| void | sendMessage (const Message< GPSCoordinate > &msg) |
| Publish a message to all registered handlers. | |
| void | sendMessage (const Message< MotionState3D > &msg) |
| Overload for MotionState3D messages. | |
Protected Member Functions | |
| float | toDegrees (T value) |
Protected Attributes | |
| SpektrumSatellite< T > & | satellite |
Protected Attributes inherited from MessageSource | |
| std::vector< MessageHandlerEntry > | messageHandlers_ |
Publishes control messages from a Spektrum satellite receiver to the TinyRobotics message bus.
This class bridges a Spektrum satellite receiver and the TinyRobotics message bus system. It polls the receiver for new frames and, when available, publishes standardized control messages:
Each message is published with the appropriate unit and origin (MessageOrigin::RemoteControl). The channel value range is automatically set to 0-100 and mapped to -90..+90 degrees for angles.
This class depends on https://github.com/pschatzmann/SpektrumSatellite The SpektrumSatellite class must be set up proplerly and passed to the constructor.
Usage:
| T | Data type for channel values (default: uint16_t) |
|
inline |
call in your loop to process incoming satellite messages and publish to handlers