Gazebo Tutorial

Created by Rico Stodt, Modified on Thu, 10 Feb 2022 at 08:37 AM by Rico Stodt

Gazebo Logo

This tutorial describes how to use Sawyer with Gazebo the standard Physics Simulator for ROS.


Contents


Installation/Prerequisites

 

  • Make sure you have followed the Workstation Setup tutorial before beginning this section.
  • Ensure the following software packages are installed:

 

ROS Noetic


$ sudo apt-get install gazebo11 ros-noetic-gazebo-ros  ros-noetic-gazebo-ros-control 
ros-noetic-gazebo-ros-pkgs ros-noetic-ros-control ros-noetic-control-toolbox ros-noetic-realtime-tools 
ros-noetic-ros-controllers ros-noetic-xacro python3-wstool ros-noetic-tf-conversions ros-noetic-kdl-parser

ROS Melodic


$ sudo apt-get install gazebo9 ros-melodic-qt-build ros-melodic-gazebo-ros-control 
ros-melodic-gazebo-ros-pkgs ros-melodic-ros-control ros-melodic-control-toolbox ros-melodic-realtime-tools 
ros-melodic-ros-controllers ros-melodic-xacro python-wstool ros-melodic-tf-conversions ros-melodic-kdl-parser

ROS Kinetic



$ sudo apt-get install gazebo7 ros-kinetic-qt-build ros-kinetic-gazebo-ros-control ros-kinetic-gazebo-ros-pkgs 
ros-kinetic-ros-control ros-kinetic-control-toolbox ros-kinetic-realtime-tools ros-kinetic-ros-controllers ros-kinetic-xacro 
python-wstool ros-kinetic-tf-conversions ros-kinetic-kdl-parser ros-kinetic-sns-ik-lib


Sawyer Simulator Installation


From your catkin workspace where the SDK resides, use wstool to install and update:

  

Install sawyer_simulator

 

ROS Noetic


$ mkdir -p ~/ros_ws/src
$ cd ~/ros_ws/src
$ git clone https://github.com/RethinkRobotics/sawyer_simulator.git -b noetic_devel
$ git clone https://github.com/RethinkRobotics-opensource/sns_ik.git -b melodic-devel
$ cd ~/ros_ws/src
$ wstool init .
$ wstool merge sawyer_simulator/sawyer_simulator.rosinstall
$ wstool update

ROS Melodic


$ mkdir -p ~/ros_ws/src
$ cd ~/ros_ws/src
$ git clone https://github.com/RethinkRobotics/sawyer_simulator.git
$ git clone https://github.com/RethinkRobotics-opensource/sns_ik.git -b melodic-devel
$ cd ~/ros_ws/src
$ wstool init .
$ wstool merge sawyer_simulator/sawyer_simulator.rosinstall
$ wstool update

ROS Kinetic


$ mkdir -p ~/ros_ws/src
$ cd ~/ros_ws/src
$ git clone https://github.com/RethinkRobotics/sawyer_simulator.git
$ cd ~/ros_ws/src
$ wstool init .
$ wstool merge sawyer_simulator/sawyer_simulator.rosinstall
$ wstool update

  

IMPORTANT: Make sure all simulator repositories update to their proper branch.

 

Build Source


ROS Noetic


$ source /opt/ros/noetic/setup.bash
$ cd ~/ros_ws
$ catkin_make

ROS Melodic
$ source /opt/ros/melodic/setup.bash
$ cd ~/ros_ws
$ catkin_make

ROS Kinetic
$ source /opt/ros/kinetic/setup.bash
$ cd ~/ros_ws
$ catkin_make


Simulation


The intera.sh shell has a special hook of *sim* for Simulation. Run the Intera shell script with sim specified:


$ ./intera.sh sim

 

Start simulation with controllers:

 

$ roslaunch sawyer_gazebo sawyer_world.launch


Smoke Test


Check if the simulator was installed and launched successfully by typing the following commands:

 

$ rosnode list

 

This should list the nodes.

 

$ rostopic list

  

This should list the topics.

 

$ rostopic echo /robot/state

  

By default, the following messages should be displayed at 100 HZ.

 

enabled: False
stopped: False
error: False
estop_button: 0
estop_source: 0
---


Run SDK Examples


Start Joint Torque Springs example:


$ ./intera.sh sim
$ roslaunch sawyer_gazebo sawyer_world.launch
*in a new terminal*
$ ./intera.sh sim
$ rosrun intera_examples joint_torque_springs.py

  

Or, Start Simulated Pick and Place example:

 

$ ./intera.sh sim
$ roslaunch sawyer_sim_examples sawyer_pick_and_place_demo.launch

 

For additional information on the interfaces that are implemented with this release, visit the Simulator API page.


 

 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article