Maximum Waypoints for Mission Planner

I also use 3000 plus waypoint missions, and 650 is an absolute pain

Remind me on a night that isn’t New Year’s Eve and I’m not a bottle or two deep, and I’ll work up an example Lua script for this case.

I wrote a Lua script today that overcomes the 700 waypoint limitation. Here are the steps to use it:

  • Download the script and place it in the APM/scripts directory of your SD card.
    image
  • Map a channel on your RC transmitter to a 2 or 3 position switch.
  • Set SCR_ENABLE=1
  • Set RCx_OPTION=300 (where “x” is the channel you mapped to the switch)
  • Save your waypoint mission as LongMission.waypoints (case-sensitive).
  • Place that waypoint file in the root directory of your autopilot’s SD card.
  • Reboot the autopilot

If the RC switch is in the “low” position, the script will remain in “idle” mode, and you are free to upload missions and operate as usual.

If the RC switch is in the “high” position, the script will clear any existing waypoints and load 700 waypoints from the file. When waypoint 700 is reached in AUTO mode, it will briefly place the vehicle in HOLD mode, load another 700, and continue that way until either the end of the mission or the switch is toggled back to “low.”

To abort the script while the long mission is being executed, toggle the RC switch to the “low” position. It will place the vehicle in HOLD mode, clear all waypoints, reset the file position to the beginning, and enter “idle” mode again.

So long as the RC switch remains “high,” the script will remember its place in the long waypoint file, so you are free to change modes, pause, repeat waypoints (within the 700 that are loaded), etc.

You can even overwrite the mission file on the SD card without rebooting if you want to run another super long mission during the same session. Just don’t do that while the script is actively executing the file!

For the moment, the script is Rover-specific (primarily due to the use of HOLD mode). I’m sure it can be easily adapted for aerial survey if that need arises.

Please let me know if you find any bugs or issues - I’d appreciate any feedback!

LongMission.lua

7 Likes

Thanks, Yuri. This will be very useful!

1 Like

That is awesome Yuri!
Can I run two scripts at the same time?

1 Like

You can run several simultaneously - just drop them all in the APM/scripts directory. You may have to increase the value of SCR_HEAP_SIZE if memory errors are reported at boot time.

I have only tested this script in SITL, so I urge an air of caution the first time you use it. Pay particular attention as the script loads and begins each 700-point segment.