DO_JUMP behaviour
Current DO_JUMP behaviour is sometimes difficult for users to understand as these things are counter-intuitive:
- putting a DO_JUMP as the last item in a mission causes it to be ignored. Putting a "dummy" WP after every DO_JUMP fixes this.
- the "repeat" value for DO_JUMP is decremented in-place in the EEPROM, resulting in odd behaviour when missions are restarted ( eg, have a DO_JUMP set to repeat 3 times, then fly the mission in its entirety, and when the mission is restarted, the DO_JUMP never executes, as its decrimented to zero ). re-loading the mission from the GCS fixes this temporarily, but it happens any time a "mission restart" occurs.
Lets discuss this, and try to make it "more obvious" for user/s, one way or another.
Yes, i agree. I had a bit of a look at changing it so that all the conditional commands can also run before the first waypoint or after the last one. It'll require a bit of a reorganisation of how the two types of commands (navigation and conditional) run though. It's on my list but i'm happy to help give some advice to others who want to have a try and fixing this issue. Remember that we should also change it for arduplane at the same time.
Hi, I am working on a library called AP_Mission that refactors the command and waypoint handling to support the waypoint update I've been working on. This will address the DO_JUMP behavior and make it easier to modify it if desired.
Brandon- can you post your work in progress in a fork? Looking forwards to getting that into the trunk.
Here is the branch I am working in:
https://github.com/brnjones/ardupilot/tree/AP_Mission
Overall the library contains the waypoints (previous, current, and after) and associated commands. The vehicle code can 1) increment the waypoint stack or 2) change it to a specified index. Then non_nav commands associated with that mission leg are available. That is the overall intent...
I was hoping to get a pull request in today for review by Tridge, et al, but have been stuck. I am using the example pde to do all my testing, but CMD_INDEX, and CMD_TOTAL values returned by the parameter library are wrong. I had this working last week. I switched back to master, and tested with \Tools\VARTest (the code I lifted to read/write parameters) and the values for CMD_INDEX and CMD_TOTAL that is displays are wrong as well. So I am deep in a rabbit hole right now...
Here is a pull-request with AP_Mission:
https://github.com/brnjones/ardupilot/commit/5724692aafbcaf21fbf565c3f48b50f862ff5dcd
AP_Mission is in master now and should resolve this issue. This item will also appear on the to-be-tested list ahead of the AC3.2 release.