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

Fix: replay the mission cached items only upon reaching resume waypoint #23484

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

StefanoColli
Copy link
Contributor

Solved Problem

Upon mission resume (e.g., after a RTL), the gimbal would immediately assume its previous configuration instead of waiting having reached a mission waypoint.
Similarly the camera would start triggering from take-off instead of from the last reached mission waypoint

Solution

Store the index of the last mission item reached before the mission interruption, then replay the cached drone commands only after having reached such mission item

Alternatives

We could also used the existing _inactivation_index variable but it has a slightly different meaning and has a different reset behaviour

Test coverage

  • The gimbal issue has been test in SITL
  • The camera issue needs to be flight tested

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 for your contribution, it works correctly in my simulation. An alternative would be to add a _work_item_type != WorkItemType::WORK_ITEM_TYPE_CLIMB after the check for is_mission_item_reached_or_completed(), as it's really only the inserted climb mission item that brings the logic out of order. But your proposed solution seems a bit more robust.

src/modules/navigator/mission_base.cpp Outdated Show resolved Hide resolved
src/modules/navigator/mission_base.cpp Outdated Show resolved Hide resolved
src/modules/navigator/mission_base.h Outdated Show resolved Hide resolved
@sfuhrer sfuhrer marked this pull request as ready for review August 13, 2024 09:58
sfuhrer and others added 2 commits August 13, 2024 11:58
Split camera mode mission items from gimbal ones so to have a finer control over the relative replays
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.

Looks good to me!

@sfuhrer sfuhrer merged commit e2c0e5c into PX4:main Aug 13, 2024
92 checks passed
vertiq-jordan pushed a commit to iq-motion-control/PX4-Autopilot that referenced this pull request Aug 21, 2024
…ching resume waypoint (PX4#23484)

* Fix: replay the mission cached items only upon reaching resume waypoint

* Refactoring
Split camera mode mission items from gimbal ones so to have a finer control over the relative replays

* Chore: fix formatting

---------

Co-authored-by: Silvan Fuhrer <[email protected]>
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.

2 participants