mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 08:53:38 +08:00
FlightTaskAuto: pure virtual reset method
This commit is contained in:
committed by
Lorenz Meier
parent
2c385e6967
commit
69ea4df45c
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user