Wednesday, 14 June 2017

Installing Gazebo and ROS on Ubuntu (VMware)





This post is to summarize the process of installing bot Gazebo and ROS and related packages on Ubuntu which I installed in VMware workstation Player (non commercial version). Being new to the process of installing applications on Linux, I ran into some problems and managed to solve them. So this post is aimed to share those solutions (problems mostly small but confusing for new users like me).

I will divide the process into exact steps I followed.

Step1: Installing Gazebo

I have Ubuntu 17.04 installed in VMware.

The default one-line installer (as given in http://gazebosim.org/tutorials?tut=install_ubuntu) didn't work for me for some reason. So I performed the step-by-step installation process given. The first problem was while using :  
sudo apt-get install gazebo8


It showed some package errors regarding gazebo8. Somewhere as I performed the earlier steps given in link I saw gazebo7 in the terminal (during update I guess). So I replaced gazebo8 with gazebo7 in the following steps. This is assuming that the ubuntu version supports gazebo7 and has some problems with gazebo8 in the repositories. The steps given in link worked perfectly fine till end. Although on running gazebo, the screen seemed to freeze with : "Preparing your world" and blank background in app (without model). Well, it is probably because its downloading models. Be patient. (I wasn't. So killed the process to exit  :P )



Step2: Installing ROS

It is necessary to install corresponding ROS and Gazebo versions for proper working. gazebo7.x is apparently supported by ROS kinetic/Lunar.  The installation instruction can be found in http://wiki.ros.org/ROS/Installation .

Problemo!:

I had proceeded to install the Kinetic version. But in the installation step saying:
sudo apt-get install ros-kinetic-desktop-full
I was presented with error saying the package doesn't exist.

So after searching, I ran
apt-cache search ros-kinetic-desktop-full
 which returned no results. The above command is to search for available packages. So I just searched for:

apt-cache search ros
where I found ros-lunar-desktop-full

So I installed lunar by just replacing 'kinetic' with 'lunar' in the commands.

Step3: Install gazebo-ros packages

Now we need to install the linking packages, instruction of which can be found in http://gazebosim.org/tutorials?tut=ros_installing

Its just the matter of running 
sudo apt-get install ros-lunar-gazebo-ros-pkgs ros-lunar-gazebo-ros-control

Step4: Testing Gazebo with ROS integration

Execute the following command to always source the appropriate ROS setup file:

source /opt/ros/lunar/setup.bash
Infact, adding this to .bashrc will be helpful.

Step5: Running the Programs

Firstly, open a terminal and execute:
roscore
This starts the main node.

Now the gazebo GUI can be started by opening a new terminal and typing:
rosrun gazebo_ros gazebo

Note: Now I had this problem where Gazebo crashed after few seconds with an error in terminal saying  VMware: vmw_ioctl_command error Invalid argument.  This is a problem specific to VMware I guess and I was able to solve this by unchecking 3D Acceleration in VMware settings.


That's it. If everything now is right, you get Gazebo app with empty world loaded!


(Took me a day get this up and running). Hopefully this helps you. Any other issue, please comment so that I can try resolving them. Cheers! :)


No comments:

Post a Comment