ubuntu 20.04环境下ROS+PX4+RPG ROS DVS+DV-gui 安装

ROS安装

使用鱼香ros的一键安装指令:

wget http://fishros.com/install -O fishros && . fishros 

ubuntu 20.04环境下ROS+PX4+RPG ROS DVS+DV-gui 安装_第1张图片

 分别选择:1 (会同时完成换源和安装)

                   3 (作用如图所示)

                   4 (如上)

                   7(很推荐的IDE,VS环境的配置在后面会说)

PX4安装

依赖安装

sudo apt install ninja-build exiftool ninja-build protobuf-compiler libeigen3-dev genromfs xmlstarlet libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python-pip python3-pip
pip2 install pandas jinja2 pyserial cerberus pyulog==0.7.0 numpy toml pyquaternion empy pyyaml 
pip3 install packaging numpy empy toml pyyaml jinja2 pyargparse

以上代码都是针对于ubuntu18.04环境下使用,20.04会提示无pip2,直接改为pip3安装即可(20.04依赖库里再无python2)

创建一个工作空间

sudo apt-get install python-catkin-tools
mkdir -p ~/catkin_ws/src
mkdir -p ~/catkin_ws/scripts
cd catkin_ws && catkin init # 使用catkin_make话,则为cd catkin_ws/src && catkin_init_workspace

安装MAVROS

sudo apt install ros-noetic-mavros ros-noetic-mavros-extras   
wget https://gitee.com/robin_shaun/XTDrone/raw/master/sitl_config/mavros/install_geographiclib_datasets.sh
sudo chmod a+x ./install_geographiclib_datasets.sh
sudo ./install_geographiclib_datasets.sh #这步需要装一段时间,请耐心等待PX4配置

安装PX4

推荐使用官方脚本安装:Ubuntu LTS/Debian Linux 的开发环境 | PX4 自动驾驶用户指南

git clone https://github.com/PX4/PX4-Autopilot.git --recursive
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh

然后重启电脑

环境配置

打开一个终端,输入:

gedit ~/.bashrc

将下列代码复制粘贴:

source ~/catkin_ws/devel/setup.bash
source ~/PX4-Autopilot/Tools/simulation/gazebo/setup_gazebo.bash ~/PX4-Autopilot/ ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo

上面代码第二行为ubuntu20.04环境下的路径,18.04需要根据自己情况对路径进行修改

保存并退出之后输入:

source ~/.bashrc

验证PX4+MAVROS是否配置完成:

roslaunch px4 mavros_posix_sitl.launch

RPG ROS DVS与DV-gui安装

 官方教程:GitHub - uzh-rpg/rpg_dvs_ros: ROS packages for DVS

  • 安装依赖:
sudo apt-get install ros-noetic-camera-info-manager
sudo apt-get install ros-noetic-image-view
sudo add-apt-repository ppa:inivation-ppa/inivation
sudo apt-get update
sudo apt-get install dv-gui
sudo apt-get install libcaer-dev
sudo apt-get install python-catkin-tools
  • 安装驱动
    cd ~/catkin_ws/src
    git clone https://github.com/catkin/catkin_simple.git
    cd ~/catkin_ws/src
    git clone https://github.com/uzh-rpg/rpg_dvs_ros.git
catkin build dvs_ros_driver (if you are using the DVS128)
catkin build davis_ros_driver (if you are using the DAVIS)
catkin build dvxplorer_ros_driver (if you are using the DVXplorer)
catkin build dvs_renderer
  • 环境测试
roslaunch dvs_renderer dvs_mono.launch (if you are using the DVS128)
roslaunch dvs_renderer davis_mono.launch (if you are using the DAVIS)
roslaunch dvs_renderer dvxplorer_mono.launch (if you are using the DVXplorer) 

你可能感兴趣的:(ubuntu,linux)