ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

DO_JUMP behaviour

Open davidbuzz opened this issue 13 years ago • 6 comments

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.

davidbuzz avatar Jan 09 '13 02:01 davidbuzz

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.

rmackay9 avatar Jan 09 '13 03:01 rmackay9

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.

brnjones avatar Jan 13 '13 12:01 brnjones

Brandon- can you post your work in progress in a fork? Looking forwards to getting that into the trunk.

pchickey avatar Jan 13 '13 16:01 pchickey

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...

brnjones avatar Jan 13 '13 16:01 brnjones

Here is a pull-request with AP_Mission:

https://github.com/brnjones/ardupilot/commit/5724692aafbcaf21fbf565c3f48b50f862ff5dcd

brnjones avatar Jan 18 '13 21:01 brnjones

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.

rmackay9 avatar Mar 31 '14 01:03 rmackay9