Skip to content
Snippets Groups Projects
Commit d5903853 authored by Matthias Grob's avatar Matthias Grob
Browse files

mc_pos_control: shut down vertical thrust with ground contact

parent 98148aad
No related branches found
No related tags found
No related merge requests found
...@@ -1105,23 +1105,15 @@ MulticopterPositionControl::update_smooth_takeoff(const float &z_sp, const float ...@@ -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();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment