java mavlink_MAVLink笔记 #01# 维基百科翻译

MAVLink是一个轻量级的通信协议,用于无人机和地面控制站的通信。本文介绍了MAVLink的基本概念,包括其包结构、消息定义、CRC校验和应用场景。内容源于维基百科,适合学习参考。
摘要由CSDN通过智能技术生成

本文内容来源于维基百科,仅供学习参考。

MAVLink(Micro Air Vehicle Link)是一种用于与小型无人机通信的协议。它被设计为一个header-only消息封送处理库。MAVLink由Lorenz Meier在LGPL许可下[2]于2009[1]年初发布。

PS. header-only库是一种“无需编译,包含头文件就可以用”的库。

MAVLink的应用

MAVLink主要用于地面控制站(GCS, Ground Control Station)与无人机之间的通信,以及载具内部子系统间的通信。它可以用来传输载具的方位、GPS位置以及速度。

MAVLink包结构

在1.0版本中包的结构如下:

f048f42da4c94ea6c703bea41fe38e58.png

PS. 0xFE = 254,即一个十进制值为254的字节标识着一个新的MAVLink消息包的开始。

版本2之后,包结构扩展为以下[3]:

5afd880456ee4135c8f3d0f78053ab4d.png

8dd9c757381ed2984a328d7836905499.png

PS. 0xFD = 253

CRC字段

详见原文。[4][5][6][7][8]

该字段主要用于确保消息包的完整性。MAVLink的循环冗余检查算法已经在Python和Java等多种语言中实现。

MAVLink消息

上述数据包中的有效负载就是MAVLink消息。每条消息都由包上的ID字段进行标识,有效负载包含来自消息的数据。MAVlink源码[9]中的XML文档定义了存储在此有效负载中的数据。

下面是从XML文档中提取的ID为24的消息。

The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame).

Timestamp (microseconds since UNIX epoch or microseconds since system boot)

0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.

Latitude (WGS84), in degrees * 1E7

Longitude (WGS84), in degrees * 1E7

Altitude (WGS84), in meters * 1000 (positive for up)

GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX

GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX

GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX

Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX

Number of satellites visible. If unknown, set to 255

注意:XML文档描述了协议字段的逻辑顺序。实际的连线格式(以及典型的内存表示)对字段重新排序[10],以减少数据结构对齐问题。在阅读从消息定义生成的代码时,这可能会造成混淆。

MAVLink生态圈

MAVLink在很多项目中作为通信协议使用,这可能意味着它们之间存在一定的兼容性。有人已经编写了一个有趣的教程[11]来解释MAVLink的基础知识。

参考

原文:https://www.cnblogs.com/xkxf/p/12240346.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值