MAV'RIC
|
Public Types | |
enum | custom_mode_list_t { CUSTOM_BASE_MODE = 0, CUST_CRITICAL_CLIMB_TO_SAFE_ALT = 1, CUST_CRITICAL_FLY_TO_HOME_WP = 2, CUST_CRITICAL_LAND = 4, CUST_DESCENT_TO_SMALL_ALTITUDE = 8, CUST_DESCENT_TO_GND = 16, CUST_COLLISION_AVOIDANCE = 32, CUST_BATTERY_LOW = 64, CUST_FENCE_1 = 128, CUST_FENCE_2 = 256, CUST_HEARTBEAT_LOST = 512, CUST_REMOTE_LOST = 1024, CUST_GPS_BAD = 2048 } |
enum | ctrl_mode_t { RATE = MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, ATTITUDE = MAV_MODE_FLAG_MANUAL_INPUT_ENABLED + MAV_MODE_FLAG_STABILIZE_ENABLED, VELOCITY = MAV_MODE_FLAG_MANUAL_INPUT_ENABLED + MAV_MODE_FLAG_STABILIZE_ENABLED + MAV_MODE_FLAG_GUIDED_ENABLED, POSITION_HOLD = MAV_MODE_FLAG_STABILIZE_ENABLED + MAV_MODE_FLAG_GUIDED_ENABLED, AUTO = MAV_MODE_FLAG_STABILIZE_ENABLED + MAV_MODE_FLAG_GUIDED_ENABLED + MAV_MODE_FLAG_AUTO_ENABLED } |
typedef uint8_t | mode_bits_t |
typedef uint8_t | bitmask_t |
typedef uint32_t | custom_mode_t |
Public Member Functions | |
Mav_mode (const mode_bits_t &bits) | |
Mav_mode (const Mav_mode &mav_mode) | |
mode_bits_t | bits () const |
returns the mode as mode_bits (uint8_t) | |
const uint8_t * | bits_ptr () const |
returns a pointer to bits_ where each bit represents a flag | |
bool | is_armed () const |
returns whether armed (MAV_MODE_FLAG_SAFETY_ARMED set) | |
bool | is_manual () const |
returns whether in manual mode (MAV_MODE_FLAG_MANUAL_INPUT_ENABLED set) | |
bool | is_hil () const |
returns whether in HIL mode (MAV_MODE_FLAG_HIL_ENABLED set) | |
bool | is_stabilize () const |
returns whether in stabilize mode (MAV_MODE_FLAG_STABILIZE_ENABLED set) | |
bool | is_guided () const |
returns whether in guided mode (MAV_MODE_FLAG_GUIDED_ENABLED set) | |
bool | is_auto () const |
returns whether in auto mode (MAV_MODE_FLAG_AUTO_ENABLED set) | |
bool | is_test () const |
returns whether in test mode (MAV_MODE_FLAG_TEST_ENABLED set) | |
bool | is_custom () const |
returns whether custom mode enabled (MAV_MODE_FLAG_CUSTOM_MODE_ENABLED set) | |
ctrl_mode_t | ctrl_mode () const |
returns the ctrl_mode (defined by manual, stabilize, guided and auto flag) | |
void | set_armed_flag (bool value) |
set armed flag | |
void | set_manual_flag (bool value) |
set manual flag | |
void | set_hil_flag (bool value) |
set HIL flag (Hardware in the loop) | |
void | set_stabilize_flag (bool value) |
set stabilize flag | |
void | set_guided_flag (bool value) |
set guided flag | |
void | set_auto_flag (bool value) |
set auto flag | |
void | set_test_flag (bool value) |
set test flag | |
void | set_custom_flag (bool value) |
set custom_mode flag | |
void | set_ctrl_mode (ctrl_mode_t ctrl_mode) |
set ctrl_mode (RATE, ATTITUDE, VELOCITY, POSITION_HOLD, AUTO); | |
bool | operator== (const Mav_mode &mav_mode) const |
operator overload for == (calls this.equal(mav_mode) ) | |
Static Public Attributes | |
static const bitmask_t | CTRL_MODE_BITFIELD = 0b01011100 |
CUST_CRITICAL_CLIMB_TO_SAFE_ALT |
First critical behavior. |
CUST_CRITICAL_FLY_TO_HOME_WP |
Second critical behavior, comes after CLIMB_TO_SAFE_ALT. |
CUST_CRITICAL_LAND |
Third critical behavior, comes after FLY_TO_HOME_WP. |
CUST_DESCENT_TO_SMALL_ALTITUDE |
First auto landing behavior. |
CUST_DESCENT_TO_GND |
Second auto landing behavior, comes after DESCENT_TO_SMAL_ALTITUDE. |
CUST_COLLISION_AVOIDANCE |
Collision avoidance. |
CUST_BATTERY_LOW |
Battery low flag. |
CUST_FENCE_1 |
Fence 1 violation flag. |
CUST_FENCE_2 |
Fence 2 violation flag. |
CUST_HEARTBEAT_LOST |
Heartbeat loss flag. |
CUST_REMOTE_LOST |
Remote lost flag. |
CUST_GPS_BAD |
GPS loss flag. |
mode_bits_t Mav_mode::bits | ( | ) | const [inline] |
returns the mode as mode_bits (uint8_t)
const uint8_t* Mav_mode::bits_ptr | ( | ) | const [inline] |
returns a pointer to bits_ where each bit represents a flag
this function is temporary as long as data logging is using pointers
ctrl_mode_t Mav_mode::ctrl_mode | ( | ) | const [inline] |
returns the ctrl_mode (defined by manual, stabilize, guided and auto flag)
bool Mav_mode::is_armed | ( | ) | const [inline] |
returns whether armed (MAV_MODE_FLAG_SAFETY_ARMED set)
bool Mav_mode::is_auto | ( | ) | const [inline] |
returns whether in auto mode (MAV_MODE_FLAG_AUTO_ENABLED set)
bool Mav_mode::is_custom | ( | ) | const [inline] |
returns whether custom mode enabled (MAV_MODE_FLAG_CUSTOM_MODE_ENABLED set)
bool Mav_mode::is_guided | ( | ) | const [inline] |
returns whether in guided mode (MAV_MODE_FLAG_GUIDED_ENABLED set)
bool Mav_mode::is_hil | ( | ) | const [inline] |
returns whether in HIL mode (MAV_MODE_FLAG_HIL_ENABLED set)
bool Mav_mode::is_manual | ( | ) | const [inline] |
returns whether in manual mode (MAV_MODE_FLAG_MANUAL_INPUT_ENABLED set)
bool Mav_mode::is_stabilize | ( | ) | const [inline] |
returns whether in stabilize mode (MAV_MODE_FLAG_STABILIZE_ENABLED set)
bool Mav_mode::is_test | ( | ) | const [inline] |
returns whether in test mode (MAV_MODE_FLAG_TEST_ENABLED set)
bool Mav_mode::operator== | ( | const Mav_mode & | mav_mode | ) | const [inline] |
operator overload for == (calls this.equal(mav_mode) )
void Mav_mode::set_armed_flag | ( | bool | value | ) | [inline] |
set armed flag
value | true for arming, false for disarming |
void Mav_mode::set_auto_flag | ( | bool | value | ) | [inline] |
set auto flag
value | true for passing to auto, false for not auto |
void Mav_mode::set_ctrl_mode | ( | ctrl_mode_t | ctrl_mode | ) | [inline] |
set ctrl_mode (RATE, ATTITUDE, VELOCITY, POSITION_HOLD, AUTO);
affects only manual, stabilize, guided and auto flag
void Mav_mode::set_custom_flag | ( | bool | value | ) | [inline] |
set custom_mode flag
value | true for passing to test, false for not test |
void Mav_mode::set_guided_flag | ( | bool | value | ) | [inline] |
set guided flag
value | true for passing to guided, false for not guided |
void Mav_mode::set_hil_flag | ( | bool | value | ) | [inline] |
set HIL flag (Hardware in the loop)
value | true for passing to HIL, false for not HIL |
void Mav_mode::set_manual_flag | ( | bool | value | ) | [inline] |
set manual flag
value | true for passing to manual, false for not manual |
void Mav_mode::set_stabilize_flag | ( | bool | value | ) | [inline] |
set stabilize flag
value | true for passing to stabilize, false for not stabilize |
void Mav_mode::set_test_flag | ( | bool | value | ) | [inline] |
set test flag
value | true for passing to test, false for not test |