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 Mission: Improve mission resume #21710

Merged
merged 3 commits into from
Jun 20, 2023
Merged

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Jun 9, 2023

Replaces #21643. I've tried to clean up the logic a bit and make it less entangled.

Solved Problem

Survey mission contain, beside the position items, contain items for gimbal config, camera mode config, and camera trigger. When the execution of a mission is stopped, we want also to stop the camera from taking pictures and move the gimbal back to neutral. Upon resuming the mission though, we have to re-configure gimbal and camera and start the triggering once back on the mission path.

Solution

Store (cache) all gimbal/camera/trigger mission items and replay them on resuming the mission. In detail:

  • on_inactivation() store the currently active index as _inactivation_index
  • on_activation(), store all gimbal/camera/trigger items up to the currently active index and reset the mission to the previous. Also set flag (_align_heading_necessary) that a yaw alignment is required upon reaching this waypoint (we want to only start triggering once yaw is correctly aligned with next WP).
  • on_active()
    • if _align_heading_necessary is set and mission item is reached, update current item with yaw field and force it to accept that one before starting the trigger.
    • read the gimbal and camera mode command items from cache, thus making the gimbal move to the right orientation and setting the right camera mode
    • read the trigger commands once the previous waypoint incl. yaw alignment is accepted

Further:

  • reset cached items if mission is updated
  • reset mission on disarmed only if we reached the last mission item, otherwise keep

Changelog Entry

For release notes:

Feature: Improve mission resume (e.g. replay gimbal and camera commands of a survey)
Documentation: Need to clarify page

Alternatives

It would be nice to not resume the mission from the previous mission item but from the actual lat/lon position where the mission was interrupted.

Test coverage

SITL tested.

@RomanBapst
Copy link
Contributor

@sfuhrer LGTM. I hard a hard time understanding how the mission item is set when resuming the survey without calling set_mission_items but then I realized that set_current_mission_index does it under the hood :-p

Copy link
Contributor

@RomanBapst RomanBapst left a comment

Choose a reason for hiding this comment

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

Added comments in the code

@RomanBapst
Copy link
Contributor

@sfuhrer Flash overflow :-(

@sfuhrer sfuhrer force-pushed the pr-survey-mission-resume-main branch from 680898e to c1b61ef Compare June 19, 2023 09:06
@sfuhrer
Copy link
Contributor Author

sfuhrer commented Jun 19, 2023

@sfuhrer Flash overflow :-(

v4_test indeed is at 100.00%..in an effort to bring it slightly down I've removed some rather unnecessary params and made some other param descriptions more compact, let's see if that's enough.

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Jun 19, 2023

@sfuhrer Flash overflow :-(

v4_test indeed is at 100.00%..in an effort to bring it slightly down I've removed some rather unnecessary params and made some other param descriptions more compact, let's see if that's enough.

That wasn't enough. I've proposed to remove the gyro FFT instead: #20811

@sfuhrer sfuhrer force-pushed the pr-survey-mission-resume-main branch from c1b61ef to 25370a4 Compare June 19, 2023 10:07
…erate function

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer force-pushed the pr-survey-mission-resume-main branch from 25370a4 to 63e1d42 Compare June 20, 2023 09:14
@sfuhrer sfuhrer merged commit 18f0311 into main Jun 20, 2023
80 of 85 checks passed
@sfuhrer sfuhrer deleted the pr-survey-mission-resume-main branch June 20, 2023 12:38
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.

None yet

2 participants