Skip to content

separate RTL and Mission mode#20903

Merged
sfuhrer merged 8 commits intomainfrom
rearrange_rtl_mission_mode
Sep 29, 2023
Merged

separate RTL and Mission mode#20903
sfuhrer merged 8 commits intomainfrom
rearrange_rtl_mission_mode

Conversation

@KonradRudin
Copy link
Copy Markdown
Contributor

@KonradRudin KonradRudin commented Jan 11, 2023

Solved Problem

Clean up to separate the RTL mode from the mission mode. Currently when in RTL, part of the RTL logic is executed within the mission mode.

Solution

  • Add a base class which loads the mission items and starts and stops the mission mode
  • Refactor mission mode to separate it from the reverse and fast forward execution mode. It only executes the planned mission.
  • Add separate classes for RTL mission reverse and mission fast forward. Those classes can interact directly with the planned mission instead of relying on the mission mode.

Bug Fixes in the process:

  • RTL for mission reverse is now working andand lands on the home position.
  • Updated RTL logic such that for RTL type 1, if a safepoint exists, it is always preferred over the home position.

Behavior changes:

  • Mission now updates the dataman cache only when it is active, this could lead to a blocked calculation state on the activation of the mode. Once activated, it should not block anymore as before.
  • Calculation fro the land item is now performed on mission upload instead afterwards in the mission module.
  • Dataman Client has additional function for writing. While a write is performed the mission item is also updated in the cache if it is loaded.

Alternatives

Test coverage

Context

Related links, screenshot before/after, video

@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch 2 times, most recently from a5dbccd to fa3ca9c Compare January 16, 2023 15:54
RomanBapst
RomanBapst previously approved these changes Jan 19, 2023
@KonradRudin KonradRudin marked this pull request as ready for review January 23, 2023 09:18
Comment thread test/mavsdk_tests/test_vtol_mission.cpp Outdated
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch 3 times, most recently from 9543cc4 to 4020dd0 Compare February 1, 2023 08:16
@RomanBapst RomanBapst force-pushed the rearrange_rtl_mission_mode branch from 4020dd0 to 8b8e0bf Compare March 10, 2023 12:06
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch from 8b8e0bf to 8f61320 Compare July 14, 2023 15:11
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch 3 times, most recently from b3e4f2a to b6c3a25 Compare August 7, 2023 07:17
@KonradRudin KonradRudin requested a review from RomanBapst August 7, 2023 07:23
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch from 5a0e5b6 to 511289b Compare August 8, 2023 12:56
@hamishwillee
Copy link
Copy Markdown
Contributor

@KonradRudin Return mode has been one of the hardest things historically do document - you can see now complicated it is here: https://docs.px4.io/main/en/flight_modes/return.html#return-types-rtl-type

When this is done, if there is any change to the external behaviour, can you help me update please?

@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch 3 times, most recently from b669bae to 94101e6 Compare August 15, 2023 15:08
@tstastny tstastny requested a review from sfuhrer August 16, 2023 07:43
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch 5 times, most recently from 470cfcd to a1de174 Compare August 21, 2023 12:53
@sfuhrer
Copy link
Copy Markdown
Contributor

sfuhrer commented Sep 20, 2023

Rebased and solved some conflicts that came in with #20908. Also made one fix for the mission resume: 5895f0e.
Tested it then in SITL on quad and VTOL a bit.

@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch from ea74f00 to b5e56e4 Compare September 25, 2023 08:39
@KonradRudin
Copy link
Copy Markdown
Contributor Author

Rebased again on current main

@sfuhrer
Copy link
Copy Markdown
Contributor

sfuhrer commented Sep 25, 2023

@KonradRudin We found two issues while flight testing it, that I now addressed:

  • 2093c45: Fixes issue where vehicle was doing weird loiters ("flowers") because on mission resume, the waypoint type was set to TAKEOFF, while it actually was loitering to achieve the resume altitude
  • f7bffa7: fixes issue where on resume not the altitude of the *first waypoint from the resume index was taken, but the altitude of the the first waypoint containing a position *after the resume wp

@sfuhrer sfuhrer force-pushed the rearrange_rtl_mission_mode branch from f7bffa7 to f8e0cf4 Compare September 27, 2023 08:10
@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch from 16df123 to 553f00f Compare September 28, 2023 07:33
@KonradRudin
Copy link
Copy Markdown
Contributor Author

rebased on current main

@KonradRudin KonradRudin force-pushed the rearrange_rtl_mission_mode branch from abf33f7 to ca72fe7 Compare September 28, 2023 12:38
@KonradRudin
Copy link
Copy Markdown
Contributor Author

squashed commits

KonradRudin and others added 8 commits September 29, 2023 11:10
…oes all its mission related computation in its own class.

Dataman: Add write function to dataman cache.

RTL and mission have a new common base class mission_base. Both inherit from them and mission, RTL mission, and rtl reverse mission inherit from them and implement their desired functionalities. This simplifies the logic in mission as well as make the logic in rtl mission reverse and mission more readable.
Rtl mission reverse now functional again for VTOL flying back the mission and transitioning to MC at the home position.
Dataman cache has new write functionality to write to dataman while updating write item in its cache if necessary.
Dataman cache is now only updated when the respective module is active. Leads to a higher computation time once on activation, but decreases unnecessary cache updates when inactive.
…ssion RTL

mavsdk-test: added a vtol mission without a landing at the end (used for reversed RTL)
math_helpers: added function to compute local position from a raw mission item

Signed-off-by: RomanBapst <bapstroman@gmail.com>
…ing/safepoint if available and not in RW mode.
… disable checks tracks fro reverse mission.

Current threshhold has no margins of errors with the set acceptance radius. Increase corridor radius by 5m.
Increase time to disarm for tailsitter test to pass.
Rverse mission needs check tracks test disabled since mavsdk does not really work with mission has reverse order.
…except fmu_v5x and sitl.

QGC does not support VTOL takeoff and thus this is used to safe flash space.
@sfuhrer sfuhrer force-pushed the rearrange_rtl_mission_mode branch from ca72fe7 to fa296e6 Compare September 29, 2023 09:13
@sfuhrer sfuhrer merged commit ee5cfbb into main Sep 29, 2023
@sfuhrer sfuhrer deleted the rearrange_rtl_mission_mode branch September 29, 2023 12:25
@KonradRudin
Copy link
Copy Markdown
Contributor Author

@hamishwillee the docs should still be up to date, so no changes necessary.

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.

7 participants