mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 08:53:34 +08:00
FlightTasks: adapt to acceleration based control
This commit is contained in:
@@ -40,7 +40,7 @@ bool FlightTaskDescend::activate(vehicle_local_position_setpoint_s last_setpoint
|
||||
{
|
||||
bool ret = FlightTask::activate(last_setpoint);
|
||||
// stay level to minimize horizontal drift
|
||||
_thrust_setpoint = matrix::Vector3f(0.0f, 0.0f, NAN);
|
||||
_acceleration_setpoint = matrix::Vector3f(0.f, 0.f, NAN);
|
||||
// keep heading
|
||||
_yaw_setpoint = _yaw;
|
||||
return ret;
|
||||
@@ -51,12 +51,12 @@ bool FlightTaskDescend::update()
|
||||
if (PX4_ISFINITE(_velocity(2))) {
|
||||
// land with landspeed
|
||||
_velocity_setpoint(2) = _param_mpc_land_speed.get();
|
||||
_thrust_setpoint(2) = NAN;
|
||||
_acceleration_setpoint(2) = NAN;
|
||||
|
||||
} else {
|
||||
// descend with constant thrust (crash landing)
|
||||
// descend with constant acceleration (crash landing)
|
||||
_velocity_setpoint(2) = NAN;
|
||||
_thrust_setpoint(2) = -_param_mpc_thr_hover.get() * 0.7f;
|
||||
_acceleration_setpoint(2) = .3f;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user