简体   繁体   English

Mavlink命令中的[180]是什么意思?

[英]Mavlink command what does the [180] means?

I am trying to send a mavlink command for instance例如,我正在尝试发送一个 mavlink 命令

GPS_RTCM_DATA ( #233 )

flags   uint8_t     

len     uint8_t

data    uint8_t[180]        RTCM message (may be fragmented)

https://mavlink.io/en/messages/common.html#GPS_RTCM_DATA https://mavlink.io/en/messages/common.html#GPS_RTCM_DATA

I understand uint8_ would be in a single byte unsigned int.我知道 uint8_ 将是一个单字节无符号整数。 What does the [180] means? [180] 是什么意思?

The uint8_t[180] in the MAVLink GPS_RTCM_DATA message means that the data field can contain up to 180 bytes. MAVLink GPS_RTCM_DATA消息中的uint8_t[180]表示data字段最多可以包含 180 个字节。

Beware that RTCM messages can be bigger than 180 bytes and be fragmented in more than one GPS_RTCM_DATA message.请注意,RTCM 消息可能大于 180 字节,并且会被分成多个 GPS_RTCM_DATA 消息。

You can check the flags field as stated in the mavlink documentation:您可以按照 mavlink 文档中的说明检查flags字段:

LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. LSB:1 表示消息被分片,接下来的 2 位是分片 ID,其余 5 位用于序列 ID。 Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot.只有在自动驾驶仪上重建了整个消息后,才将消息刷新到 GPS。 The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers.片段 ID 指定片段应以何种顺序组装到缓冲区中,而序列 ID 用于检测不同缓冲区之间的不匹配。 The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received.当所有 4 个片段都存在或接收到具有非完整有效负载的第一个片段之前的所有片段时,缓冲区被认为是完全重建的。 This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.此管理用于确保正常的 GPS 操作不会损坏 RTCM 数据,并从不可靠的运输交付订单中恢复。

I tried every but it doesn't work.我尝试了每一个,但它不起作用。 Except putting it as a 180 byte arrays.除了将其作为 180 字节 arrays 之外。 The data might be only 30 bytes for example.例如,数据可能只有 30 个字节。 But input with the other 150 0x00 bytes in this way, the python program accepts my command.但是以这种方式输入其他 150 个 0x00 字节,python 程序接受我的命令。 Strangely so.奇怪的是。 I can't explain why but in this case it works.我无法解释为什么,但在这种情况下它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM