Gazebo guide

From Robin

Revision as of 17:09, 20 February 2023 by Claudaba (Talk | contribs)
Jump to: navigation, search

Gazebo is a very useful tool used for simulations in robotics. You can create/load worlds with objects and your robot inside, and run simulations of movements on the robot. This is useful, as you can develop programs and test them out in a simulated environment and observe how the robot moves before testing it out on a physical robot.

Setup

To make it easier working with Tiago and ROS, you can use a Singularity container where the most basic packages you need are already installed. See how you can use the Singularity container on the robin wiki page here.

You might need to set some environment variables to be able to run simulations on your computer successfully. After you enter the Singulairty shell and you are ready to start simulating, check the environment variables ROS_MASTER_URI and ROS_IP. The ROS master should be set to run locally on your computer and the ROS ip should be set to your computer, like this:

 export ROS_MASTER_URI=http://localhost:11311
 export ROS_IP=vixen-nb.uio.no

If you are not using the vixen computer, change the IP to the computer you are using.

Running a predefined motion from the play_motion gallery in Gazebo

To simply simulate a predefined motion from the play_motion gallery in Gazebo, you should enter the Singularity shell, open an (empty) world in Gazebo and run your motion. In one terminal, enter the Singularity shell:

 singularity shell --nv /projects/robin/programs/sing-con/ros-melodic-pal/ros-melodic-pal.sif

This will open a Singularity shell and you should now see the prompt as Singularity>. Remember to use the --nv flag to be able to run GUI applications from inside the container. Next, launch Gazebo by running this command:

 roslaunch tiago_gazebo tiago_gazebo.launch world:=empty public_sim:=true end_effector:=pal-gripper

In another terminal, enter the Singularity shell again and run the following command in order to run the motion. You can choose which motion from the play_motion gallery you want to simulate. Look here for a list of all motions you can simulate from this gallery. Insert the name of the chosen motion instead of "NAME-OF-MOTION" in the command below to run the simulation.

 rosrun play_motion run_motion_python_node.py NAME-OF-MOTION

Then, go to the Gazebo window and observe how the robot simulates the chosen motion.

Running a predefined motion from the play_motion gallery on the physical Tiago

Personal tools
Front page