赞
踩
针对不同的编程语言生成mavlink库文件。
mavlink1协议和mavlink2协议,向后兼容。
uint8_t magic; ///< protocol magic marker
uint8_t len; ///< Length of payload
uint8_t incompat_flags; ///< flags that must be understood
uint8_t compat_flags; ///< flags that can be ignored if not understood
uint8_t seq; ///< Sequence of packet
uint8_t sysid; ///< ID of message sender system/aircraft
uint8_t compid; ///< ID of the message sender component
uint8_t msgid 0:7; ///< first 8 bits of the ID of the message
uint8_t msgid 8:15; ///< middle 8 bits of the ID of the message
uint8_t msgid 16:23; ///< last 8 bits of the ID of the message
uint8_t payload[max 255]; ///< A maximum of 255 payload bytes
uint16_t checksum; ///< CRC-16/MCRF4XX
uint8_t signature[13]; ///< Signature which allows ensuring that the link is tamper-proof (optional)
MAVLink1数据包格式类似,但省略了这些字段:compatt_flags、compat_flags和signature,并且只有一个字节用于消息地址。有关详细信息,请参阅序列化>数据包格式。
为了优化而重新排序Mavlink包的字段??
待补充…
发布、订阅;
节省链路带宽;
多个订户都可以接收这些数据;
保证发送能够到达;
发送“任务、参数、命令”等一般用这个模式;
https://mavlink.io/en/about/faq.html
These projects have some activity but are not as well maintained:
…
…
以C MAVLink库为例:
参考:https://mavlink.io/en/guide/define_xml_element.html
The MAVLink common message set contains standard definitions that are managed by the MAVLink project. The definitions cover functionality that is considered useful to most ground control stations and autopilots. MAVLink-compatible systems are expected to use these definitions where possible (if an appropriate message exists) rather than rolling out variants in their own dialects.
The original definitions are defined in common.xml.
可以查询所有通用的message、command、enums的定义和作用,有哪些参数,Id或value是几:
https://mavlink.io/en/messages/common.html
MAVLink“微服务”定义了MAVLink系统可以采用的更高级别协议,以便更好地相互操作。例如,QGroundControl、ArduPilot和PX4自动驾驶都共享一个通用的命令协议,用于发送需要确认的点对点消息。
微服务用于交换多种类型的数据,包括:参数、任务、轨迹、图像和其他文件。如果数据可能远大于单个消息所能容纳的数据,那么服务将定义如何拆分和重新组装数据,以及如何确保任何丢失的数据被重新传输。其他服务提供命令确认和/或错误报告。
大多数服务使用客户端-服务器模式,因此地面军事系统(客户端)发起请求,车辆(服务器)用数据进行响应。
主要的微服务显示在侧边栏中(下面列出了大多数):
https://mavlink.io/en/services/
广播本大爷(MavLink系统)已经上线,可以进行数据收发。
心跳包数据包括:系统和组件id、车辆类型、飞行堆栈、组件类型和飞行模式。
举个栗子:
枚举MAV_MODE的取值和描述如下:
下面的command和massage就使用到了这个枚举:
下面的massage就用到了 command 和 enum :
…
…
本质上是基于现有的massage,按照以下约定来发送massage的一个过程:
【1】https://ardupilot.org/dev/docs/mavlink-commands.html
【2】http://mavlink.io/zh/services/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。