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.
DroneKit-Python使开发者能创建在板载协同计算机上运行的应用,显著增强自动驾驶能力,增加车辆行为的智能,执行如计算机视觉等复杂任务。适用于地面站应用,与飞行器通信。API提供对飞行器遥测、状态和参数信息的编程访问,实现任务管理和直接控制。
2128

被折叠的 条评论
为什么被折叠?



