Linux开发环境

    我们使用Debian / Ubuntu LTS 作为Linux的标准支持版本,但是也支持

    把用户添加到用户组 “dialout”:

    然后注销后,重新登录,因为重新登录后所做的改变才会有效。

    更新包列表,安装下面编译PX4的依赖包。PX4主要支持的系列:

    1. sudo apt-get update
    2. # 必备软件
    3. sudo apt-get install python-argparse git-core wget zip \
    4. python-empy qtcreator cmake build-essential genromfs -y
    5. # 仿真工具
    6. sudo add-apt-repository ppa:openjdk-r/ppa
    7. sudo apt-get update
    8. sudo apt-get install openjdk-8-jre
    9. sudo apt-get install ant protobuf-compiler libeigen3-dev libopencv-dev openjdk-8-jdk openjdk-8-jre clang-3.5 lldb-3.5 -y

    Ubuntu配备了一系列代理管理,这会严重干扰任何机器人相关的串口(或usb串口),卸载掉它也不会有什么影响:

    1. sudo apt-get remove modemmanager

    更新包列表和安装下面的依赖包。务必安装指定的版本的包

    1. flex bison libncurses5-dev autoconf texinfo build-essential \
    2. libftdi-dev libtool zlib1g-dev \
    3. python-empy -y

    在添加arm-none-eabi工具链之前,请确保删除残余。

    1. sudo apt-get remove gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabi gcc-arm-embedded

    如果gcc-arm-none-eabi版本导致PX4/Firmware编译错误,请参考 手动安装4.9或者5.4版本的arm-none-eabi工具链。

    工具链安装

    1. git clone https://github.com/ATLFlight/cross_toolchain.git

    Get the Hexagon SDK 3.0 from QDN: https://developer.qualcomm.com/download/hexagon/hexagon-sdk-v3-linux.bin

    Now move the following files in the download folder of the cross toolchain as follows:

    1. mv ~/Downloads/hexagon-sdk-v3-linux.bin cross_toolchain/downloads

    Install the toolchain and SDK like this:

    1. cd cross_toolchain
    2. ./installv3.sh
    3. cd ..

    Follow the instructions to set up the development environment. If you accept all the install defaults you can at any time re-run the following to get the env setup. It will only install missing components.

    After this the tools and SDK will have been installed to “$HOME/Qualcomm/…”. Append the following to your ~/.bashrc:

    1. export HEXAGON_TOOLS_ROOT="${HOME}/Qualcomm/HEXAGON_Tools/7.2.12/Tools"
    2. export PATH="${HEXAGON_SDK_ROOT}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf_linux/bin:$PATH"

    Load the new configuration:

    Sysroot Installation

    A sysroot is required to provide the libraries and header files needed to cross compile applications for the Snapdragon Flight applications processor.

    The qrlSDK sysroot provies the required header files and libraries for the camera, GPU, etc.

    Download the file and save it in cross_toolchain/download/.

    1. cd cross_toolchain
    2. unset HEXAGON_ARM_SYSROOT
    3. ./qrlinux_sysroot.sh

    Append the following to your ~/.bashrc:

    1. export HEXAGON_ARM_SYSROOT=${HOME}/Qualcomm/qrlinux_v3.1.1_sysroot

    Load the new configuration:

    1. source ~/.bashrc

    For more sysroot options see Sysroot Installation

    升级ADSP固件

    参考

    是另外一个工具链安装向导。HelloWorld和可以用来验证工具链安装和DSP镜像。

    DSP的信息可以通过mini-dm查看。

    1. $HOME/Qualcomm/Hexagon_SDK/2.0/tools/mini-dm/Linux_Debug/mini-dm

    树莓派开发者应该从下面地址下载树莓派Linux工具链。安装脚本会自动安装交叉编译工具链。如果想要用原生树莓派工具链在树莓派上直接编译,参见这里

    在工具链安装过程中需要输入密码。

    如果不想把工具链安装在默认位置/opt/rpi_toolchain,可以执行./install_cross.sh <PATH>向安装脚本传入其它地址。安装脚本会自动配置需要的环境变量。

    Finally, run the following command to update the environmental variables:

    Developers working with the Parrot Bebop should install the RPi Linux Toolchain. Follow the
    description under .

    Next, install ADB.

    sh sudo apt-get install android-tools-adb -y`

    继续,进行第一次构建!