Sunday, 4 September 2011

USING GAZEBO

GAZEBO

 

Gazebo is a part of the Player Project. It is a 3D simulator utilising ODE and OGRE. ROS has incorporated Gazebo into their distributions with some minor modification.

GAZEBO@ROS WITH WORLD FILES - A DETOUR FROM THE USUAL

Gazebo, while it is a part of Player Project is used with world files. However, ROS recommend using Gazebo with launch files - these launch files identify the corresponding world file.


However in the spirit of Player/Stage/Gazebo it is possible to run Gazebo with world files from its executable, located at /opt/ros/diamondback/stacks/simulator_gazebo/gazebo/bin .


Thus using ./gazebo with pioneer2dx.world, which is a well known Player Project world file;
  1. Start an instance of roscore - gazebo is built with slight modification, so an instance of master (roscore) is needed. The later scripts search for the master.
  2. Navigate to the gazebo executables directory ( cd /opt/ros/diamondback/stacks/simulator_gazebo/gazebo/bin)  
  3. Start Gazebo with pioneer2dx.world file (./gazebo /path/to/pioneer2dx.world)
  4. The following window should pop up,  


Trying the rxgraph to check the ROS nodes at work;


Trying with pioneer2at.world file;


The same works for Stage, the executables at /opt/ros/diamondback/stacks/simulator_stage/stage/bin  can be used in a similar manner. The executables, stage and stageros work same with a world file giving 2D simulations. However stage is the primitive Player Project executable and doesn't need a roscore master while stageros is more 'ROS like', needs roscore and works with ROS nodes. 


NOTE 
  1. Tested on ROS 1.4.9 Diamondback (Gazebo 0.10.0 and Stage 3.2.2)     
  2. pioneer2dx.world and pioneer2at.world files can be found in Gazebo installation files (viz. gazebo-0.10.0/worlds)
  3. An alternative is to use, rosrun gazebo gazebo /path/to/pioneer2dx.world file

REFERENCES
(1) I thank John Hsu for his help
(4) N.Koenig, A.Howard,"Design and Use Paradigms for Gazebo, An Open-Source Multi-Robot Simulator"
(5) Gazebo Test at Care-O-Bot webpage 
(6) Alternative download form the pioneer2dx.world file - http://ubuntuone.com/5pWIiUyo1mhrY2PHP4I86C

4 comments:

Martin Günther said...

You should also set the parameter "use_sim_time" to true by running "rosparam set /use_sime_time true". This is necessary if you are going to run any ROS nodes.

Arkapravo Bhaumik said...

Hi Martin,

Did not know that one - how does it help ?

Unknown said...

hello, I'm having problems getting started with Gazebo (never used it before).
I'm on Ubuntu 12.04 and ROS Fuerte.
roslaunch gazebo_worlds empty_world.launch fails to launch Gazebo (says Illegal Instruction). Here's the complete trace (link to question posted on answers.ros.org - no solution posted there yet):
http://answers.ros.org/question/33449/gazebo-illegal-instruction/

Thanks a lot!

Arkapravo Bhaumik said...

Hi kshitij1337, I have not used Gazebo in ROS Fuerte, however I have recently installed Gazebo (as a standalone, without ROS bindings) from http://gazebosim.org/wiki/install and it all works fine !