mavsdk::Mavsdk::Configuration Class Reference ​
#include: mavsdk.hpp
Possible configurations.
Public Member Functions ​
| Type | Name | Description |
|---|---|---|
| Â | Configuration (uint8_t system_id, uint8_t component_id, bool always_send_heartbeats) | Create new Configuration via manually configured system and component ID. |
| Â | Configuration (ComponentType component_type) | Create new Configuration using a component type. In this mode, the system and component ID will be automatically chosen. |
| Â | Configuration ()=delete | |
| Â | ~Configuration ()=default | |
| uint8_t | get_system_id () const | Get the system id of this configuration. |
| void | set_system_id (uint8_t system_id) | Set the system id of this configuration. |
| uint8_t | get_component_id () const | Get the component id of this configuration. |
| void | set_component_id (uint8_t component_id) | Set the component id of this configuration. |
| bool | get_always_send_heartbeats () const | Get whether to send heartbeats by default. |
| void | set_always_send_heartbeats (bool always_send_heartbeats) | Set whether to send heartbeats by default. |
| double | get_heartbeat_watchdog_timeout_s () const | Get the heartbeat watchdog timeout. |
| bool | set_heartbeat_watchdog_timeout_s (double timeout_s) | Set the heartbeat watchdog (deadman timer) timeout. |
| ComponentType | get_component_type () const | Component type of this configuration, used for automatic ID set. |
| void | set_component_type (ComponentType component_type) | Set the component type of this configuration. |
| uint8_t | get_mav_type () const | Get the mav type (vehicle type) of this configuration. |
| void | set_mav_type (uint8_t mav_type) | Set the mav type (vehicle type) of this configuration. |
| Autopilot | get_autopilot () const | Get the autopilot type for server identification in heartbeats. |
| void | set_autopilot (Autopilot autopilot) | Set the autopilot type for server identification. |
| CompatibilityMode | get_compatibility_mode () const | Get the compatibility mode. |
| void | set_compatibility_mode (CompatibilityMode mode) | Set the compatibility mode. |
Constructor & Destructor Documentation ​
Configuration() ​
mavsdk::Mavsdk::Configuration::Configuration(uint8_t system_id, uint8_t component_id, bool always_send_heartbeats)Create new Configuration via manually configured system and component ID.
Parameters
- uint8_t system_id - the system id to store in this configuration
- uint8_t component_id - the component id to store in this configuration
- bool always_send_heartbeats - send heartbeats by default even without a system connected
Configuration() ​
mavsdk::Mavsdk::Configuration::Configuration(ComponentType component_type)Create new Configuration using a component type. In this mode, the system and component ID will be automatically chosen.
Parameters
- ComponentType component_type - the component type, used for automatically choosing ids.
Configuration() ​
mavsdk::Mavsdk::Configuration::Configuration()=delete~Configuration() ​
mavsdk::Mavsdk::Configuration::~Configuration()=defaultMember Function Documentation ​
get_system_id() ​
uint8_t mavsdk::Mavsdk::Configuration::get_system_id() constGet the system id of this configuration.
Returns
 uint8_t - uint8_t the system id stored in this configuration, from 1-255
set_system_id() ​
void mavsdk::Mavsdk::Configuration::set_system_id(uint8_t system_id)Set the system id of this configuration.
Parameters
- uint8_t system_id -
get_component_id() ​
uint8_t mavsdk::Mavsdk::Configuration::get_component_id() constGet the component id of this configuration.
Returns
 uint8_t - uint8_t the component id stored in this configuration,from 1-255
set_component_id() ​
void mavsdk::Mavsdk::Configuration::set_component_id(uint8_t component_id)Set the component id of this configuration.
Parameters
- uint8_t component_id -
get_always_send_heartbeats() ​
bool mavsdk::Mavsdk::Configuration::get_always_send_heartbeats() constGet whether to send heartbeats by default.
Returns
 bool - whether to always send heartbeats
