FlightTasks: adapt to acceleration based control

This commit is contained in:
Matthias Grob
2020-03-30 09:58:39 +02:00
parent b3d7445059
commit b79b095ce7
10 changed files with 38 additions and 37 deletions
@@ -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;