This tutorial will cover the easiest way to update the existing Gazebo version which comes with ROS Indigo (Gazebo 2) to a later release of Gazebo. Gazebo 2 is severely outdated and it's always better to use a newer version of the software.
To begin, let's first install ROS. If you already have ROS installed, you can skip this part and move on to the next part. If you want to do something else, check this detailed documentation for more details.
Ubuntu Installation of ROS Indigo
- Configure your Ubuntu repositories
Configure your Ubuntu repositories to allow "restricted", "universe", and "multiverse". You can follow the Ubuntu guide for instructions on doing this. - Setup your sources.list
Setup your computer to accept software from packages.ros.org. ROS Indigo ONLY supports Saucy (13.10) and Trusty (14.04) for debian packages.sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
- Installation
First make sure that your Debian package index is up-to-datesudo apt-get update
Desktop-Full Installsudo apt-get install ros-indigo-desktop-full
- Initialize rosdep
Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.sudo rosdep init rosdep update
- Environment setup
It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc source ~/.bashrc
- Getting rosinstall
sudo apt-get install python-rosinstall
Updating to Gazebo 7
- Removing Gazebo 2
sudo apt-get remove gazebo2
This might leave some unmet dependecies. But do not worry. It will be solved automatically. - Installing required packages of Gazebo 7
sudo apt-get install ros-indigo-gazebo7-ros-pkgs ros-indigo-gazebo7-ros-control
Even after installing this, there might be unmet dependencies. Just restart the terminal or source the ROS installation folder.
Congratulations! You have successfully changed the Gazebo version of your ROS distribution.