Dronekit 搭配使用Ardupilot 和 PX4

2023-05-16

 

 

Dronekit是一个与无人机飞控搭配使用,方便开发者使用代码控制无人机。个人认为它会比搭建ros来控制无人机更容易上手一些。

对于Dronekit,PX4被支持的较少,不可以进行模式切换,而对Ardupilot支持的比较多,可调用的函数也比较多。

PX4 官网的官方文档dronekit部分 https://dev.px4.io/en/robotics/dronekit.html

对于Ardupilot与无人机搭配使用,有一篇还不错的博客,本篇有些内容摘于此篇https://blog.csdn.net/liberatetheus/article/details/78004917

 

一、dronekit的安装

 

安装所需依赖

sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev
git clone https://github.com/dronekit/dronekit-python.git
cd ./dronekit-python
sudo python setup.py build
sudo python setup.py install

 

二、连接于获取数据

目前没有实际设备,所以还是在仿真下做

我们可以建立一个连接:

对于PX4 系统仿真提供的接口是:

127.0.0.1:14540

对于Ardupilot 系统仿真提供的接口是

127.0.0.1:14551

一小段代码可以测试一下连接,以及获取飞控板的数据(以PX4为例)

# Import DroneKit-Python
from dronekit import connect, Command, LocationGlobal
from pymavlink import mavutil
import time, sys, argparse, math

# Connect to the Vehicle
print "Connecting"
connection_string = '127.0.0.1:14540'
vehicle = connect(connection_string, wait_ready=True)

# Display basic vehicle state
print " Type: %s" % vehicle._vehicle_type
print " Armed: %s" % vehicle.armed
print " System status: %s" % vehicle.system_status.state
print " GPS: %s" % vehicle.gps_0
print " Alt: %s" % vehicle.location.global_relative_frame.alt

 

  首先,启动模拟器,可以是gozebo ,也可以是jmavsim 

 之后,我们执行python代码使用命令  例如 python  test.py

python 你要执行的文件名.python

 

执行后我们可以收到飞控的数据

 

三、执行飞行任务

  3.1 px4

对于PX4 它不支持模式转换,但是官网还是给出了使PX4执行飞行任务的方法,代码如下:

################################################################################################
# @File DroneKitPX4.py
# Example usage of DroneKit with PX4
#
# @author Sander Smeets <sander@droneslab.com>
#
# Code partly based on DroneKit (c) Copyright 2015-2016, 3D Robotics.
################################################################################################

# Import DroneKit-Python
from dronekit import connect, Command, LocationGlobal
from pymavlink import mavutil
import time, sys, argparse, math


################################################################################################
# Settings
################################################################################################

connection_string       = '127.0.0.1:14540'
MAV_MODE_AUTO   = 4
# https://github.com/PX4/Firmware/blob/master/Tools/mavlink_px4.py


# Parse connection argument
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--connect", help="connection string")
args = parser.parse_args()

if args.connect:
    connection_string = args.connect


################################################################################################
# Init
################################################################################################

# Connect to the Vehicle
print "Connecting"
vehicle = connect(connection_string, wait_ready=True)

def PX4setMode(mavMode):
    vehicle._master.mav.command_long_send(vehicle._master.target_system, vehicle._master.target_component,
                                               mavutil.mavlink.MAV_CMD_DO_SET_MODE, 0,
                                               mavMode,
                                               0, 0, 0, 0, 0, 0)



def get_location_offset_meters(original_location, dNorth, dEast, alt):
    """
    Returns a LocationGlobal object containing the latitude/longitude `dNorth` and `dEast` metres from the
    specified `original_location`. The returned Location adds the entered `alt` value to the altitude of the `original_location`.
    The function is useful when you want to move the vehicle around specifying locations relative to
    the current vehicle position.
    The algorithm is relatively accurate over small distances (10m within 1km) except close to the poles.
    For more information see:
    http://gis.stackexchange.com/questions/2951/algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters
    """
    earth_radius=6378137.0 #Radius of "spherical" earth
    #Coordinate offsets in radians
    dLat = dNorth/earth_radius
    dLon = dEast/(earth_radius*math.cos(math.pi*original_location.lat/180))

    #New position in decimal degrees
    newlat = original_location.lat + (dLat * 180/math.pi)
    newlon = original_location.lon + (dLon * 180/math.pi)
    return LocationGlobal(newlat, newlon,original_location.alt+alt)





