fix(FlightTaskAuto): passed waypoint check in 3D

This should not have real downsides but in priciple the driftaway could also happen vertically.
This commit is contained in:
Matthias Grob
2026-08-27 19:32:43 +02:00
parent 779ec879e8
commit b4bcbb22fb
2 changed files with 3 additions and 3 deletions
@@ -768,8 +768,8 @@ bool FlightTaskAuto::isTargetModified() const
bool FlightTaskAuto::_hasPassedCurrentWaypoint() const
{
const Vector2f u_previous_to_current = Vector2f(_triplet_current - _triplet_previous).unit_or_zero();
return u_previous_to_current * Vector2f(_triplet_current - _position) < 0.f;
const Vector3f u_previous_to_current = (_triplet_current - _triplet_previous).unit_or_zero();
return u_previous_to_current * (_triplet_current - _position) < 0.f;
}
void FlightTaskAuto::_updateTrajConstraints()
@@ -195,6 +195,6 @@ private:
bool _evaluatePositionSetpointTriplet();
bool _isFinite(const position_setpoint_s &sp); /**< Checks if all waypoint triplets are finite. */
bool _evaluateGlobalReference(); /**< Check is global reference is available. */
bool _hasPassedCurrentWaypoint() const; /**< True if the vehicle is horizontally past the current waypoint */
bool _hasPassedCurrentWaypoint() const; /**< True if the vehicle is past the current waypoint */
void _set_heading_from_mode(); /**< @see MPC_YAW_MODE */
};