FlightTaskAuto: pure virtual reset method

This commit is contained in:
Dennis Mannhart
2018-07-20 09:26:18 +02:00
committed by Lorenz Meier
parent 2c385e6967
commit 69ea4df45c
4 changed files with 27 additions and 9 deletions
@@ -59,14 +59,7 @@ FlightTaskAutoLine::FlightTaskAutoLine(control::SuperBlock *parent, const char *
bool FlightTaskAutoLine::activate()
{
_vel_sp_xy = matrix::Vector2f(&_velocity(0));
_pos_sp_xy = matrix::Vector2f(&_position(0));
_vel_sp_z = _velocity(2);
_pos_sp_z = _position(2);
_destination = _target;
_origin = _prev_wp;
_speed_at_target = 0.0f;
_reset();
return FlightTaskAuto::activate();
}
@@ -101,6 +94,19 @@ bool FlightTaskAutoLine::update()
return true;
}
void FlightTaskAutoLine::_reset()
{
/* Set setpoints equal current state. */
_vel_sp_xy = matrix::Vector2f(&_velocity(0));
_pos_sp_xy = matrix::Vector2f(&_position(0));
_vel_sp_z = _velocity(2);
_pos_sp_z = _position(2);
_destination = _target;
_origin = _prev_wp;
_speed_at_target = 0.0f;
}
void FlightTaskAutoLine::_generateIdleSetpoints()
{
/* Send zero thrust setpoint */