Skip to content

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

Merged
sfuhrer merged 4 commits intoPX4:mainfrom
StefanoColli:pr-mission-resume
Aug 13, 2024
Merged

Fix: replay the mission cached items only upon reaching resume waypoint#23484
sfuhrer merged 4 commits intoPX4:mainfrom
StefanoColli:pr-mission-resume

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

@sfuhrer sfuhrer self-requested a review August 2, 2024 10:05
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.

@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
@StefanoColli StefanoColli requested a review from sfuhrer August 13, 2024 12:28
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
Ali-barari pushed a commit to Ali-barari/AvesAID that referenced this pull request Apr 29, 2025
…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 <silvan@auterion.com>
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.

2 participants