Servers by jDrones

Writeing a python script for arduplane take off


(Brian Duvall) #1

I have been looking at Peter barkers code found in this link:

Peter, So I am wondering if I am thinking about this right. It looks like you are creating a list of commands and saving them in the cmds variable. You then upload them via “cmds.upload()”. By doing this when you put the plane in AUTO mode it should take off, fly to a way point, then loiter. Is this right?

I am kinda stuck on getting the plane to actually take off or move for that matter. I am using the sim_vehicle.py. I attached the code I pulled from your page.
Takeing_off_Plane.zip


(peterbarker) #2

Peter, So I am wondering if I am thinking about this right. It looks like you are creating a list of commands and saving them in the cmds variable. You
then upload them via “cmds.upload()”. By doing this when you put the plane in AUTO mode it should take off, fly to a way point, then loiter. Is this
right?

That’s correct.

I am kinda stuck on getting the plane to actually take off or move for that matter. I am using the sim_vehicle.py. I attached the code I pulled from your
page.

sim_vehicle.py is an interactive program which bolts an ArduPilot
simulation together with MAVProxy - it’s not usually assocated with
scripting, 'though it shares a lot of infrastructure with dronekit-python,
and even more with the autotest suite.

What are you trying to accomplish?


(Brian Duvall) #3

My goal is to have plane fly in the sitl to a couple of waypoints like the simple go to example


(Brian Duvall) #4

I have been working on the code some more. I have managed to get the waypoints uploaded to the SITL and show up on Qgroundcontrol. Plane still sits there. I am confused on how to get the plane moving. I see for plane we just need to put it in auto and let it fly. I have included my most recent code.

Any help would be much appreciated

Plane_mission_basic.zip (3.1 KB)


(Brian Duvall) #5

Well this is intersting, I got it to take off out of shear luck!
I added this link in ADDITION to it already being there

cmds.add(Command( 0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 0, 0, 0, 0, aLocation.lat, aLocation.lon, 10))

So I have this in my code twice.


(Joshua Wojnas) #6

So I have the Rascal taking off the first waypoint i make takeoff in the mission editor click the next cell then write wp. mode auto wait arm throttle. Is this for something other than the rascal?


(Brian Duvall) #7

Sound like you are using the GCS to set up commands am I right??? I am useing a python script script to write commands and make the vehicle go into auto mode. Both methods can be used to do the same thing ie fly the rascal.


(Joshua Wojnas) #8

Hello Brian, Yes I am using a GCS ardupilot SITL on linux install so mavproxy. It is a pip package.
The new instructions helped and adding the scripts from VM making in windows.
I just used aeromatic++ that came with the newest github jsbsim.
It made a aircraft by inputs I wonder if one someone makes whale holding down the enter would fly like the Rascal?

It did not it threw errors.

It would be neat I want to see simulations from OpenVSP to aeromatic++ to flying in Arduplane as a quadplane. .


(Joshua Wojnas) #9

This tutorial has a airborn script for JSBSim I would not know how to get it into ardupilot.

http://www.holycows.net/JSBSim_Script_Tutorial.pdf