ROS 无人机仿真系统2 —— 平台搭建

版权声明: https://blog.csdn.net/KongDaQing1290/article/details/79741485

1、平台选择

        参照仿真系统 https://github.com/ethz-asl/rotors_simulator进行平台搭建,这里选择ubuntu14.04 + ros-indigo + gazebo7。

2、ROS安装

        这里安装ROS-INDIGO完整版,具体如下:

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install ros-indigo-desktop-full ros-indigo-joy ros-indigo-octomap-ros python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev
$ sudo rosdep init
$ rosdep update
$ source /opt/ros/indigo/setup.bash

  如果安装过程出现问题,请参考:http://www.aiuxian.com/article/p-2598130.html

3、GAZEBO7安装

       ros-indigo-desktop-full自带gazebo,但是版本较老,不支持仿真系统,所以要安装gazebo5以上的版本,仿真系统上推荐的是gazebo5,但笔者多次测试总会出现故障,遂换成gazebo7。具体安装如下:

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-indigo-gazebo7-ros-pkgs

4、创建工作区

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace  # initialize your catkin workspace
$ wstool init

5、下载仿真系统

$ cd ~/catkin_ws/src
$ git clone https://github.com/ethz-asl/rotors_simulator.git
$ git clone https://github.com:ethz-asl/mav_comm.git

6、编译仿真系统

$ cd ~/catkin_ws/
$ catkin init  # If you haven't done this before.
$ catkin build

    若报错,参照具体报错信息解决或者网上查询办法。

7、增加源

$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

猜你喜欢

转载自blog.csdn.net/KongDaQing1290/article/details/79741485