I'm using an Intel Aero RTF drone with PX4 and I want to test a simple take off of this drone but the script I followed didn't give me results it just arms the dron and disarms but never takes off This is the script:
#! /usr/bin/python
from dronekit import connect, VehicleMode, LocationGlobalRelative
import time
vehicle = connect('tcp:127.0.0.1:5760', wait_ready=False)
def arm_and_takeoff(aTarget):
### I commented this lines because the code doesn't pass from
this loop ###
#print 'Pre arm-checks'
#while not vehicle.is_armable:
# print "Initializing...'
# time.sleep(1)
print 'Arming motors'
vehicle.mode = VehicleMode("GUIDED")
vehicle.armed = True
while not vehicle.armed:
print "waiting for arming"
time.sleep(1)
print "Take Off!"
vehicle.simpe_takeoff(aTarget)
while True:
print "Altitude: ",vehicle.location.global_relative_frame.alt
if vehicle.location.global_relative_frame.alt >= aTarget * 0.95:
print "Altitude target reached"
break
time.sleep(1)
arm_and_takeoff(10)
print "Take off complete!"
time.sleep(10)
print "Landing"
vehicle.mode = VehicleMode("LAND")
As I said it just arms for a few seconds and the disarms, what am I doing wrong?? Regards