-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
AP_Mission: Reduce the number of places _set_cmd is called from #9256
Conversation
I don't object to this change but in Copter and (I think) Rover, if there is an unknown command the verify step immediately returns true and we move onto the next command. That takes an iteration or two but the vehicle keeps doing whatever it was doing during the interim. So if it was going to a waypoint then it will just stop or circle around the waypoint. |
Yeah plane does that as well, the end state (and not in this PR) is that I'd like to not be stuck in an indeterminate amount of time like that, and on plane I actually want to ensure that the vehicle doesn't try and run the verify. |
@WickedShell, OK. I wonder what would happen in the end state if there were 50 unknown commands with a do-jump going back to the first one. In any case.. I guess we shall see when we get there. |
You hit the 255 command limit and it would return without doing anything, same as what it does now. This actually fixes a bug where it never returns if you used set_command_index into that list at the moment. |
f21880c
to
0f6aa04
Compare
0f6aa04
to
ce0ca45
Compare
While @WickedShell wanted this to be NFC, some functional changes did creep in - but my understanding is that those changes are strictly beneficial. |
So to expand slightly on the functional change that came in. |
I'm looking into making commands skippable if the vehicle will not actually preform any actions (as part of #9186) however to do this we need to honor the return value of starting a command. This PR simplifies the paths through the code that call _cmd_start. This is also worthwhile as
set_current_command
was missing the protection against endless do jump loops thatadvance_current_nav_cmd
has. (Which means that a malformed mission can lock the FMU if a set_current_command points into the sequence).This is meant to be a no functional change and presented by itself for easier review.