PX4飞控学习(一)

一. linux下环境搭建

  • 用户需要 “dialout” 组 来访问usb
    cat >$HOME/rule.tmp <<_EOF
    # All 3D Robotics (includes PX4) devices
    SUBSYSTEM=="usb", ATTR{idVendor}=="26AC", GROUP="plugdev"
    # FTDI (and Black Magic Probe) Devices
    SUBSYSTEM=="usb", ATTR{idVendor}=="0483", GROUP="plugdev"
    # Olimex Devices
    SUBSYSTEM=="usb",  ATTR{idVendor}=="15ba", GROUP="plugdev" _EOF
    sudo mv \$HOME/rule.tmp /etc/udev/rules.d/10-px4.rules
    sudo /etc/init.d/udev restart
    sudo usermod -a -G dialout $USER
  • 必要的工具
    #cmake python gcc等编译工具
    sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
    sudo apt-get update
    sudo apt-get install python-argparse git-core wget zip \
    python-empy qtcreator cmake build-essential genromfs -y

    #模拟工具
    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串口,应该卸载
    sudo apt-get remove modemmanager

    #arm-gcc等工具
    sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y
    sudo apt-get update
    sudo apt-get install python-serial openocd flex bison libncurses5-dev autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev python-empy gcc-arm-none-eabi gdb-arm-none-eabi -y

    #stlink linux驱动
    sudo apt-get install git libusb-1.0.0-dev
    git clone https://github.com/texane/stlink.git
    cd stlink
    sudo  make install
  • PX4源码下载
    mkdir -p ~/src
    cd ~/src

    #源码下载
    git clone https://github.com/PX4/Firmware.git
    cd Firmware

    #项目依赖库更新
    git submodule update --init --recursive
    cd ..
  • 编译
    cd Firmware
    make px4fmu-v2_default
    make px4fmu-v2_default upload

你可能感兴趣的:(px4飞控)