I have only seen time-based WP missions, or just individual WP commands using the python scripting. I would would like to send a whole mission using a python script.
Just to quickly explain what I am trying to do: I am using a program to identify points of interest using a downward facing camera feed, from which I can create a waypoint mission file (in the right formatting and protocol). I am using Matlab to do some image processing, and I am using the TCP mavlink feed (ctrl-f in Mission Planner and using mavlink) to get the real time GPS information to attach the position to the image. Then I can pick out points on the image and give an estimate of the Lon and Lat. I create a WP file with these points at a predefined altitude. Then, with the press of a button, I would like my copter to follow those waypoints.
What I would like to do is run a python script (within Matlab) to upload and run that mission. I wanted to take advantage of the existing WP scripting of the autopilot. In other words, I am trying to avoid adapting the time-based method (that JoeM made) to use telemetry info and essentially do the same thing that the autopilot has already been programmed to do. I thought that this method would be easier, but I have not found a way to run a 'load WP file' command.
So the two main things that I am stuck on are:
- Can I run a python script from outside of the Mission Planner application? (I haven't found an answer to this question online, so I am making a simple motor test script to see if I can run it from Matlab)
- How can I upload and run a full waypoint mission file with the python scripting?