FlightTasks: fix reActivate not calling the parent overrided method

This commit is contained in:
Matthias Grob
2020-10-26 14:42:24 +01:00
parent eac9a6b68b
commit 7ba93d5452
3 changed files with 4 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ bool FlightTaskAutoLineSmoothVel::activate(const vehicle_local_position_setpoint
void FlightTaskAutoLineSmoothVel::reActivate()
{
FlightTaskAutoMapper::reActivate();
// On ground, reset acceleration and velocity to zero
for (int i = 0; i < 2; ++i) {
_trajectory[i].reset(0.f, 0.f, _position(i));

View File

@@ -63,6 +63,7 @@ bool FlightTaskManualAltitudeSmoothVel::activate(const vehicle_local_position_se
void FlightTaskManualAltitudeSmoothVel::reActivate()
{
FlightTaskManualAltitude::reActivate();
// The task is reacivated while the vehicle is on the ground. To detect takeoff in mc_pos_control_main properly
// using the generated jerk, reset the z derivatives to zero
_smoothing.reset(0.f, 0.f, _position(2));

View File

@@ -66,6 +66,7 @@ bool FlightTaskManualPositionSmoothVel::activate(const vehicle_local_position_se
void FlightTaskManualPositionSmoothVel::reActivate()
{
FlightTaskManualPosition::reActivate();
// The task is reacivated while the vehicle is on the ground. To detect takeoff in mc_pos_control_main properly
// using the generated jerk, reset the z derivatives to zero
_smoothing_xy.reset(Vector2f(), Vector2f(_velocity), Vector2f(_position));