TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SpektrumSatelliteMessageSource< T > Class Template Reference

Publishes control messages from a Spektrum satellite receiver to the TinyRobotics message bus. More...

#include <SpektrumSatelliteMessageSource.h>

Inheritance diagram for SpektrumSatelliteMessageSource< T >:
Inheritance graph
[legend]
Collaboration diagram for SpektrumSatelliteMessageSource< T >:
Collaboration graph
[legend]

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< MessageHandlerEntrymessageHandlers_
 

Detailed Description

template<class T = uint16_t>
class tinyrobotics::SpektrumSatelliteMessageSource< T >

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:

SpektrumSatellite<uint16_t> satellite;
// In your main loop:
source.run();
Publishes control messages from a Spektrum satellite receiver to the TinyRobotics message bus.
Definition: SpektrumSatelliteMessageSource.h:41
Template Parameters
TData type for channel values (default: uint16_t)

Member Function Documentation

◆ update()

void update ( )
inline

call in your loop to process incoming satellite messages and publish to handlers


The documentation for this class was generated from the following file: