Gazebo源码安装的好处是,可以手动改动Gazebo的源代码,并测试,Gazebo安装可以有几种方式,按照 ros-kinetic-desktop-full安装的gazebo,是看不到Gazebo的源码,也就不能修改源码和调试源码。当然Gazebo也可以以apt-get 的形式安装,安装成功后,也看不到Gazebo的源码,所以要对gazebo 的源码进行修改和调试的话,只能源码安装。
源码安装过程:官网源码安装地址是http://gazebosim.org/tutorialstut=install_from_source&cat=install
Ubuntu源码安装Gazebo
一、Prerequisites
- For compiling the latest version of gazebo you will need an Ubuntu distribution equal to 16.04 (Xenial) or newer.
Make sure you have removed the Ubuntu pre-compiled binaries before installing from source:
sudo apt-get remove '.*gazebo.*' '.*sdformat.*' '.*ignition-math.*' '.*ignition-msgs.*' '.*ignition-transport.*'
- If you have previously installed from source, be sure you are installing to the same path location or that you have removed the previous installation from source version manually.
As a side note, default install locations:
- Pre-compiled Ubuntu Binaries :
/usr/bin/gazebo
- Default source install :
/usr/local/bin/gazebo
ROS Users
When building Gazebo, we recommend you do not have your /opt/ros/*/setup.sh file sourced, as it has been seen to add the wrong libraries to the Gazebo build.
二、Install Required Dependencies
In a clean Ubuntu installation you can install pre-compiled versions of all dependencies:
-
Setup your computer to accept software from packages.osrfoundation.org.
Note: there is a list of available mirrors for this repository which could improve the download speed.
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
-
Setup keys and update
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - sudo apt-get update
-
Install prerequisites. A clean Ubuntu system will need the following (replace
version
with the major version of gazebo you intend to build, eg: 7, 8, 9. And if using ROS, replacedummy
with your ROS version, eg: indigo, jade, kinetic...):wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh GAZEBO_MAJOR_VERSION=version ROS_DISTRO=dummy . /tmp/dependencies.sh echo $BASE_DEPENDENCIES $GAZEBO_BASE_DEPENDENCIES | tr -d '\\' | xargs sudo apt-get -y install
三、Optional Physics Engines
- Release Note: in order to use DART, a full compilation of Gazebo from source is needed (as detailed in this document). The .deb packages are shipping the ODE, Bullet, and Simbody physics engines.
DART Support
- Support for DART version 6 is integrated into the default branch. In an Ubuntu system, several Person