安装 MAVLink

本章主要说明如何安装MAVLink工具链,包括XML消息定义和用于生成MAVLINK源文件的图形用户界面/命令行工具。

如果你使用的是C编程语言和标准方言,则不需要安装或者生成源文件。 只需要获取预构建的库然后跳转到Using C Libraries

先决条件

The requirements for using the MAVLink generator are:

  • Python 3.3+
  • Python future模块
  • TkInter (required to use the GUI tool).
  • 环境变量PYTHONPATH必须包含mavlink存储库的目录路径。

If you are creating new XML definitions you should also install lxml and libxml2 for XML validation and formatting.

Installation

To install the MAVLink tools:

  1. Install Python 3.6+:
    • Windows:Python for Windows下载。
    • Ubuntu Linux Python 3 is present on 18.04 and 20.04 by default but you will need to install the pip3 package manager: sudo apt install python3-pip
  2. Install the future module:
    • Windows: pip3 install future
    • Linux: pip3 install --user future
  3. (Recommended) Install modules for XML validation and formatting:
    • Linux: sudo apt install python3-lxml libxml2-utils
  4. (Optional) Install TkInter
    • Windows: Installed already as part of Python for Windows
    • Linux: Enter the following terminal command: sudo apt install python3-tk
  5. Clone the mavlink repo (or your fork) into a user-writable directory: git clone https://github.com/mavlink/mavlink.git --recursive
  6. Set PYTHONPATH to the directory path containing your mavlink repository.
    • Windows: set PYTHONPATH=C:\path_to_root_of_cloned_mavlink_repository
    • Linux: PYTHONPATH=path_to_root_of_cloned_mavlink_repository

Now you are ready to Generate MAVLink Libraries.

results matching ""

    No results matching ""