mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +08:00
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:
@@ -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 */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user