APM:Libraries
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AP_AdvancedFailsafe Class Referenceabstract

#include <AP_AdvancedFailsafe.h>

Collaboration diagram for AP_AdvancedFailsafe:
[legend]

Public Types

enum  control_mode { AFS_MANUAL = 0, AFS_STABILIZED = 1, AFS_AUTO = 2 }
 
enum  state { STATE_PREFLIGHT = 0, STATE_AUTO = 1, STATE_DATA_LINK_LOSS = 2, STATE_GPS_LOSS = 3 }
 
enum  terminate_action { TERMINATE_ACTION_TERMINATE = 42, TERMINATE_ACTION_LAND = 43 }
 

Public Member Functions

 AP_AdvancedFailsafe (AP_Mission &_mission, const AP_GPS &_gps)
 
void check (uint32_t last_heartbeat_ms, bool geofence_breached, uint32_t last_valid_rc_ms)
 
void heartbeat (void)
 
bool should_crash_vehicle (void)
 
bool gcs_terminate (bool should_terminate, const char *reason)
 
virtual void terminate_vehicle (void)=0
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Protected Member Functions

virtual void setup_IO_failsafe (void)=0
 
virtual enum control_mode afs_mode (void)=0
 
bool check_altlimit (void)
 

Protected Attributes

enum state _state
 
AP_Missionmission
 
const AP_GPSgps
 
AP_Int8 _enable
 
AP_Int8 _heartbeat_pin
 
AP_Int8 _manual_pin
 
AP_Int8 _terminate_pin
 
AP_Int8 _terminate
 
AP_Int8 _terminate_action
 
AP_Int8 _wp_comms_hold
 
AP_Int8 _wp_gps_loss
 
AP_Float _qnh_pressure
 
AP_Int32 _amsl_limit
 
AP_Int32 _amsl_margin_gps
 
AP_Float _rc_fail_time_seconds
 
AP_Int8 _max_gps_loss
 
AP_Int8 _max_comms_loss
 
AP_Int8 _enable_geofence_fs
 
AP_Int8 _enable_RC_fs
 
AP_Int8 _rc_term_manual_only
 
AP_Int8 _enable_dual_loss
 
bool _heartbeat_pin_value
 
uint8_t _saved_wp
 
uint8_t _gps_loss_count
 
uint8_t _comms_loss_count
 
uint32_t _last_comms_loss_ms
 
uint32_t _last_gps_loss_ms
 
bool _failsafe_setup:1
 

Detailed Description

Definition at line 32 of file AP_AdvancedFailsafe.h.

Member Enumeration Documentation

◆ control_mode

Enumerator
AFS_MANUAL 
AFS_STABILIZED 
AFS_AUTO 

Definition at line 35 of file AP_AdvancedFailsafe.h.

◆ state

Enumerator
STATE_PREFLIGHT 
STATE_AUTO 
STATE_DATA_LINK_LOSS 
STATE_GPS_LOSS 

Definition at line 41 of file AP_AdvancedFailsafe.h.

◆ terminate_action

Enumerator
TERMINATE_ACTION_TERMINATE 
TERMINATE_ACTION_LAND 

Definition at line 48 of file AP_AdvancedFailsafe.h.

Constructor & Destructor Documentation

◆ AP_AdvancedFailsafe()

AP_AdvancedFailsafe::AP_AdvancedFailsafe ( AP_Mission _mission,
const AP_GPS _gps 
)
inline

Definition at line 54 of file AP_AdvancedFailsafe.h.

Here is the call graph for this function:

Member Function Documentation

◆ afs_mode()

virtual enum control_mode AP_AdvancedFailsafe::afs_mode ( void  )
protectedpure virtual

Referenced by check().

Here is the caller graph for this function:

◆ check()

void AP_AdvancedFailsafe::check ( uint32_t  last_heartbeat_ms,
bool  geofence_breached,
uint32_t  last_valid_rc_ms 
)

Definition at line 154 of file AP_AdvancedFailsafe.cpp.

Referenced by AP_AdvancedFailsafe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_altlimit()

bool AP_AdvancedFailsafe::check_altlimit ( void  )
protected

Definition at line 317 of file AP_AdvancedFailsafe.cpp.

Referenced by check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gcs_terminate()

bool AP_AdvancedFailsafe::gcs_terminate ( bool  should_terminate,
const char *  reason 
)

Definition at line 381 of file AP_AdvancedFailsafe.cpp.

Referenced by AP_AdvancedFailsafe(), and GCS_MAVLINK::handle_flight_termination().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ heartbeat()

void AP_AdvancedFailsafe::heartbeat ( void  )

Definition at line 300 of file AP_AdvancedFailsafe.cpp.

Referenced by AP_AdvancedFailsafe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_IO_failsafe()

virtual void AP_AdvancedFailsafe::setup_IO_failsafe ( void  )
protectedpure virtual

Referenced by should_crash_vehicle().

Here is the caller graph for this function:

◆ should_crash_vehicle()

bool AP_AdvancedFailsafe::should_crash_vehicle ( void  )

Definition at line 354 of file AP_AdvancedFailsafe.cpp.

