Dronekit——Introduction

Dronekit——Introduction

参考:http://python.dronekit.io/about/overview.html

关于Dronekit

DroneKit-Python允许开发人员创建在板载协同计算机上运行的应用程序,并使用低延迟链接与ArduPilot飞行控制器通信。板载应用程序可以显着增强自动驾驶,为vehicles行为增加更多智能,以及执行计算密集或时间敏感的任务(例如,计算机视觉,路径规划或3D建模)。DroneKit-Python还可用于地面站点应用程序,通过更高延迟的RF链路与vehicles进行通信。

API通过MAVLink与vehicles通信。它提供对连接vehicles遥测,状态和参数信息的编程访问,并实现任务管理和对vehicles运动和操作的直接控制。

API 功能

API features

The API provides classes and methods to:

  • Connect to a vehicle (or multiple vehicles) from a script
  • Get and set vehicle state/telemetry and parameter information.
  • Receive asynchronous notification of state changes.
  • Guide a UAV to specified position (GUIDED mode).
  • Send arbitrary custom messages to control UAV movement and other hardware (GUIDED mode).
  • Create and manage waypoint missions (AUTO mode).
  • Override RC channel settings

Migrating to DKPY 2.0

移植到DKPY2.0

DroneKit-Python 2.0 has undergone a significant architectural evolution when compared to version 1.x (the library changed from a MAVProxy extension to a standalone Python module). The API itself remains similar, with the most important difference being that you now need to specify the vehicle target address inside the script.

与版本1.x相比,DroneKit-Python 2.0经历了重大的架构演变(该库从MAVProxy扩展更改为独立的Python模块)。API本身仍然类似,最重要的区别是您现在需要在脚本中指定vehicles目标地址。

Launching scripts

启动脚本

some_python_script.py

或者

python some_python_script.py

Connecting to a vehicle

You must specify the target vehicle address in your script 

你必须在脚本中明确指出目标vehicle的地址

下面的代码片段显示了如何导入connect()方法并使用它返回连接Vehicle对象。

from dronekit import connect

# Connect to the Vehicle (in this case a UDP endpoint)
vehicle = connect('127.0.0.1:14550', wait_ready=True)

Note

The wait_ready=True parameter ensures that connect() won’t return untilVehicle.parameters and most other default attributes have been populated with values from the vehicle. Check out Vehicle.wait_ready() for more information (this method is used by the connect() implementation).

connect() also has arguments for setting the baud rate, returning your own custom vehicle classes and setting the length of the connection timeout.

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值