################################################################################################
# Listeners
################################################################################################

home_position_set = False

#Create a message listener for home position fix
@vehicle.on_message('HOME_POSITION')
def listener(self, name, home_position):
    global home_position_set
    home_position_set = True



################################################################################################
# Start mission example
################################################################################################

# wait for a home position lock
while not home_position_set:
    print "Waiting for home position..."
    time.sleep(1)

# Display basic vehicle state
print " Type: %s" % vehicle._vehicle_type
print " Armed: %s" % vehicle.armed
print " System status: %s" % vehicle.system_status.state
print " GPS: %s" % vehicle.gps_0
print " Alt: %s" % vehicle.location.global_relative_frame.alt

# Change to AUTO mode
PX4setMode(MAV_MODE_AUTO)
time.sleep(1)

# Load commands
cmds = vehicle.commands
cmds.clear()

home = vehicle.location.global_relative_frame

# takeoff to 10 meters
wp = get_location_offset_meters(home, 0, 0, 10);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# move 10 meters north
wp = get_location_offset_meters(wp, 10, 0, 0);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# move 10 meters east
wp = get_location_offset_meters(wp, 0, 10, 0);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# move 10 meters south
wp = get_location_offset_meters(wp, -10, 0, 0);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# move 10 meters west
wp = get_location_offset_meters(wp, 0, -10, 0);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# land
wp = get_location_offset_meters(home, 0, 0, 10);
cmd = Command(0,0,0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_LAND, 0, 1, 0, 0, 0, 0, wp.lat, wp.lon, wp.alt)
cmds.add(cmd)

# Upload mission
cmds.upload()
time.sleep(2)

# Arm vehicle
vehicle.armed = True

# monitor mission execution
nextwaypoint = vehicle.commands.next
while nextwaypoint < len(vehicle.commands):
    if vehicle.commands.next > nextwaypoint:
        display_seq = vehicle.commands.next+1
        print "Moving to waypoint %s" % display_seq
        nextwaypoint = vehicle.commands.next
    time.sleep(1)

# wait for the vehicle to land
while vehicle.commands.next > 0:
    time.sleep(1)


# Disarm vehicle
vehicle.armed = False
time.sleep(1)

# Close vehicle object before exiting script
vehicle.close()
time.sleep(1)

 

进入px4目录

执行启动模拟器(这里我使用gazebo)

 

make posix gazebo_typhoon_h480

 

新建一个终端,进入python代码目录,执行py文件

python px4test.py

效果如下图

3.2 Ardupilot

对于Ardupilot 我们有很多现有的API可以调用

