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.
38 lines
847 B
38 lines
847 B
/* |
|
Rover specific AP_AdvancedFailsafe class |
|
*/ |
|
|
|
#include "Rover.h" |
|
|
|
#if ADVANCED_FAILSAFE == ENABLED |
|
|
|
// Constructor |
|
AP_AdvancedFailsafe_Rover::AP_AdvancedFailsafe_Rover(AP_Mission &_mission, const AP_GPS &_gps) : |
|
AP_AdvancedFailsafe(_mission, _gps) |
|
{} |
|
|
|
|
|
/* |
|
Setup radio_out values for all channels to termination values |
|
*/ |
|
void AP_AdvancedFailsafe_Rover::terminate_vehicle(void) |
|
{ |
|
// disarm as well |
|
rover.disarm_motors(); |
|
|
|
// Set to HOLD mode |
|
rover.set_mode(rover.mode_hold, MODE_REASON_CRASH_FAILSAFE); |
|
} |
|
|
|
/* |
|
Return an AFS_MODE for current control mode |
|
*/ |
|
AP_AdvancedFailsafe::control_mode AP_AdvancedFailsafe_Rover::afs_mode(void) |
|
{ |
|
if (rover.control_mode->is_autopilot_mode()) { |
|
return AP_AdvancedFailsafe::AFS_AUTO; |
|
} |
|
return AP_AdvancedFailsafe::AFS_STABILIZED; |
|
} |
|
|
|
#endif // ADVANCED_FAILSAFE
|
|
|