Typedefs | Functions | Variables
uas_stringify.cpp File Reference
#include <array>
#include <unordered_map>
#include <stdexcept>
#include <mavros/mavros_uas.h>
#include <mavros/px4_custom_mode.h>
Include dependency graph for uas_stringify.cpp:

Go to the source code of this file.

Typedefs

typedef std::unordered_map< uint32_t, const std::string > cmode_map
 

Functions

static bool cmode_find_cmap (const cmode_map &cmap, std::string &cmode_str, uint32_t &cmode)
 
static bool is_apm_copter (UAS::MAV_TYPE type)
 
static std::string str_base_mode (int base_mode)
 
static std::string str_custom_mode (uint32_t custom_mode)
 
static std::string str_mode_cmap (const cmode_map &cmap, uint32_t custom_mode)
 
static std::string str_mode_px4 (uint32_t custom_mode_int)
 

Variables

static const cmode_map apmrover2_cmode_map
 
static const cmode_map arducopter_cmode_map
 
static const cmode_map arduplane_cmode_map
 
static const cmode_map ardusub_cmode_map
 
static const cmode_map px4_cmode_map
 PX4 custom mode -> string. More...
 

Typedef Documentation

◆ cmode_map

typedef std::unordered_map<uint32_t, const std::string> cmode_map

Definition at line 26 of file uas_stringify.cpp.

Function Documentation

◆ cmode_find_cmap()

static bool cmode_find_cmap ( const cmode_map cmap,
std::string &  cmode_str,
uint32_t &  cmode 
)
static
Todo:
parse CMODE(dec)

Definition at line 223 of file uas_stringify.cpp.

◆ is_apm_copter()

static bool is_apm_copter ( UAS::MAV_TYPE  type)
inlinestatic

Definition at line 180 of file uas_stringify.cpp.

◆ str_base_mode()

static std::string str_base_mode ( int  base_mode)
inlinestatic

Definition at line 148 of file uas_stringify.cpp.

◆ str_custom_mode()

static std::string str_custom_mode ( uint32_t  custom_mode)
static

Definition at line 152 of file uas_stringify.cpp.

◆ str_mode_cmap()

static std::string str_mode_cmap ( const cmode_map cmap,
uint32_t  custom_mode 
)
static

Definition at line 156 of file uas_stringify.cpp.

◆ str_mode_px4()

static std::string str_mode_px4 ( uint32_t  custom_mode_int)
inlinestatic

Definition at line 165 of file uas_stringify.cpp.

Variable Documentation

◆ apmrover2_cmode_map

const cmode_map apmrover2_cmode_map
static
Initial value:
{{
{ 0, "MANUAL" },
{ 1, "ACRO" },
{ 3, "STEERING" },
{ 4, "HOLD" },
{ 5, "LOITER" },
{ 6, "FOLLOW" },
{ 7, "SIMPLE" },
{ 10, "AUTO" },
{ 11, "RTL" },
{ 12, "SMART_RTL" },
{ 15, "GUIDED" },
{ 16, "INITIALISING" }
}}

APM:Rover custom mode -> string

APMrover2/defines.h

Definition at line 86 of file uas_stringify.cpp.

◆ arducopter_cmode_map

const cmode_map arducopter_cmode_map
static
Initial value:
{{
{ 0, "STABILIZE" },
{ 1, "ACRO" },
{ 2, "ALT_HOLD" },
{ 3, "AUTO" },
{ 4, "GUIDED" },
{ 5, "LOITER" },
{ 6, "RTL" },
{ 7, "CIRCLE" },
{ 8, "POSITION" },
{ 9, "LAND" },
{ 10, "OF_LOITER" },
{ 11, "DRIFT" },
{ 13, "SPORT" },
{ 14, "FLIP" },
{ 15, "AUTOTUNE" },
{ 16, "POSHOLD" },
{ 17, "BRAKE" },
{ 18, "THROW" },
{ 19, "AVOID_ADSB" },
{ 20, "GUIDED_NOGPS" }
}}

APM:Copter custom mode -> string

ArduCopter/defines.h

Definition at line 59 of file uas_stringify.cpp.

◆ arduplane_cmode_map

const cmode_map arduplane_cmode_map
static
Initial value:
{{
{ 0, "MANUAL" },
{ 1, "CIRCLE" },
{ 2, "STABILIZE" },
{ 3, "TRAINING" },
{ 4, "ACRO" },
{ 5, "FBWA" },
{ 6, "FBWB" },
{ 7, "CRUISE" },
{ 8, "AUTOTUNE" },
{ 10, "AUTO" },
{ 11, "RTL" },
{ 12, "LOITER" },
{ 14, "LAND" },
{ 15, "GUIDED" },
{ 16, "INITIALISING" },
{ 17, "QSTABILIZE" },
{ 18, "QHOVER" },
{ 19, "QLOITER" },
{ 20, "QLAND" },
{ 21, "QRTL" }
}}

