mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 18:50:35 +08:00
mc_pos_control: set thrust to zero if in idle
This commit is contained in:
committed by
Lorenz Meier
parent
1fb8eaf6c6
commit
75fb1b28b9
@@ -79,6 +79,16 @@ void PositionControl::updateState(const vehicle_local_position_s &state, const V
|
||||
_vel_dot = vel_dot;
|
||||
}
|
||||
|
||||
void PositionControl::setIdle()
|
||||
{
|
||||
_pos_sp = _pos;
|
||||
_vel_sp.zero();
|
||||
_acc_sp.zero();
|
||||
_thr_sp.zero();
|
||||
_yaw_sp = _yaw_sp_int = _yaw;
|
||||
_yawspeed_sp = 0.0f;
|
||||
}
|
||||
|
||||
void PositionControl::updateSetpoint(const vehicle_local_position_setpoint_s &setpoint)
|
||||
{
|
||||
_pos_sp = Vector3f(&setpoint.x);
|
||||
@@ -96,6 +106,9 @@ void PositionControl::updateSetpoint(const vehicle_local_position_setpoint_s &se
|
||||
|
||||
if (PX4_ISFINITE(setpoint.thrust[0]) && PX4_ISFINITE(setpoint.thrust[1]) && PX4_ISFINITE(setpoint.thrust[2])) {
|
||||
_skipController = true;
|
||||
_pos_sp.zero();
|
||||
_vel_sp.zero();
|
||||
_acc_sp.zero();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user