Rover: add E-stop

This commit is contained in:
IamPete1 2019-01-25 18:58:50 +00:00 committed by Randy Mackay
parent 49ec059420
commit 4f9b8e1b6c
2 changed files with 13 additions and 0 deletions

View File

@ -320,6 +320,12 @@ void Rover::update_GPS(void)
void Rover::update_current_mode(void) void Rover::update_current_mode(void)
{ {
// check for emergency stop
if (SRV_Channels::get_emergency_stop()) {
// relax controllers, motor stopping done at output level
g2.attitude_control.relax_I();
}
control_mode->update(); control_mode->update();
} }

View File

@ -71,6 +71,13 @@ bool AP_Arming_Rover::gps_checks(bool display_failure)
bool AP_Arming_Rover::pre_arm_checks(bool report) bool AP_Arming_Rover::pre_arm_checks(bool report)
{ {
if (SRV_Channels::get_emergency_stop()) {
if (report) {
gcs().send_text(MAV_SEVERITY_CRITICAL,"PreArm: Motors Emergency Stopped");
}
return false;
}
return (AP_Arming::pre_arm_checks(report) return (AP_Arming::pre_arm_checks(report)
& rover.g2.motors.pre_arm_check(report) & rover.g2.motors.pre_arm_check(report)
& fence_checks(report) & fence_checks(report)