mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
FlightTask StraightLine: remove unused target reached flag
This commit is contained in:
parent
090db6a115
commit
8998714130
@ -54,12 +54,11 @@ StraightLine::StraightLine(ModuleParams *parent, const float &deltatime, const m
|
||||
void StraightLine::generateSetpoints(matrix::Vector3f &position_setpoint, matrix::Vector3f &velocity_setpoint)
|
||||
{
|
||||
// Check if target position has been reached
|
||||
if (_is_target_reached || (_desired_speed_at_target < VEL_ZERO_THRESHOLD &&
|
||||
(_pos - _target).length() < NAV_ACC_RAD.get())) {
|
||||
if (_desired_speed_at_target < VEL_ZERO_THRESHOLD &&
|
||||
(_pos - _target).length() < NAV_ACC_RAD.get()) {
|
||||
// Vehicle has reached target. Lock position
|
||||
position_setpoint = _target;
|
||||
velocity_setpoint = Vector3f(0.0f, 0.0f, 0.0f);
|
||||
_is_target_reached = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@ -171,7 +170,6 @@ void StraightLine::setTarget(const matrix::Vector3f &target)
|
||||
{
|
||||
if (PX4_ISFINITE(target(0)) && PX4_ISFINITE(target(1)) && PX4_ISFINITE(target(2))) {
|
||||
_target = target;
|
||||
_is_target_reached = false;
|
||||
|
||||
// set all parameters to their default value (depends on the direction)
|
||||
setAllDefaults();
|
||||
|
||||
@ -92,8 +92,6 @@ private:
|
||||
float _desired_speed{0.0f}; /**< desired maximum velocity */
|
||||
float _desired_speed_at_target{0.0f}; /**< desired velocity at target point */
|
||||
|
||||
bool _is_target_reached{false};
|
||||
|
||||
matrix::Vector3f _target{}; /**< End point of the straight line */
|
||||
matrix::Vector3f _origin{}; /**< Start point of the straight line */
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user