You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
712 B
33 lines
712 B
8 years ago
|
/*
|
||
|
Rover specific AP_AdvancedFailsafe class
|
||
|
*/
|
||
|
|
||
|
#include "Rover.h"
|
||
|
|
||
|
#if ADVANCED_FAILSAFE == ENABLED
|
||
|
|
||
|
/*
|
||
|
Setup radio_out values for all channels to termination values
|
||
|
*/
|
||
|
void AP_AdvancedFailsafe_Rover::terminate_vehicle(void)
|
||
|
{
|
||
|
// disarm as well
|
||
5 years ago
|
AP::arming().disarm(AP_Arming::Method::AFS);
|
||
8 years ago
|
|
||
|
// Set to HOLD mode
|
||
5 years ago
|
rover.set_mode(rover.mode_hold, ModeReason::CRASH_FAILSAFE);
|
||
8 years ago
|
}
|
||
|
|
||
|
/*
|
||
|
Return an AFS_MODE for current control mode
|
||
|
*/
|
||
|
AP_AdvancedFailsafe::control_mode AP_AdvancedFailsafe_Rover::afs_mode(void)
|
||
|
{
|
||
8 years ago
|
if (rover.control_mode->is_autopilot_mode()) {
|
||
8 years ago
|
return AP_AdvancedFailsafe::AFS_AUTO;
|
||
|
}
|
||
|
return AP_AdvancedFailsafe::AFS_STABILIZED;
|
||
|
}
|
||
|
|
||
|
#endif // ADVANCED_FAILSAFE
|