Help wih APM mission library (possibly offering a bounty)

Hi all,

I don’t really know if the moderators will allow this or not, but basically I’m giving a demo with my APM rover and I need some assistance with the mission library on the PM rover FW.

Basically what I m trying to do is set a command that the rover will reach, and then start the mission from the first waypoint all over again. In other words, this command would allow me to simply let the rover continually loop, over and over again until it’s stopped.

in commands_logic.pde, I noticed that MAV_CMD_DO_JUMP was not defined. I figured that this would be a good command to define to perform the reset function, rather then going through the hassle of trying to define an entirely new command.

just after

[code] // exit immediately if not in AUTO mode
if (control_mode != AUTO) {
return false;

gcs_send_text_fmt(PSTR("Executing command ID #%i"),;

// remember the course of our next navigation leg
next_navigation_leg_cd = mission.get_next_ground_course_cd(0);


I inserted:

case MAV_CMD_DO_JUMP: mission.reset(); break;

I was hoping this would reset the mission back to he first waypoint, but unfortunately, there is some very weird behavior instead. Upon reaching this waypoint, the rover just begins driving off in a random, but consistent direction. Even after resending a new flight plan to the rover, it still tries to go to this location when set in auto mode, until the Pixhawk is power cycled.

If someone would be willing to help with this asap, I might be willing to offer a small bounty, such as $35.

I have a build environment on my machine, so all I need is either a phone call or a copy paste snipppit to insert.

Thanks! Mods, if this goes against any rules please let me know.

This functionality is already in there - I do it as standard all the time. You need to add a loop waypoint. I assume your using Mission Planner. Draw out your mission as per normal. Then right click mission planner in the misssion editor tab and select Jump|Start and select the number of times to loop. Once done you will see it adds another way point after all the others which tells the vehicle to go back to the start of the mission.

Thanks, Grant.