TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MavlinkMessageSource Class Reference

Message source for MAVLink integration using ArduinoMavlinkDrone. More...

#include <MavlinkMessageSource.h>

Inheritance diagram for MavlinkMessageSource:
Inheritance graph
[legend]
Collaboration diagram for MavlinkMessageSource:
Collaboration graph
[legend]

Public Member Functions

 MavlinkMessageSource (SimpleMavlinkDrone &drone, ControlScenario scenario=ControlScenario::Car)
 
bool begin (ControlScenario scenario=ControlScenario::Car)
 Start the message source.
 
void end ()
 Stop the message source.
 
void update ()
 Call this in your main loop to handle MAVLink messages.
 
void setMaxSteeringAngle (float angleDeg)
 Defines the max steering ange in degrees: default 45.
 
- 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

void publishScenario ()
 
void publishCar ()
 
void publishBoat ()
 
void publishDrone ()
 
void publishPlane ()
 
void publish (const Message< float > &msg)
 

Static Protected Member Functions

static float mapFloat (float x, float in_min, float in_max, float out_min, float out_max)
 

Protected Attributes

SimpleMavlinkDrone & drone
 
ControlScenario scenario
 
bool is_active_ = false
 
float max_steering_deg = 45.0f
 
- Protected Attributes inherited from MessageSource
std::vector< MessageHandlerEntrymessageHandlers_
 

Detailed Description

Message source for MAVLink integration using ArduinoMavlinkDrone.

Note
This class depends on the ArduinoMavlinkDrone library: https://github.com/pschatzmann/ArduinoMavlinkDrone

This class connects to a MAVLink drone and translates MAVLink telemetry and control messages into TinyRobotics Message objects. It can be used to bridge MAVLink-based vehicles with the TinyRobotics message bus and control framework.

Usage: MavlinkMessageSource mavlink(drone); mavlink.begin(); // In loop: mavlink.update();

Member Function Documentation

◆ setMaxSteeringAngle()

void setMaxSteeringAngle ( float  angleDeg)
inline

Defines the max steering ange in degrees: default 45.

Parameters
angleDeg

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