APM:Plane custom mode -> string

ArduPlane/defines.h

Definition at line 32 of file uas_stringify.cpp.

◆ ardusub_cmode_map

const cmode_map ardusub_cmode_map
static
Initial value:
{{
{ 0, "STABILIZE" },
{ 1, "ACRO" },
{ 2, "ALT_HOLD" },
{ 3, "AUTO" },
{ 4, "GUIDED" },
{ 5, "VELHOLD" },
{ 6, "RTL" },
{ 7, "CIRCLE" },
{ 9, "SURFACE" },
{ 10, "OF_LOITER" },
{ 11, "DRIFT" },
{ 13, "TRANSECT" },
{ 14, "FLIP" },
{ 15, "AUTOTUNE" },
{ 16, "POSHOLD" },
{ 17, "BRAKE" },
{ 18, "THROW" },
{ 19, "MANUAL" }
}}

ArduSub custom mode -> string

Note
Modes marked n/a is not implemented (defines.h comments)

ArduSub/defines.h

Definition at line 107 of file uas_stringify.cpp.

◆ px4_cmode_map

const cmode_map px4_cmode_map
static
px4::custom_mode::SUB_MODE_AUTO_FOLLOW_TARGET
@ SUB_MODE_AUTO_FOLLOW_TARGET
Definition: px4_custom_mode.h:75
px4::custom_mode::SUB_MODE_AUTO_MISSION
@ SUB_MODE_AUTO_MISSION
Definition: px4_custom_mode.h:71
px4::define_mode_auto
constexpr uint32_t define_mode_auto(enum custom_mode::SUB_MODE_AUTO sm)
helper function to define auto mode as uint32_t constant
Definition: px4_custom_mode.h:119
px4::custom_mode::SUB_MODE_AUTO_RTL
@ SUB_MODE_AUTO_RTL
Definition: px4_custom_mode.h:72
px4::custom_mode::SUB_MODE_AUTO_READY
@ SUB_MODE_AUTO_READY
Definition: px4_custom_mode.h:68
px4::custom_mode::SUB_MODE_AUTO_PRECLAND
@ SUB_MODE_AUTO_PRECLAND
Definition: px4_custom_mode.h:76
px4::custom_mode::MAIN_MODE_STABILIZED
@ MAIN_MODE_STABILIZED
Definition: px4_custom_mode.h:63
px4::custom_mode::MAIN_MODE_ACRO
@ MAIN_MODE_ACRO
Definition: px4_custom_mode.h:61
px4::custom_mode::MAIN_MODE_ALTCTL
@ MAIN_MODE_ALTCTL
Definition: px4_custom_mode.h:58
px4::custom_mode::SUB_MODE_AUTO_TAKEOFF
@ SUB_MODE_AUTO_TAKEOFF
Definition: px4_custom_mode.h:69
px4::custom_mode::MAIN_MODE_OFFBOARD
@ MAIN_MODE_OFFBOARD
Definition: px4_custom_mode.h:62
px4::define_mode
constexpr uint32_t define_mode(enum custom_mode::MAIN_MODE mm, uint8_t sm=0)
helper function to define any mode as uint32_t constant
Definition: px4_custom_mode.h:107
px4::custom_mode::SUB_MODE_AUTO_LAND
@ SUB_MODE_AUTO_LAND
Definition: px4_custom_mode.h:73
px4::custom_mode::SUB_MODE_AUTO_RTGS
@ SUB_MODE_AUTO_RTGS
Definition: px4_custom_mode.h:74
px4::custom_mode::MAIN_MODE_RATTITUDE
@ MAIN_MODE_RATTITUDE
Definition: px4_custom_mode.h:64
px4::custom_mode::MAIN_MODE_POSCTL
@ MAIN_MODE_POSCTL
Definition: px4_custom_mode.h:59
px4::custom_mode::SUB_MODE_AUTO_LOITER
@ SUB_MODE_AUTO_LOITER
Definition: px4_custom_mode.h:70
px4::custom_mode::MAIN_MODE_MANUAL
@ MAIN_MODE_MANUAL
Definition: px4_custom_mode.h:57


mavros
Author(s): Vladimir Ermakov
autogenerated on Tue May 6 2025 02:34:03