mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 15:23:34 +08:00
Reset the altitude setpoint.
This commit is contained in:
@@ -1027,7 +1027,11 @@ bool FixedwingPositionControl::update_desired_altitude(float dt)
|
|||||||
_althold_epv = _global_pos.epv;
|
_althold_epv = _global_pos.epv;
|
||||||
_was_in_deadband = true;
|
_was_in_deadband = true;
|
||||||
}
|
}
|
||||||
|
if (_vehicle_status.is_vtol) {
|
||||||
|
if (_vehicle_status.is_rotary_wing || _vehicle_status.in_transition_mode) {
|
||||||
|
_hold_alt = _global_pos.alt;
|
||||||
|
}
|
||||||
|
}
|
||||||
return climbout_mode;
|
return climbout_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -993,9 +993,12 @@ MulticopterPositionControl::task_main()
|
|||||||
reset_yaw_sp = true;
|
reset_yaw_sp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX Temporary: for vtol use we need to reset the yaw setpoint when we are doing a transition
|
/* reset yaw and altitude setpoint for VTOL which are in fw mode */
|
||||||
if (_vehicle_status.in_transition_mode) {
|
if (_vehicle_status.is_vtol) {
|
||||||
reset_yaw_sp = true;
|
if (!_vehicle_status.is_rotary_wing && !_vehicle_status.in_transition_mode) {
|
||||||
|
reset_yaw_sp = true;
|
||||||
|
_reset_alt_sp = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update previous arming state
|
//Update previous arming state
|
||||||
|
|||||||
Reference in New Issue
Block a user