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

RTL: change when to set a heading setpoint, generally leave it up to executer #22731

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Feb 8, 2024

Solved Problem

VTOLs yawing to the home position heading when descending in hover during RTL instead of weather-vaning.

Solution

Continue with what was started in #22532:

  • remove RTL_HDG_MD (necessity of it hasn't been proven and it interferes with the here proposed solution)
  • only set heading setpoint in Navigator::RTL once above landing point, or when RTL is triggered close to it
  • never set a heading setpoint in the RTL if weather vane is enabled

Changelog Entry

For release notes:

Bugfix: Fix weather vane in RTL
Feature: Make RTL behavior more deterministic by removing the parameter RTL_HDG_MD.

Test coverage

SITL tested.

Context

This is how a normal RTL with a MC looks like (the behavior doesn't change with this PR):

  • climb while keeping heading
  • return over landing point without a specified heading --> executor (FlightTaskAuto) sets heading in direction of flight
  • once over landing point set destination heading (home position heading in this case) and don't change it anymore
AMC_RTL_new_behavior.mp4

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.

Nice. Thanks for this generally nice improvement!
The only question I have is about this DestinationPosition dest which contains a yaw. As I read it this was supposed to contain the actual heading setpoint and I would have probably gone back to this. But if we have a separate heading_sp then I'd suggest only having one way. Or make it very clear when to use which.

src/modules/navigator/rtl_direct.cpp Outdated Show resolved Hide resolved
src/modules/navigator/rtl_direct.cpp Outdated Show resolved Hide resolved
sfuhrer and others added 2 commits February 12, 2024 14:45
…the executer

-remove RTL_HDG_MD
-only set heading setpoint in Navigator::RTL once above landing point,
or when RTL is triggered close to it
-never set a heading during RTL if weather vane is enabled

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

MaEtUgR commented Feb 12, 2024

@sfuhrer I rebased and added a commit which I'd presume does the same without the duplication in the interface. Did I overlook something?

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
MaEtUgR
MaEtUgR previously approved these changes Feb 12, 2024
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.

Much clearer 👍

src/modules/navigator/mission_block.cpp Outdated Show resolved Hide resolved
Co-authored-by: Matthias Grob <maetugr@gmail.com>
@MaEtUgR MaEtUgR merged commit c9ad60e into main Feb 13, 2024
90 of 92 checks passed
@MaEtUgR MaEtUgR deleted the pr-yaw-behavior-rtl-main branch February 13, 2024 09:34
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

2 participants