Referenced by AP_AdvancedFailsafe(), and gcs_terminate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate_vehicle()

virtual void AP_AdvancedFailsafe::terminate_vehicle ( void  )
pure virtual

Referenced by AP_AdvancedFailsafe().

Here is the caller graph for this function:

Member Data Documentation

◆ _amsl_limit

AP_Int32 AP_AdvancedFailsafe::_amsl_limit
protected

Definition at line 112 of file AP_AdvancedFailsafe.h.

Referenced by check_altlimit().

◆ _amsl_margin_gps

AP_Int32 AP_AdvancedFailsafe::_amsl_margin_gps
protected

Definition at line 113 of file AP_AdvancedFailsafe.h.

Referenced by check_altlimit().

◆ _comms_loss_count

uint8_t AP_AdvancedFailsafe::_comms_loss_count
protected

Definition at line 131 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _enable

AP_Int8 AP_AdvancedFailsafe::_enable
protected

◆ _enable_dual_loss

AP_Int8 AP_AdvancedFailsafe::_enable_dual_loss
protected

Definition at line 120 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _enable_geofence_fs

AP_Int8 AP_AdvancedFailsafe::_enable_geofence_fs
protected

Definition at line 117 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _enable_RC_fs

AP_Int8 AP_AdvancedFailsafe::_enable_RC_fs
protected

Definition at line 118 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _failsafe_setup

bool AP_AdvancedFailsafe::_failsafe_setup
protected

Definition at line 140 of file AP_AdvancedFailsafe.h.

Referenced by should_crash_vehicle().

◆ _gps_loss_count

uint8_t AP_AdvancedFailsafe::_gps_loss_count
protected

Definition at line 128 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _heartbeat_pin

AP_Int8 AP_AdvancedFailsafe::_heartbeat_pin
protected

Definition at line 101 of file AP_AdvancedFailsafe.h.

Referenced by check(), and heartbeat().

◆ _heartbeat_pin_value

bool AP_AdvancedFailsafe::_heartbeat_pin_value
protected

Definition at line 122 of file AP_AdvancedFailsafe.h.

Referenced by check(), and heartbeat().

◆ _last_comms_loss_ms

uint32_t AP_AdvancedFailsafe::_last_comms_loss_ms
protected

Definition at line 134 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _last_gps_loss_ms

uint32_t AP_AdvancedFailsafe::_last_gps_loss_ms
protected

Definition at line 137 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _manual_pin

AP_Int8 AP_AdvancedFailsafe::_manual_pin
protected

Definition at line 102 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _max_comms_loss

AP_Int8 AP_AdvancedFailsafe::_max_comms_loss
protected

Definition at line 116 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _max_gps_loss

AP_Int8 AP_AdvancedFailsafe::_max_gps_loss
protected

Definition at line 115 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _qnh_pressure

AP_Float AP_AdvancedFailsafe::_qnh_pressure
protected

Definition at line 111 of file AP_AdvancedFailsafe.h.

Referenced by check_altlimit().

◆ _rc_fail_time_seconds

AP_Float AP_AdvancedFailsafe::_rc_fail_time_seconds
protected

Definition at line 114 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _rc_term_manual_only

AP_Int8 AP_AdvancedFailsafe::_rc_term_manual_only
protected

Definition at line 119 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _saved_wp

uint8_t AP_AdvancedFailsafe::_saved_wp
protected

Definition at line 125 of file AP_AdvancedFailsafe.h.

Referenced by AP_AdvancedFailsafe(), and check().

◆ _state

enum state AP_AdvancedFailsafe::_state
protected

Definition at line 94 of file AP_AdvancedFailsafe.h.

Referenced by AP_AdvancedFailsafe(), and check().

◆ _terminate

AP_Int8 AP_AdvancedFailsafe::_terminate
protected

◆ _terminate_action

AP_Int8 AP_AdvancedFailsafe::_terminate_action
protected

Definition at line 105 of file AP_AdvancedFailsafe.h.

Referenced by gcs_terminate(), and should_crash_vehicle().

◆ _terminate_pin

AP_Int8 AP_AdvancedFailsafe::_terminate_pin
protected

Definition at line 103 of file AP_AdvancedFailsafe.h.

Referenced by check(), and heartbeat().

◆ _wp_comms_hold

AP_Int8 AP_AdvancedFailsafe::_wp_comms_hold
protected

Definition at line 108 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ _wp_gps_loss

AP_Int8 AP_AdvancedFailsafe::_wp_gps_loss
protected

Definition at line 109 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ gps

const AP_GPS& AP_AdvancedFailsafe::gps
protected

Definition at line 97 of file AP_AdvancedFailsafe.h.

Referenced by check(), and check_altlimit().

◆ mission

AP_Mission& AP_AdvancedFailsafe::mission
protected

Definition at line 96 of file AP_AdvancedFailsafe.h.

Referenced by check().

◆ var_info

const AP_Param::GroupInfo AP_AdvancedFailsafe::var_info
static

Definition at line 85 of file AP_AdvancedFailsafe.h.

Referenced by AP_AdvancedFailsafe().


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