mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 01:30:35 +08:00
FlightTask StraightLine: remove unused target reached flag
This commit is contained in:
committed by
Lorenz Meier
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)
|
void StraightLine::generateSetpoints(matrix::Vector3f &position_setpoint, matrix::Vector3f &velocity_setpoint)
|
||||||
{
|
{
|
||||||
// Check if target position has been reached
|
// Check if target position has been reached
|
||||||
if (_is_target_reached || (_desired_speed_at_target < VEL_ZERO_THRESHOLD &&
|
if (_desired_speed_at_target < VEL_ZERO_THRESHOLD &&
|
||||||
(_pos - _target).length() < NAV_ACC_RAD.get())) {
|
(_pos - _target).length() < NAV_ACC_RAD.get()) {
|
||||||
// Vehicle has reached target. Lock position
|
// Vehicle has reached target. Lock position
|
||||||
position_setpoint = _target;
|
position_setpoint = _target;
|
||||||
velocity_setpoint = Vector3f(0.0f, 0.0f, 0.0f);
|
velocity_setpoint = Vector3f(0.0f, 0.0f, 0.0f);
|
||||||
_is_target_reached = true;
|
|
||||||
|
|
||||||
return;
|
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))) {
|
if (PX4_ISFINITE(target(0)) && PX4_ISFINITE(target(1)) && PX4_ISFINITE(target(2))) {
|
||||||
_target = target;
|
_target = target;
|
||||||
_is_target_reached = false;
|
|
||||||
|
|
||||||
// set all parameters to their default value (depends on the direction)
|
// set all parameters to their default value (depends on the direction)
|
||||||
setAllDefaults();
|
setAllDefaults();
|
||||||
|
|||||||
@@ -92,8 +92,6 @@ private:
|
|||||||
float _desired_speed{0.0f}; /**< desired maximum velocity */
|
float _desired_speed{0.0f}; /**< desired maximum velocity */
|
||||||
float _desired_speed_at_target{0.0f}; /**< desired velocity at target point */
|
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 _target{}; /**< End point of the straight line */
|
||||||
matrix::Vector3f _origin{}; /**< Start point of the straight line */
|
matrix::Vector3f _origin{}; /**< Start point of the straight line */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user