mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
mc_pos_control: shut down vertical thrust with ground contact
This commit is contained in:
@@ -1105,23 +1105,15 @@ MulticopterPositionControl::update_smooth_takeoff(const float &z_sp, const float
|
|||||||
void
|
void
|
||||||
MulticopterPositionControl::limit_thrust_during_landing(vehicle_local_position_setpoint_s &setpoint)
|
MulticopterPositionControl::limit_thrust_during_landing(vehicle_local_position_setpoint_s &setpoint)
|
||||||
{
|
{
|
||||||
if (_vehicle_land_detected.ground_contact) {
|
if (_vehicle_land_detected.ground_contact
|
||||||
// Set thrust in xy to zero
|
|| _vehicle_land_detected.maybe_landed) {
|
||||||
setpoint.thrust[0] = 0.0f;
|
// we set thrust to zero, this will help to decide if we are actually landed or not
|
||||||
setpoint.thrust[1] = 0.0f;
|
|
||||||
_control.resetIntegralXY();
|
|
||||||
// set yaw-sp to current yaw
|
|
||||||
setpoint.yaw = _states.yaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_vehicle_land_detected.maybe_landed) {
|
|
||||||
// set yaw-sp to current yaw
|
|
||||||
setpoint.yaw = _states.yaw;
|
|
||||||
// we set thrust to zero
|
|
||||||
// this will help to decide if we are actually landed or not
|
|
||||||
setpoint.thrust[0] = setpoint.thrust[1] = setpoint.thrust[2] = 0.0f;
|
setpoint.thrust[0] = setpoint.thrust[1] = setpoint.thrust[2] = 0.0f;
|
||||||
_control.resetIntegralXY(); //reuqired to prevent integrator from increasing
|
// set yaw-sp to current yaw to avoid any corrections
|
||||||
_control.resetIntegralZ(); //reuqired to prevent integrator from increasing
|
setpoint.yaw = _states.yaw;
|
||||||
|
// prevent any integrator windup
|
||||||
|
_control.resetIntegralXY();
|
||||||
|
_control.resetIntegralZ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user