Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FW Position Controller: navigateWaypoint(): fix corner case of vehicle not turning back to waypoint #21635

Merged
merged 1 commit into from
May 26, 2023

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented May 24, 2023

Solved Problem

Fixes #21327

Vehicle fly away when the currently active WP is the current vehicle position, relative to the line from previous to next waypoint. That happens e.g. when the vehicle loitered to achieve altitude and is then "passed" the current WP when the altitude is accepted.
image

Solution

There was already logic in place that handled the case of the vehicle being behind the previous WP, but no one where the vehicle is ahead of the current WP. I added that now. The logic changes the guidance from tracking a path between two WP to fly directly to the active WP.

Further, in the second commit I removed the check for "if further than acceptance from waypoint" to apply the special handling. It seems dangerous to me to keep it, what happens if Navigator doesn't accept the WP once within this acceptance radius? In my eyes we should always fly straight to the waypoint instead of doing path following in this case. EDIT: removed this change again.

Changelog Entry

For release notes:

Bugfix FW Position Controller: navigateWaypoint(): fix corner case of vehicle not turning back to waypoint

…int and need to turn back

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer force-pushed the pr-fw-pos-c-fix-behind-wp-main branch from 12be8ce to f88bc2a Compare May 26, 2023 12:36
@tstastny
Copy link

Ok for now - let's try and schedule an audit of our current navigator fw pos ctrl waypoint handling distribution for the next release to nail down a bit clearer interfaces, and also exactly what behaviors we want to write down as requirements.

@sfuhrer sfuhrer merged commit bd182ec into main May 26, 2023
@sfuhrer sfuhrer deleted the pr-fw-pos-c-fix-behind-wp-main branch May 26, 2023 13:12
harrisondragoon pushed a commit to harrisondragoon/PX4-Autopilot that referenced this pull request May 31, 2023
…int and need to turn back (PX4#21635)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flyaway after loiter to altitude
2 participants