mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 02:30:35 +08:00
position control: set _skip_controller before calling _interfaceMapping()
Without this failsafe will be overwritten
This commit is contained in:
committed by
Lorenz Meier
parent
80867343ab
commit
7cc85885a4
@@ -56,6 +56,10 @@ void PositionControl::updateState(const PositionControlStates &states)
|
||||
|
||||
void PositionControl::updateSetpoint(const vehicle_local_position_setpoint_s &setpoint)
|
||||
{
|
||||
// If full manual is required (thrust already generated), don't run position/velocity
|
||||
// controller and just return thrust.
|
||||
_skip_controller = false;
|
||||
|
||||
_pos_sp = Vector3f(&setpoint.x);
|
||||
_vel_sp = Vector3f(&setpoint.vx);
|
||||
_acc_sp = Vector3f(&setpoint.acc_x);
|
||||
@@ -64,10 +68,6 @@ void PositionControl::updateSetpoint(const vehicle_local_position_setpoint_s &se
|
||||
_yawspeed_sp = setpoint.yawspeed;
|
||||
_interfaceMapping();
|
||||
|
||||
// If full manual is required (thrust already generated), don't run position/velocity
|
||||
// controller and just return thrust.
|
||||
_skip_controller = false;
|
||||
|
||||
if (PX4_ISFINITE(setpoint.thrust[0]) && PX4_ISFINITE(setpoint.thrust[1]) && PX4_ISFINITE(setpoint.thrust[2])) {
|
||||
_skip_controller = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user