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

Navigator: Loiter: always establish new Loiter with center at current position #21775

Merged
merged 1 commit into from Jul 4, 2023

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Jun 29, 2023

Solved Problem

#21702

Vehicle keeps flying towards Loiter waypoint if Hold mode is selected. In the past we within Navigator set the type to POSITION when far away from a Loiter waypoint, and then only to LOITER when really on established loiter, but this distinction is now no longer part of Navigator and the FW position controller handles it.

Solution

When switching into Hold mode establish a Loiter around current position, even if we were before already loitering (eg in Mission mode). This results in the same behavior when switching into Hold/Loiter mode directly (either through RC switch or in the flight mode selection in QGC) or through the "Hold" button in QGC (which sends a DO_REPOSITION with the fields at the current position).

In this screen recording you see the behavior prior and after this PR.
https://github.com/PX4/PX4-Autopilot/assets/26798987/9079b575-77fc-40a2-be54-b3c11816cca3

Changelog Entry

For release notes:

Bugfix: Fixed-wing: Always establish loiter around current position when switching into Hold mode

Alternatives

Fix detection on whether we're currently on an established loiter, and in that case don't loiter around current position but keep established loiter. Personally I though prefer to stick to Hold = Loiter around current position always. Imagine being on a huge loiter. If the vehicle then keeps following it it's hardly anymore "Holding position".

… pos

When switching into Hold mode establish a Loiter around current position,
even if we were before already loitering (eg in Mission mode).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.
I tested and with the multirotor I could not get it to not stop when just changing to hold mode also before.

But while testing that I found that when I press pause in QGC it actually flies to the next waypoint still and stops there. The code changed it here not called at all in this case probably because of the reposition command like you wrote.

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Jun 30, 2023

But while testing that I found that when I press pause in QGC it actually flies to the next waypoint still and stops there. The code changed it here not called at all in this case probably because of the reposition command like you wrote.

Which QGC version did you test with? I couldn't reproduce with mine (v4.2.6 from this March). But yes, like you said not affected by this PR.

@bkueng bkueng merged commit f275085 into main Jul 4, 2023
82 of 86 checks passed
@bkueng bkueng deleted the pr-navigator-hold-at-current-pos-main branch July 4, 2023 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants