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

Waypoint multi-mission in flight mission change #8354

Merged
merged 13 commits into from
Sep 20, 2022

Conversation

breadoven
Copy link
Collaborator

@breadoven breadoven commented Aug 24, 2022

Closes #8301.

Allows WP multi-missions to be changed in flight using new mission change mode. With mode active the required mission index can be selected by cycling through missions using the WP mode switch. Selected mission is loaded when mission change mode is switched off. Mission index can also be changed through addition of a new Mission Index adjustment function which should be useful for DJI users unable to use the normal OSD mission related fields.

PR also improves function of multi-missions by keeping waypoint mission array intact on arming rather than overwriting the start of the array with the selected mission as happens currently (this requires eeprom reload when disarmed to restore the mission array).

Not flight tested yet but works as expected using the HITL Sim.

@breadoven breadoven merged commit 0499a2a into iNavFlight:master Sep 20, 2022
@breadoven breadoven added this to the 6.0 milestone Sep 20, 2022
@breadoven breadoven added Enhancement Release Notes Add this when a PR needs to be mentioned in the release notes and removed Ready to merge labels Sep 20, 2022
@breadoven breadoven deleted the abo_wp_mission_flight_select branch December 9, 2022 11:47
@b14ckyy
Copy link
Collaborator

b14ckyy commented Dec 14, 2022

Tested today but found 2 major problems.

  1. When submitting the Missions to INAV via Configurator without rebooting, Mission index is stuck at M0 and does not allow me to switch. Therefore it runs all missions in a row. The only way the switching works is, to store the missions into EEPROM, then reboot and load missions from EEPROM. Therefore I cannot live upload multi missions in flight and then select them.

  2. All my flight modes are on a single channel. So if I fly in Cruise mode to give up control and take my time to select the WP mission, every time I flick the NAV WP mode switch, this is the only mode applied and cruise is disabled. Therefore the craft switches into ACRO for that moment. Would it be possible to "freeze" the last mode as long as MISSION CHANGE + NAV WP is active to prevent this? Otherwise people will be forced to waste a RC channel for safety reasons. Especially on Quads where switching from POSHOLD to ACRO by accident could be fatal.

@breadoven
Copy link
Collaborator Author

Tested today but found 2 major problems.

  1. When submitting the Missions to INAV via Configurator without rebooting, Mission index is stuck at M0 and does not allow me to switch. Therefore it runs all missions in a row. The only way the switching works is, to store the missions into EEPROM, then reboot and load missions from EEPROM. Therefore I cannot live upload multi missions in flight and then select them.

That may be the case but multi missions was really only intended as a means of having access to more than a single mission loaded from eeprom. There doesn't seem much point in using it if you have the ability to upload missions in flight because you can use the upload itself as the means to change missions as required.

  1. All my flight modes are on a single channel. So if I fly in Cruise mode to give up control and take my time to select the WP mission, every time I flick the NAV WP mode switch, this is the only mode applied and cruise is disabled. Therefore the craft switches into ACRO for that moment. Would it be possible to "freeze" the last mode as long as MISSION CHANGE + NAV WP is active to prevent this? Otherwise people will be forced to waste a RC channel for safety reasons. Especially on Quads where switching from POSHOLD to ACRO by accident could be fatal.

I guess it's always problematic trying to accommodate all possibilities here, too many modes for not enough channels, I'm not sure what the ideal solution is. Remember there is also the possibility to change mission index in flight using Adjustments which is actually easier than toggling the WP mode switch..

@b14ckyy
Copy link
Collaborator

b14ckyy commented Dec 14, 2022

To point 1:
Ok I get that. The only issue I see is, that even if I upload a mission on the ground into EEPROM, I am forced to reboot and reload to make the switch work.

To point 2:
I could mitigate this problem by either adding LOITER/POSHOLD to the MISSION CHANGE range as I think these have higher priority than NAV WP?
Alternatively a Logic condition could help as well that reads the current mode channel position, stores it into a GV and then overrides the mode channel with that value as soon as MISSION CHANGE + NAV WP is active. But this results in a 2% chance if still switching and maybe locking the plane in that mode afterwards. Need to test that out.
Or generally locking the FM as soon as MISSION CHANGE is enabled but this could by accident lock the craft also in the current flight mode if the pilot does not realize.

I guess forcing POSHOLD would be the safest option. It would also make the most sense as a general way the feature works. what else should the craft do while selecting a mission?

@breadoven
Copy link
Collaborator Author

I just set up MISSION CHANGE active together with POSHOLD which is the easiest way so long as POSHOLD and WP modes are on different channels. WP has priority over POSHOLD, but is inhibited when MISSION CHANGE is active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New feature request: Change missions in flight
2 participants