Protocol Overview - プロトコル概要
MAVLink is a binary telemetry protocol designed for resource-constrained systems and bandwidth-constrained links. MAVLink is deployed in two major versions: v1.0 and v2.0, which is backwards-compatible (v2.0 implementations can parse and send v1.0 packets). Telemetry data streams are sent in a multicast design while protocol aspects that change the system configuration and require guaranteed delivery like the mission protocol or parameter protocol are point-to-point with retransmission.
MAVLinkは、リソースに制約のあるシステムおよび帯域幅に制約のあるリンク用に設計されたバイナリテレメトリプロトコルです。 MAVLinkは2つの主要なバージョンで展開されます:後方互換性があるv1.0とv2.0(v2.0実装はv1.0パケットを解析して送ることができます)。 テレメトリデータストリームはマルチキャスト設計で送信されますが、ミッションプロトコルやパラメータプロトコルのようにシステム構成を変更し、保証された配信を必要とするプロトコルの側面は再送信とポイントツーポイントです。
MAVLink 2 Packet Format
Below is the over-the-wire format for a MAVLink v2 packet. The in-memory representation might differ.
下記がMAVLinkv2パケットのための通信フォーマットです。メモリ内表現は異なる場合があります。
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 メッセージを送信したシステムまたは航空機のID
uint8_t compid; ///< ID of the message sender component メッセージを送出したコンポーネントのID
uint8_t msgid 0:7; ///< first 8 bits of the ID of the message メッセージID最初の8bit
uint8_t msgid 8:15; ///< middle 8 bits of the ID of the message メッセージID中間の8bit
uint8_t msgid 16:23; ///< last 8 bits of the ID of the message メッセージID末尾の8bit
uint8_t payload[max 255]; ///< A maximum of 255 payload bytes 最大255バイトのペイロード
uint16_t checksum; ///< X.25 CRC X.25のCRC
Serialization - 直列化
The over-the-wire format of MAVLink is optimized for resource-constrained systems and hence the field order is not the same as in the XML specification. The over-the-wire generator sorts all fields of the message according to size, with the largest fields (uint64_t) first, then down to smaller fields. The sorting is done using a stable sorting algorithm, which ensures that any fields that do not need to be reordered stay in the same relative order. This prevents alignment issues on the encoding / decoding systems and allows for very efficient packing / unpacking.
MAVLinkの通信フォーマットは、リソースに制約のあるシステム用に最適化されているため、フィールドの順序はXML仕様と同じではありません。通信内容ジェネレータは、最初に最大のフィールド(uint64_t)、次に小さいフィールドの順に、サイズに従ってメッセージのすべてのフィールドをソートします。 並べ替えは、安定した並べ替えアルゴリズムを使用して行われます。これにより、並べ替える必要のないすべてのフィールドが同じ相対順序のままになります。これは符号化/復号化システム上の整列問題を防ぎ、非常に効率的なパッキング/アンパッキングを可能にします。
For more information and specific exceptions see Serialization.
詳細および特定の例外については、直列化を参照してください。
Multicast Streams vs. Guaranteed Delivery - マルチキャストストリームと配信保証
MAVLink is built for hybrid networks where high-rate data streams from data sources (commonly drones) flow to data sinks (commonly ground stations), but are mixed with transfers requiring guaranteed delivery. The key insight is that for most telemetry streams there is not a known or single recipient: Instead, typically an onboard computer, a ground control station and a cloud system all need the same data stream.
MAVLinkは、データソース(一般的には無人偵察機)からの高速データストリームがデータシンク(一般的には地上局)に流れるハイブリッドネットワーク用に構築されていますが、配信保証が必要な転送と混在しています。要は、ほとんどのテレメトリストリームに既知または単一の受信者がいないということです。対して、通常はオンボードコンピュータ、地上管制局、およびクラウドシステムはすべて同じデータストリームを必要とします。
On the other hand configuring the onboard mission or changing the system configuration with onboard parameters requires point-to-point communication with guaranteed delivery. MAVLink achieves very high efficiency by allowing both modes of operation.