166 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"Terminating due to fence breach");
180 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"Terminating due to RC failure");
193 bool gcs_link_ok = ((now - last_heartbeat_ms) < 10000);
201 gcs().
send_text(MAV_SEVERITY_DEBUG,
"AFS State: AFS_AUTO");
209 gcs().
send_text(MAV_SEVERITY_DEBUG,
"AFS State: DATA_LINK_LOSS");
223 gcs().
send_text(MAV_SEVERITY_DEBUG,
"AFS State: GPS_LOSS");
244 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"Terminating due to dual loss");
248 }
else if (gcs_link_ok) {
250 gcs().
send_text(MAV_SEVERITY_DEBUG,
"AFS State: AFS_AUTO, GCS now OK");
266 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"Terminating due to dual loss");
269 }
else if (gps_lock_ok) {
270 gcs().
send_text(MAV_SEVERITY_DEBUG,
"AFS State: AFS_AUTO, GPS now OK");
383 gcs().
send_text(MAV_SEVERITY_INFO,
"AFS not enabled, can't terminate the vehicle");
387 _terminate.set_and_notify(should_terminate ? 1 : 0);
392 if(should_terminate == is_terminating) {
393 if (is_terminating) {
394 gcs().
send_text(MAV_SEVERITY_INFO,
"Terminating due to %s", reason);
396 gcs().
send_text(MAV_SEVERITY_INFO,
"Aborting termination due to %s", reason);
400 gcs().
send_text(MAV_SEVERITY_INFO,
"Unable to terminate, termination is not configured");
AP_Int8 _enable_dual_loss
#define AP_PARAM_FLAG_ENABLE
bool gcs_terminate(bool should_terminate, const char *reason)
virtual enum control_mode afs_mode(void)=0
Interface definition for the various Ground Control System.
#define AP_GROUPINFO(name, idx, clazz, element, def)
void set_capabilities(uint64_t cap)
uint32_t last_fix_time_ms(uint8_t instance) const
const Mission_Command & get_current_nav_cmd() const
get_current_nav_cmd - returns the current "navigation" command
const Location & location(uint8_t instance) const
virtual void write(uint8_t pin, uint8_t value)=0
uint8_t _comms_loss_count
float get_altitude_difference(float base_pressure, float pressure) const
AP_Int8 _terminate_action
#define AP_GROUPINFO_FLAGS(name, idx, clazz, element, def, flags)
uint32_t _last_comms_loss_ms
virtual void setup_IO_failsafe(void)=0
int32_t alt
param 2 - Altitude in centimeters (meters * 100) see LOCATION_ALT_MAX_M
AP_Int32 _amsl_margin_gps
RC_Channel manager, with EEPROM-backed storage of constants.
AP_Float _rc_fail_time_seconds
virtual void pinMode(uint8_t pin, uint8_t output)=0
bool set_current_cmd(uint16_t index)
void send_text(MAV_SEVERITY severity, const char *fmt,...)
float get_pressure(void) const
GPS_Status status(uint8_t instance) const
Query GPS status.
static const struct AP_Param::GroupInfo var_info[]
uint32_t _last_gps_loss_ms
void check(uint32_t last_heartbeat_ms, bool geofence_breached, uint32_t last_valid_rc_ms)
bool check_altlimit(void)
AP_Int8 _rc_term_manual_only
Receiving valid messages and 3D lock.
AP_Int8 _enable_geofence_fs
bool should_crash_vehicle(void)
bool _heartbeat_pin_value
uint32_t get_last_update(void) const