Based on what I've discovered so far in my search for an answer (most pertinently here & here), it appears the only commands that can be scripted in python for Mission Planner to execute are:
- Script.ChangeParam(name, value)
- Script.GetParam(name)
- Script.ChangeMode(name) # i.e., mode = RTL
- Script.WaitFor(string, timeout) # unsure what this command does
- Script.RC(channel, PWM, sendnow) # automates emulated RC transmissions?
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.)
Replies
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:
I have made progress on my project learning from your script. Thanks.
My challenge now is to over fly the waypoint without going into loiter or to begin loiter on the far side of the loiter radius allowing at least an initial overflight of the waypoint.
Any ideas.
Nevermind... thanks to JakobSt, I developed a working time-based script.
Here's the script that worked for me in using ArduPlane (which should work for ArduCopter too):
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).