MAVLINK agreement

Reference https://cloud.tencent.com/developer/news/48344

https://www.cnblogs.com/lovechen/p/5801679.html

https://www.cnblogs.com/lovechen/p/5809709.htm

On an aircraft for a lightweight mature communications protocol, compared to many custom protocol, it is very difficult to develop a small, box configuration tool directly MSG to generate the code (simply, is to generate a corresponding function interface for you to call to), directly call the interface functions corresponding to several, you do not need to package and parsing the like; outstanding advantage that the configuration and the call is relatively simple

 

 

1. Configuration

MAVLink through xml files, configuration information (MSG), the MSG will be understood as we need variable data sent or received. For example: the movement control comprising a speed and distance , xml configuration is as follows:

 

 2. Generate Code 

From the official website to download mavlink (git clone https://github.com/mavlink/mavlink.git)

mavlink official website (http://qgroundcontrol.org/mavlink/start), down to MAVLink Code and Generator below, there are several ways to obtain mavlink source, generating select herein python. That click MAVLink Generator (C / C ++, Python)

git clone https://github.com/mavlink/mavlink mavlink-generator

 

 

3. calling code

Code generation, only two functions interface can simply call:

Both functions can be:

mavlink_msg_motion_pack : Packet Interface function;

mavlink_msg_to_send_buffer : BUF converted into transmission

Guess you like

Origin www.cnblogs.com/jieruishu/p/11526061.html