set_always_send_heartbeats() ​
void mavsdk::Mavsdk::Configuration::set_always_send_heartbeats(bool always_send_heartbeats)Set whether to send heartbeats by default.
Note: when a heartbeat watchdog is configured (set_heartbeat_watchdog_timeout_s()) and has expired, heartbeats stay off until Mavsdk::feed_heartbeat_watchdog() is called again, even if always_send_heartbeats is set.
Parameters
- bool always_send_heartbeats -
get_heartbeat_watchdog_timeout_s() ​
double mavsdk::Mavsdk::Configuration::get_heartbeat_watchdog_timeout_s() constGet the heartbeat watchdog timeout.
Returns
 double - Timeout in seconds, 0 if the watchdog is disabled.
set_heartbeat_watchdog_timeout_s() ​
bool mavsdk::Mavsdk::Configuration::set_heartbeat_watchdog_timeout_s(double timeout_s)Set the heartbeat watchdog (deadman timer) timeout.
When set to a value greater than 0, the periodic heartbeats sent by MAVSDK are only sent as long as Mavsdk::feed_heartbeat_watchdog() keeps being called at least once per timeout period. Heartbeats never start (and any already-running heartbeats are stopped) until the watchdog has been fed - including when the watchdog is first enabled or its timeout is changed. If the watchdog times out, heartbeats stay off until it is fed again.
A successful feed remains valid until the timeout elapses, including across system disconnect/reconnect and temporary periods where the heartbeat policy does not allow sending.
This is useful when MAVSDK's heartbeats should reflect the liveness of the application: if the application hangs or dies, heartbeats stop.
While the watchdog is expired, heartbeats stay off until it is fed again, even if set_always_send_heartbeats() would otherwise allow them.
When set to 0, the watchdog is disabled and heartbeats follow the usual policy (always_send_heartbeats or a connected system).
Default: 0 (disabled)
Parameters
- double timeout_s - Timeout in seconds: 0 (disabled) or at least 2.
Returns
 bool - true if the value was accepted, false if it was rejected (invalid values are ignored and the previous value kept).
get_component_type() ​
ComponentType mavsdk::Mavsdk::Configuration::get_component_type() constComponent type of this configuration, used for automatic ID set.
Returns
 ComponentType -
set_component_type() ​
void mavsdk::Mavsdk::Configuration::set_component_type(ComponentType component_type)Set the component type of this configuration.
Parameters
- ComponentType component_type -
get_mav_type() ​
uint8_t mavsdk::Mavsdk::Configuration::get_mav_type() constGet the mav type (vehicle type) of this configuration.
Returns
 uint8_t - uint8_t the mav type stored in this configuration
set_mav_type() ​
void mavsdk::Mavsdk::Configuration::set_mav_type(uint8_t mav_type)Set the mav type (vehicle type) of this configuration.
Parameters
- uint8_t mav_type -
get_autopilot() ​
Autopilot mavsdk::Mavsdk::Configuration::get_autopilot() constGet the autopilot type for server identification in heartbeats.
Returns
 Autopilot - The autopilot type used in outgoing heartbeats.
set_autopilot() ​
void mavsdk::Mavsdk::Configuration::set_autopilot(Autopilot autopilot)Set the autopilot type for server identification.
When MAVSDK acts as an autopilot server, this determines the MAV_AUTOPILOT value sent in heartbeats.
Default: Autopilot::Unknown (maps to MAV_AUTOPILOT_GENERIC)
Parameters
- Autopilot autopilot -
get_compatibility_mode() ​
CompatibilityMode mavsdk::Mavsdk::Configuration::get_compatibility_mode() constGet the compatibility mode.
Returns
 CompatibilityMode - The current compatibility mode.
set_compatibility_mode() ​
void mavsdk::Mavsdk::Configuration::set_compatibility_mode(CompatibilityMode mode)Set the compatibility mode.
This determines which autopilot-specific quirks are used:
Auto: Use detected autopilot (default, current behavior)
Pure: Pure standard MAVLink, no autopilot-specific quirks
Px4: Force PX4 quirks regardless of detection
ArduPilot: Force ArduPilot quirks regardless of detection
Default: CompatibilityMode::Auto
Parameters
- CompatibilityMode mode -

