flight task auto: fix offtrack mission landing bug#25725
Conversation
During a mission the last waypoint is often a LAND. If the previous waypoint is not directly above the land waypoint the offtrack calculation is incorrect. This regression was introduced when the offtrack calculation switched from 2D to 3D.
MaEtUgR
left a comment
There was a problem hiding this comment.
Thanks for looking into this @dakejahl!
If I understand correctly:
- With a waypoint of type land
FlightTaskAutodoes special handling and not follow an absolute altitude but rather descends to land at the expected coordinates. - Before #23371 this had no effect on the offtrack state machine because all checks were horizontal 2D and the vertical descent had no effect on them.
- Now you exclude land waypoints being able to enter an offtrack state because the decent makes the vehicle go outside of the 3D acceptance sphere.
This is an acceptable hotfix for me but really we should simplify this logic. I'm more than motivated to make suggestions for that.
I have a remaining question for my understanding on land waypoints: They can happen in a different location than where the vehicle currently is. Does Navigator make sure that the coordinates of the land waypoint are reached before the waypoint type is land or is there other handling to make sure it actually lands where commanded?
The vehicle travels to the land waypoint and only after reaching it does it mark the waypoint as a land type and begin descent. It is at this point that the offtrack logic was kicking in and adjusting the vehicle position erratically. As far as navigator logic goes... it is so convoluted I can't follow it at all 😢 |
During a mission the last waypoint is often a LAND. If the previous waypoint is not directly above the land waypoint the offtrack calculation is incorrect. This regression was introduced when the offtrack calculation switched from 2D to 3D.
During a mission the last waypoint is often a land waypoint. If the previous waypoint is not directly above the land waypoint the offtrack calculation is incorrect. Land is a special case and should not use the offtrack logic which is intended for line-following between waypoints.
Introduced in #23371 when the offtrack calculation switched from 2D to 3D.
Fixes #25723