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: Set altitude acceptance radius to infinity when moving to land point after transition #24115

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

RomanBapst
Copy link
Contributor

Solved Problem

After a VTOL backtransition the vehicle might not be close enough to the land point and thus needs to move horizontally.
It can happened that during this process the vehicle loses altitude and thus reaches the land point without being within the acceptance radius of the land point. In cases of strong wind or depleted batteries, it might not be possible for the vehicle to climb into the acceptance radius. However, this is also unnecessary, as the goal is eventually to descend.

Solution

Set the altitude acceptance radius to infinity when we are moving to the land point after the backtransition.

Changelog Entry

For release notes:

Feature/Bugfix XYZ
New parameter: XYZ_Z
Documentation: Need to clarify page ... / done, read docs.px4.io/...

Alternatives

We could also ...

Test coverage

Context

Related links, screenshot before/after, video

Copy link

github-actions bot commented Dec 16, 2024

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 176 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +176  +0.0%    +176    .text
  +3.1%     +56  +3.1%     +56    ../../src/modules/navigator/mission.cpp
  +0.4%     +40  +0.4%     +40    ../../src/modules/navigator/navigator_main.cpp
  +3.1%     +36  +3.1%     +36    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  +1.8%     +32  +1.8%     +32    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.0%      +5  +0.0%      +5    [section .text]
  +0.6%      +4  +0.6%      +4    ../../src/modules/navigator/mission_feasibility_checker.cpp
  +0.2%      +3  +0.2%      +3    ../../src/systemcmds/ver/ver.cpp
+0.0%    +124  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  +0.6%     +18  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +1.5%     +50  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0%    +201  [ = ]       0    .debug_info
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.1%     +34  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.0%     +53  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.1%     +98  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.0%     +24  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
+0.0%    +179  [ = ]       0    .debug_line
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +18  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.3%     +65  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +0.1%     +13  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.9%     +62  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.9%     +48  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  -0.2%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%    +281  [ = ]       0    .debug_loc
  +1.6%     +60  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.3%     +78  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +0.6%     +54  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.3%     +19  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +2.0%     +70  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
+0.0%     +25  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +1.2%      +8  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.3%     +24  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +1.2%     +24  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  -3.7%     -24  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  +1.5%      +1  [ = ]       0    task/task_cancelpt.c
+0.0%     +50  [ = ]       0    .debug_str
  +7.0%     +50  [ = ]       0    ../../src/modules/navigator/mission.cpp
-1.0%    -176  [ = ]       0    [Unmapped]
+0.0%    +852  +0.0%    +176    TOTAL

px4_fmu-v6x [Total VM Diff: 168 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +168  +0.0%    +168    .text
  +3.1%     +56  +3.1%     +56    ../../src/modules/navigator/mission.cpp
  +0.4%     +40  +0.4%     +40    ../../src/modules/navigator/navigator_main.cpp
  +3.1%     +36  +3.1%     +36    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  +1.8%     +32  +1.8%     +32    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.6%      +4  +0.6%      +4    ../../src/modules/navigator/mission_feasibility_checker.cpp
+0.0%    +124  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  +0.6%     +18  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +1.5%     +50  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0%    +201  [ = ]       0    .debug_info
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.1%     +34  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.0%     +53  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.1%     +98  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.0%     +24  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
+0.0%    +179  [ = ]       0    .debug_line
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +18  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.3%     +65  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +0.1%     +13  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.9%     +62  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +0.9%     +48  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  -0.2%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%    +280  [ = ]       0    .debug_loc
  +1.6%     +60  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.2%     +62  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +0.6%     +54  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  +0.5%     +34  [ = ]       0    ../../src/modules/navigator/rtl_direct_mission_land.cpp
  +2.0%     +70  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
+0.0%     +22  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +1.2%      +8  [ = ]       0    ../../src/modules/navigator/mission.cpp
  +0.3%     +24  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +1.2%     +24  [ = ]       0    ../../src/modules/navigator/rtl_direct.cpp
  -3.7%     -24  [ = ]       0    ../../src/modules/navigator/rtl_mission_fast_reverse.cpp
  -3.0%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%     +50  [ = ]       0    .debug_str
  +7.0%     +50  [ = ]       0    ../../src/modules/navigator/mission.cpp
-0.2%    -168  [ = ]       0    [Unmapped]
+0.0%    +848  +0.0%    +168    TOTAL

Updated: 2024-12-20T06:59:46

@RomanBapst RomanBapst force-pushed the pr-vtol_land_acceptance_radius branch from 35ce352 to f57ebfb Compare December 16, 2024 13:26
@sfuhrer sfuhrer changed the title Set altitude acceptance radius to infinity when moving to land point after transition Navigator: Set altitude acceptance radius to infinity when moving to land point after transition Dec 19, 2024
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

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

I agree with the logic, just need to double check the one comment.
How extensive did you SITL test it?

src/modules/navigator/mission.cpp Show resolved Hide resolved
src/modules/navigator/navigator_main.cpp Show resolved Hide resolved
@RomanBapst
Copy link
Contributor Author

@sfuhrer I tested this in SITL for all three cases by deliberately making the vehicle overshoot the transition and by adding a hack which increases the altitude setpoint of the land point, once the transition is finished.
I was able to compare behavior with and without the fix.

for land waypoint after backtransition -> avoid
vehicle with depleted battery from not reaching the alt
setpoint and getting stuck
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
@RomanBapst RomanBapst force-pushed the pr-vtol_land_acceptance_radius branch from 640a100 to b9b82ec Compare December 20, 2024 06:54
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

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

Thanks!

@sfuhrer sfuhrer merged commit b765769 into main Dec 20, 2024
59 of 60 checks passed
@sfuhrer sfuhrer deleted the pr-vtol_land_acceptance_radius branch December 20, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants