However, MAVProxy is written & executed in python and can accomplish a whole lot more... Also, if I understand correctly, during execution of an established flight plan, Mission Planner automates sending the next command to the UAV based on the telemetry received... (i.e., Mission Planner sends the next command in the established flight plan after the telemetry received indicates the UAV has completed the current command, e.g., it doesn't tell the UAV to go to waypoint 2 until it has reached waypoint 1).

So, my question is:

Is there a way to script a flight plan in Python that executes commands based on TIME instead of telemetry???

[i.e., What are the python scripting commands/functions to command the UAV "go to waypoint 1, sleep(30), go to waypoint 2, sleep(30), LOITER, sleep(30), go to waypoint 4, toggle servo 8, RTL" without caring if the UAV actually ever made it to the waypoint before following the next command]

(based on the comment from Mission Planner's creator here, I would think this is possible, but I need a list of all possible commands to send with the corresponding Python syntax.)

Note: this is a TIME-based script... it will guide the UAV to the next waypoint after waiting a specified amount of time. One would have to replace the "time.sleep(10)" lines with "Script.WaitFor('ARMING MOTORS',30000)" [and replace 'ARMING MOTORS' with whatever notification Mission Planner usually provides upon arriving to a waypoint] to replicate the mission plan creation (i.e., go to next waypoint after arriving at previous waypoint).

Here the answer to my own question : Yes it' easy to send waypoint or to control a servo with python script running through APM. Indeed for the servo you must use channel 5 or 6 as if it was to control a gimbal. Here an example of code to drop a load on a gps defined target based on Joe M example, I've not tested this code in flight yet, only on the ground:

After a few weeks working on an other project, I'm back to this project. But I've a problem, I can't run any python script anymore. As I try to run on of my script, which was working a few weeks ago, apm just freeze. Have you ever heard a problem like that ? I see only one modification between now and late january : I've updated apm.

Today I tested it and got the positive result. I mounted APM2.5 on a quad-copter and I connected it with Mission Planner via telemetry link. Before flying I developed codes for Arming motors, throttle raise, stabilizing, roll, pitch, yaw, land and disarm. I successfully run all those developed scripts of python and I completed preliminary tests. My next target is to test it for RTL, loiter, Guided modes.

Does anyone know if it is possible to upload a whole mission through python (multiple waypoints). I was trying to use the code bellow to add multiple waypoints and do a AUTO mission. However it does not work.

Sir, can you share the scripts for throttle raise, stabilizing, roll, pitch, yaw, land and disarm?

you can contact me on my email id

rijunk1995@gmail.com

i'm doing my project on pixhawk and i need help to land my arduplane automatically.

VENKAT RAVI KISHORE said:

Today I tested it and got the positive result. I mounted APM2.5 on a quad-copter and I connected it with Mission Planner via telemetry link. Before flying I developed codes for Arming motors, throttle raise, stabilizing, roll, pitch, yaw, land and disarm. I successfully run all those developed scripts of python and I completed preliminary tests. My next target is to test it for RTL, loiter, Guided modes.