首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用dronekit和PX4起飞

使用dronekit和PX4起飞
EN

Stack Overflow用户
提问于 2018-06-16 12:43:16
回答 1查看 792关注 0票数 1

我正在使用英特尔航空RTF无人机和PX4,我想测试这架无人机的简单起飞,但我遵循的脚本没有给我结果,它只是武装无人机和解除武装,但从来没有起飞这是脚本:

代码语言:javascript
复制
#! /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") 

正如我所说的,它只是武装了几秒钟和解除武装,我做错了什么??问候

EN

回答 1

Stack Overflow用户

发布于 2018-08-13 18:01:43

Dronekit并不正式支持PX4飞行堆栈,你应该使用Dronecode SDK for PX4 (https://sdk.dronecode.org/en/)或者将你的飞行堆栈改为ArduPilot,但是对PX4的支持也是有限的,你可以在这里https://dev.px4.io/en/robotics/dronekit.html上了解到。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50885030

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档