mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
Rover: use is_armed_and_safety_off()
this changes Rover to not set soft_armed false when safety is on, making Rover match Copter. Instead the new is_armed_and_safety_off() method is used where we need to know that actuators are active Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Randy Mackay
co-authored by
Claude Sonnet 4.6
parent
6999fc0bc1
commit
1fa037a912
@@ -126,8 +126,7 @@ bool AP_Arming_Rover::arm_checks(AP_Arming::Method method)
|
||||
|
||||
void AP_Arming_Rover::update_soft_armed()
|
||||
{
|
||||
hal.util->set_soft_armed(is_armed() &&
|
||||
hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_DISARMED);
|
||||
hal.util->set_soft_armed(is_armed());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+3
-3
@@ -486,20 +486,20 @@ void Rover::one_second_loop(void)
|
||||
AP_Notify::flags.pre_arm_check = arming.pre_arm_checks(false);
|
||||
AP_Notify::flags.pre_arm_gps_check = true;
|
||||
AP_Notify::flags.armed = arming.is_armed();
|
||||
AP_Notify::flags.flying = hal.util->get_soft_armed();
|
||||
AP_Notify::flags.flying = arming.is_armed_and_safety_off();
|
||||
|
||||
#if AP_ROVER_AUTO_ARM_ONCE_ENABLED
|
||||
handle_auto_arm_once();
|
||||
#endif // AP_ROVER_AUTO_ARM_ONCE_ENABLED
|
||||
|
||||
// attempt to update home position and baro calibration if not armed:
|
||||
if (!hal.util->get_soft_armed()) {
|
||||
if (!arming.is_armed_and_safety_off()) {
|
||||
update_home();
|
||||
}
|
||||
|
||||
// need to set "likely flying" when armed to allow for compass
|
||||
// learning to run
|
||||
set_likely_flying(hal.util->get_soft_armed());
|
||||
set_likely_flying(arming.is_armed_and_safety_off());
|
||||
|
||||
// send latest param values to wp_nav
|
||||
g2.wp_nav.set_turn_params(g2.turn_radius, g2.motors.have_skid_steering());
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ void Mode::exit()
|
||||
|
||||
bool Mode::enter()
|
||||
{
|
||||
const bool ignore_checks = !hal.util->get_soft_armed(); // allow switching to any mode if disarmed. We rely on the arming check to perform
|
||||
const bool ignore_checks = !rover.arming.is_armed_and_safety_off(); // allow switching to any mode if disarmed. We rely on the arming check to perform
|
||||
if (!ignore_checks) {
|
||||
|
||||
// get EKF filter status
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ void ModeAuto::update()
|
||||
// check if mission exists (due to being cleared while disarmed in AUTO,
|
||||
// if no mission, then stop...needs mode change out of AUTO, mission load,
|
||||
// and change back to AUTO to run a mission at this point
|
||||
if (!hal.util->get_soft_armed() && !mission.present()) {
|
||||
if (!rover.arming.is_armed_and_safety_off() && !mission.present()) {
|
||||
start_stop();
|
||||
}
|
||||
// start or update mission
|
||||
|
||||
Reference in New Issue
Block a user