1

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

4

1 回答 1

1

Dronekit 不正式支持 PX4 飞行堆栈,您应该为 PX4 编写 Dronecode SDK ( https://sdk.dronecode.org/en/ ) 或将您的飞行堆栈更改为 ArduPilot,但您也可以阅读对 PX4 的有限支持关于它在这里https://dev.px4.io/en/robotics/dronekit.html

于 2018-08-13T10:01:43.167 回答