示例代码如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
© Copyright 2015-2016, 3D Robotics.
simple_goto.py: GUIDED mode "simple goto" example (Copter Only)
Demonstrates how to arm and takeoff in Copter and how to navigate to points using Vehicle.simple_goto.
"""

from __future__ import print_function
import time
from dronekit import connect, VehicleMode, LocationGlobalRelative


# 通过本地的14551端口,使用UDP连接到SITL模拟器
connection_string = '127.0.0.1:14551'
print('Connecting to vehicle on: %s' % connection_string)
# connect函数将会返回一个Vehicle类型的对象,即此处的vehicle
# 即可认为是无人机的主体,通过vehicle对象,我们可以直接控制无人机
vehicle = connect(connection_string, wait_ready=True)

# 定义arm_and_takeoff函数,使无人机解锁并起飞到目标高度
# 参数aTargetAltitude即为目标高度,单位为米
def arm_and_takeoff(aTargetAltitude):
    # 进行起飞前检查
    print("Basic pre-arm checks")
    # vehicle.is_armable会检查飞控是否启动完成、有无GPS fix、卡曼滤波器
    # 是否初始化完毕。若以上检查通过,则会返回True
    while not vehicle.is_armable:
        print(" Waiting for vehicle to initialise...")
        time.sleep(1)

    # 解锁无人机(电机将开始旋转)
    print("Arming motors")
    # 将无人机的飞行模式切换成"GUIDED"(一般建议在GUIDED模式下控制无人机)
    vehicle.mode = VehicleMode("GUIDED")
    # 通过设置vehicle.armed状态变量为True,解锁无人机
    vehicle.armed = True

    # 在无人机起飞之前,确认电机已经解锁
    while not vehicle.armed:
        print(" Waiting for arming...")
        time.sleep(1)

    # 发送起飞指令
    print("Taking off!")
    # simple_takeoff将发送指令,使无人机起飞并上升到目标高度
    vehicle.simple_takeoff(aTargetAltitude)

    # 在无人机上升到目标高度之前,阻塞程序
    while True:
        print(" Altitude: ", vehicle.location.global_relative_frame.alt)
        # 当高度上升到目标高度的0.95倍时,即认为达到了目标高度,退出循环
        # vehicle.location.global_relative_frame.alt为相对于home点的高度
        if vehicle.location.global_relative_frame.alt >= aTargetAltitude * 0.95:
            print("Reached target altitude")
            break
        # 等待1s
        time.sleep(1)

# 调用上面声明的arm_and_takeoff函数,目标高度10m
arm_and_takeoff(10)

# 设置在运动时,默认的空速为3m/s
print("Set default/target airspeed to 3")
# vehicle.airspeed变量可读可写,且读、写时的含义不同。
# 读取时,为无人机的当前空速;写入时,设定无人机在执行航点任务时的默认速度
vehicle.airspeed = 3

# 发送指令,让无人机前往第一个航点
print("Going towards first point for 30 seconds ...")
# LocationGlobalRelative是一个类,它由经纬度(WGS84)和相对于home点的高度组成
# 这条语句将创建一个位于南纬35.361354,东经149.165218,相对home点高20m的位置
point1 = LocationGlobalRelative(-35.361354, 149.165218, 20)
# simple_goto函数将位置发送给无人机,生成一个目标航点
vehicle.simple_goto(point1)

# simple_goto函数只发送指令,不判断有没有到达目标航点
# 它可以被其他后续指令打断,此处延时30s,即让无人机朝向point1飞行30s
time.sleep(30)

# 发送指令,让无人机前往第二个航点
print("Going towards second point for 30 seconds (groundspeed set to 10 m/s) ...")
# 与之前类似,这条语句创建了另一个相对home高20m的点
point2 = LocationGlobalRelative(-35.363244, 149.168801, 20)
# simple_goto将目标航点发送给无人机,groundspeed=10设置飞行时的地速为10m/s
vehicle.simple_goto(point2, groundspeed=10)

# 与之前一样,延时30s
time.sleep(30)

# 发送"返航"指令
print("Returning to Launch")
# 返航,只需将无人机的飞行模式切换成"RTL(Return to Launch)"
# 无人机会自动返回home点的正上方,之后自动降落
vehicle.mode = VehicleMode("RTL")

# 退出之前,清除vehicle对象
print("Close vehicle object")
vehicle.close()

摘自 https://blog.csdn.net/liberatetheus/article/details/78004917 

执行代码时建议把中文注释删除。  

 

打开一个终端,进入Ardupilot工作目录, 执行命令启动模拟器

sim_vehicle.py -j4 --map --console

打开另一个终端,找到编写的代码的目录

执行py文件

python simple_go.py

效果如下

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Dronekit 搭配使用Ardupilot 和 PX4 的相关文章

  • PX4源代码下载编译

    sudo git clone https github com PX4 PX4 Autopilot git recursivegit submodule update init recursivegit submodule update r
  • ardupilot之添加mavlink消息

    本文是这篇文章的复现 xff1a http www sohu com a 213599378 175233 一 mavlink分析 Mavlink 的全称是Micro Air Vehicle link xff0c pixhawk把它作为与地
  • 无人机仿真—PX4编译,gazebo仿真及简单off board控制模式下无人机起飞

    无人机仿真 PX4编译 xff0c gazebo仿真及简单off board控制模式下无人机起飞 前言 在上篇记录中 xff0c 已经对整体的PX4仿真环境有了一定的了解 xff0c 现如今就要开始对无人机进行起飞等仿真环境工作 xff0c
  • PX4 -- EKF2

    文章目录 EKF2参数高度估计Range Finder滤波 单变量更新单变量更新对多变量的影响 EKF2 参数 EKF2 中有一类 GATE 参数 当测量值在 VAR GATE 范围内才会更新值 高度估计 四种高度控制方法 xff1a 气压
  • 使用从源码编译的SITL测试dronekit代码

    使用从源码编译的SITL测试DroneKit代码 本作品采用知识共享署名 相同方式共享 3 0 未本地化版本许可协议进行许可 DroneKit和SITL简述 DroneKit是一款Python语言的无人机开发库 xff0c 可以对使用MAV
  • PX4模块设计之三:自定义uORB消息

    PX4模块设计之三 xff1a 自定义uORB消息 1 新增自定义uORB消息步骤2 应用ext hello world消息示例3 编译执行结果4 参考资料 基于PX4开源软件框架简明简介和PX4模块设计之二 xff1a uORB消息代理
  • PX4模块设计之二十一:uORB消息管理模块

    PX4模块设计之二十一 xff1a uORB消息管理模块 1 uORB模块构建模式2 uORB消息管理函数2 1 状态查询2 2 资源利用2 3 模块启动2 4 模块停止3 uORB消息接口3 1 消息主题注册3 2 消息主题去注册3 3
  • PX4模块设计之二十六:BatteryStatus模块

    PX4模块设计之二十六 xff1a BatteryStatus模块 1 BatteryStatus模块简介2 模块入口函数2 1 主入口battery status main2 2 自定义子命令custom command 3 Batter
  • PX4模块设计之四十三:icm20689模块

    PX4模块设计之四十三 xff1a icm20689模块 1 icm20689模块简介2 模块入口函数2 1 主入口icm20689 main2 2 自定义子命令custom command2 3 模块状态print status 重载 3
  • mavros连接px4失败的usb-ttl原因

    问题描述 xff1a 最近在搞mavros xff0c 以方便协处理器和pixhawk通讯 xff0c 在按照官网教程安装mavros xff0c 设置px4 xff0c 连接硬件之后发现mavros卡在中间下不去 xff1a MAVROS
  • SITL Simulator —— ArduPilot —— Windows

    版权声明 xff1a 本文为博主原创博文 xff0c 未经允许不得转载 xff0c 若要转载 xff0c 请说明出处并给出博文链接 参考网页 xff1a http ardupilot org dev docs sitl native on
  • px4_simple_example和uorb机制

    px4 simple app PX4 Autopilot src exampes px4 simple app xff0c 这个程序是用c语言调用orb API和poll机制订阅和发布通讯数据 xff0c 但是这个例子并不是既有接收又有发送
  • Px4源码框架结构图

    此篇blog的目的是对px4工程有一个整体认识 xff0c 对各个信号的流向有个了解 xff0c 以及控制算法采用的控制框架 PX4自动驾驶仪软件 可分为三大部分 xff1a 实时操作系统 中间件和飞行控制栈 1 NuttX实时操作系统 提
  • 解决多个Ardupilot运行仿真环境冲突问题

    情况说明 分别安装了4 2和4 3两个版本的ardupilot工作环境 xff0c 出现运行4 3版本sim vehicle py时路径链接到4 2版本工作路径 解决 为防止文件识别错误 xff0c 更改sim vehicle py文件名为
  • px4无人机常识介绍(固件,px4等)

    专业名词解释 aircraft 任何可以飞或者可以携带物品还是搭载旅客的飞行器统称为飞机 航空器 uav 无人驾驶飞机 vehicle 飞行器 airplane plane aero plane 有机翼和一个或多个引擎的飞行器统称为飞机 D
  • PX4 OffBoard Control

    终于还是走上了这一步 xff0c 对飞控下手 xff0c 可以说是一张白纸了 记录一下学习的过程方便以后的查阅 目录 一 ubuntu18 04配置px4编译环境及mavros环境 二 PX4的OffBoard控制 1 搭建功能包 2 编写
  • 步骤八:PX4使用cartographer与move_base进行自主建图导航

    首先老样子硬件如下 飞控 HOLYBRO PIXHAWK V4 PX4 机载电脑 jetson nano b01 激光雷达 思岚a2 前提 你已经完成了cartographer建图部分 能够正常输出map话题 前言 由于要参加中国机器人大赛
  • PX4项目学习::(七)飞控栈:commander

    PX4的飞行控制程序通过模块来实现 xff0c 与飞控相关的模块主要有commander xff0c navigator xff0c pos control xff0c att control这几个 xff0c 分别可以在src modul
  • 从容器连接到主机服务的示例

    我是 Docker 和无人机编程的新手 我能够将 python 脚本 包含 Dronekit 代码 部署到 Windows 10 上的 docker 容器 要运行该脚本 我需要连接到主机上的服务 我在下面提供了一个片段 Windows 有一
  • DroneKit:无法连接到 /dev/tty.usbmodem1411:“串行”对象没有属性“setBaudrate”

    按照 DroneKit 说明 我能够运行其快速入门指南中的 hello py 代码 http python dronekit io guide quick start html http python dronekit io guide q

随机推荐

  • 微软笔试题 回忆(回文方面)

    这道题当年我没有做出来 xff0c 今天微软笔试又碰到了类似的题目 狠心要将这一块吃透 主要还是对动态规划掌握的不够熟练 去年的题目 xff1a 最少射击几次 N个瓶子都有编号 xff0c 每次能射击1个或多个瓶子 xff0c 如果是回文的
  • CLICK模块路由器:代码中加入多线程函数 (报错解决:undefined reference “pthread_mutex_lock”)

    最近想在CLICK中编写读写锁的相关应用 xff0c 所以用到了 lt pthread h gt 下的函数 pthread mutex lock 等 但是当我 make Install 编译时 发生了报错 undefined referen
  • Leetcode 212. Word Search II (tries树 + DFS)

    题目 xff1a Given a 2D board and a list of words from the dictionary find all words in the board Each word must be construc
  • LINUX 安装 AODV协议

    介绍 xff1a AODV协议是无线自组网中主动路由协议的一种 xff0c 也是非常经典的一个协议 xff0c 但是 xff0c 在linux实际环境中却很难找到协议的实现 xff08 十几年前有一个 aodv uu 现在的内核已经不能用了
  • Leetcode 210. Course Schedule II (利用拓扑排序)

    一 题目 There are a total of n courses you have to take labeled from 0 to n 1 Some courses may have prerequisites for examp
  • 2018年,Java程序员转型大数据开发,是不是一个好选择?

    近日网上有一篇关于Java程序员职场生存现状的文章 2017年 Java 程序员 xff0c 风光背后的危机 xff0c 在Java程序员圈子里引起了广泛关注和热议 2017年 xff0c Java 程序员面临更加激烈的竞争 不得不承认 x
  • Leetcode 105 106 重构二叉树

    Leetcode上105 xff0c 106题很相似 xff0c 都是重构二叉树的题 题目 xff1a 105 Given preorder and inorder traversal of a tree construct the bin
  • LeetCode 查并集系列 朋友圈 冗余链接等

    网上有作者已经总结的很好 xff0c 这里转载一下 xff1a https www jianshu com p b81f6db6beaf 什么是并查集 一种数据结构 xff0c 用来描述集合 查 xff08 find xff09 xff1a
  • 记 7.24 阿里巴巴机试题

    题一 题目 xff1a 吃烧饼大赛 有n个盘子 xff0c 每个盘子内有s i 个烧饼 每次选取一个 x xff08 1 x n xff09 xff0c 可以吃到1 xff5e x 号盘子里的一个烧饼 若这1 xff5e x个盘子中有空盘时
  • C++ 智能指针学习

    网上找了一篇很棒的文章 转载自 xff1a https www jianshu com p bf8de014e5c2 C Java python和go等语言中都有垃圾自动回收机制 xff0c 在对象失去引用的时候自动回收 xff0c 而且基
  • 记面试遇到的一个智力题:追击问题

    一个带环的单链表 xff0c 一个快指针 xff08 每次走三步 xff09 xff0c 一个慢指针 xff08 每次走一步 xff09 xff0c 请问这两个指针可能无法相遇吗 xff1f 解 xff1a 假设慢指针入环时 xff0c 快
  • 面试经典题 手撸LRU

    1 C与C 43 43 混搭写法 struct LRUCacheNode int key int value LRUCacheNode prev LRUCacheNode next LRUCacheNode key 0 value 0 pr
  • 腾讯8.23号笔试 刷木板题 DP

    作者 xff1a 夜 xffe3 太美 链接 xff1a https www nowcoder com discuss 486642 type 61 2 来源 xff1a 牛客网 题意 有n xff08 n在5000内 xff09 块木板
  • 京东2018笔试题 神奇数

    题目 东东在一本古籍上看到有一种神奇数 如果能够将一个数的数字分成两组 其中一组数字的和等于另一组数字的和 我们就将这个数称为神奇数 例如242就是一个神奇数 我们能够将这个数的数字分成两组 分别是 2 2 以及 4 而且这两组数的和都是4
  • 绑定mac地址与网卡驱动wlan

    按照之前博客https blog csdn net Lin QC article details 90717218的配置 xff0c 我们可以在树莓派上实现双网卡 xff0c 但是再多次试验中发现 xff0c 每次重启后 xff0c 网卡的
  • 在树莓派上ROS MAVROS的安装使用

    首先 xff0c 我购买的是树莓派3B 43 xff0c 比较新款 xff0c 所以装不了太老的树莓派系统 xff0c 安装的是树莓派官方提供的Raspbian Stretch系统 树莓派系统安装过程较为简单 xff0c 且官网教程详细 x
  • APP引导页UI设计素材模板|轻松留下完美的第一印象

    App首次引导页是当你第一次打开一款应用的时候你看到的引导页 xff0c 它们在你未使用产品之前提前告知产品的主要功能与特点 先来看看 像素精简版引导UI工具包 好的实际案例 xff0c 让初学者更友好 xff01 美丽的用户界面 xff0
  • px4 offboard外部控制仿真

    官网中http dev px4 io en ros mavros offboard html xff0c 只给示例代码 xff0c 却不告诉怎么用 xff0c 实在有点坑 xff0c 还好参照网上的一些博客 xff0c 找到了使用方法 首先
  • POST和GET方法的区别与联系

    错误的一个理论就是 xff0c get是从服务器拿数据 xff0c 而post是给服务器传数据 两者其实都是从服务器端拿数据 xff0c 只是一些细节不同罢了 历史 get和post是HTTP与服务器交互的方式 xff0c 说到方式 xff
  • Dronekit 搭配使用Ardupilot 和 PX4

    Dronekit是一个与无人机飞控搭配使用 xff0c 方便开发者使用代码控制无人机 个人认为它会比搭建ros来控制无人机更容易上手一些 对于Dronekit xff0c PX4被支持的较少 xff0c 不可以进行模式切换 xff0c 而对