mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-21 23:00:34 +08:00
mc_pos_control takeoff: control velocity if velocity estimation is available, otherwise
just keep thrust vector pointing upward
This commit is contained in:
committed by
Daniel Agar
parent
dbd1e1432a
commit
4b70584cf4
@@ -684,7 +684,14 @@ MulticopterPositionControl::run()
|
|||||||
// don't control position in xy
|
// don't control position in xy
|
||||||
setpoint.x = setpoint.y = NAN;
|
setpoint.x = setpoint.y = NAN;
|
||||||
setpoint.vx = setpoint.vy = NAN;
|
setpoint.vx = setpoint.vy = NAN;
|
||||||
setpoint.thrust[0] = setpoint.thrust[1] = 0.0f; // just keeping pointing upwards
|
setpoint.thrust[0] = setpoint.thrust[1] = NAN;
|
||||||
|
|
||||||
|
if (PX4_ISFINITE(_states.velocity(0)) && PX4_ISFINITE(_states.velocity(1))) {
|
||||||
|
setpoint.vx = setpoint.vy = NAN; // try to keep zero velocity
|
||||||
|
|
||||||
|
} else {
|
||||||
|
setpoint.thrust[0] = setpoint.thrust[1] = 0.0f; // just keeping pointing upwards
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_vehicle_land_detected.landed && !_in_smooth_takeoff && !PX4_ISFINITE(setpoint.thrust[2])) {
|
if (_vehicle_land_detected.landed && !_in_smooth_takeoff && !PX4_ISFINITE(setpoint.thrust[2])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user