mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 08:13:56 -04:00
Plane: add to LAND_NEUTRL behavior
offer netrual vs disabled outputs
This commit is contained in:
parent
ead51a9d19
commit
993e5b438c
@ -1084,16 +1084,22 @@ void Plane::set_servos(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g.land_then_servos_neutral &&
|
if (g.land_then_servos_neutral > 0 &&
|
||||||
|
control_mode == AUTO &&
|
||||||
g.land_disarm_delay > 0 &&
|
g.land_disarm_delay > 0 &&
|
||||||
auto_state.land_complete &&
|
auto_state.land_complete &&
|
||||||
!arming.is_armed()) {
|
!arming.is_armed()) {
|
||||||
// after an auto land and auto disarm, set the servos to be neutral just
|
// after an auto land and auto disarm, set the servos to be neutral just
|
||||||
// in case we're upside down or some crazy angle and straining the servos.
|
// in case we're upside down or some crazy angle and straining the servos.
|
||||||
channel_roll->servo_out = 0;
|
if (g.land_then_servos_neutral == 1) {
|
||||||
channel_pitch->servo_out = 0;
|
channel_roll->radio_out = channel_roll->radio_trim;
|
||||||
channel_throttle->servo_out = 0;
|
channel_pitch->radio_out = channel_pitch->radio_trim;
|
||||||
channel_rudder->servo_out = 0;
|
channel_rudder->radio_out = channel_rudder->radio_trim;
|
||||||
|
} else if (g.land_then_servos_neutral == 2) {
|
||||||
|
channel_roll->disable_out();
|
||||||
|
channel_pitch->disable_out();
|
||||||
|
channel_rudder->disable_out();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// send values to the PWM timers for output
|
// send values to the PWM timers for output
|
||||||
|
@ -291,7 +291,7 @@ const AP_Param::Info Plane::var_info[] = {
|
|||||||
// @Param: LAND_THEN_NEUTRL
|
// @Param: LAND_THEN_NEUTRL
|
||||||
// @DisplayName: Set servos to neutral after landing
|
// @DisplayName: Set servos to neutral after landing
|
||||||
// @Description: When enabled, after an autoland and auto-disarm via LAND_DISARMDELAY happens then set all servos to neutral. This is helpful when an aircraft has a rough landing upside down or a crazy angle causing the servos to strain.
|
// @Description: When enabled, after an autoland and auto-disarm via LAND_DISARMDELAY happens then set all servos to neutral. This is helpful when an aircraft has a rough landing upside down or a crazy angle causing the servos to strain.
|
||||||
// @Values: 0:Disabled, 1:Enabled
|
// @Values: 0:Disabled, 1:Servos to Neutral, 2:Servos to Zero PWM
|
||||||
// @User: Advanced
|
// @User: Advanced
|
||||||
GSCALAR(land_then_servos_neutral, "LAND_THEN_NEUTRL", 0),
|
GSCALAR(land_then_servos_neutral, "LAND_THEN_NEUTRL", 0),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user