Difference between revisions of "Gazebo Tutorial"

Jump to: navigation , search
(Baxter Simulator Installation)
(Baxter Simulator Installation)
Line 38: Line 38:
 
$ cd ~/ros_ws/src
 
$ cd ~/ros_ws/src
 
$ wstool init .
 
$ wstool init .
$ wstool merge https://raw.githubusercontent.com/RethinkRobotics/baxter_simulator/kinetic-devel/baxter_simulator.rosinstall
+
$ wstool merge https://raw.githubusercontent.com/RethinkRobotics/sawyer_simulator/development/sawyer_simulator.rosinstall
 
$ wstool update
 
$ wstool update
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 48: Line 48:
 
$ catkin_make
 
$ catkin_make
 
</syntaxhighlight>
 
</syntaxhighlight>
*Use baxter.sh - it has a special hook for sim:
+
*Use intera.sh - it has a special hook for sim:
 
<syntaxhighlight lang="bash" enclose="div">
 
<syntaxhighlight lang="bash" enclose="div">
$ cp src/baxter/baxter.sh .
+
$ cp src/intera_sdk/intera.sh .
 
</syntaxhighlight>
 
</syntaxhighlight>
* Edit the your_ip value in baxter.sh
+
* Edit the your_ip value in intera.sh
</tab>
 
<tab name="ROS Kinetic apt-get">
 
* First, make sure you have installed ros-indigo-desktop-full: http://wiki.ros.org/indigo/Installation/Ubuntu
 
==== Install baxter_simulator ====
 
<syntaxhighlight lang="bash" enclose="div">
 
$ sudo apt-get install ros-indigo-baxter-simulator
 
</syntaxhighlight>
 
*Use baxter.sh - it has a special hook for sim:
 
<syntaxhighlight lang="bash" enclose="div">
 
$ cd ~/ros_ws
 
$ wget https://raw.githubusercontent.com/RethinkRobotics/baxter/master/baxter.sh
 
</syntaxhighlight>
 
* Edit the your_ip value in baxter.sh
 
 
</tab>
 
</tab>
 
</tabs>
 
</tabs>
 
=== Simulation ===
 
=== Simulation ===
*Run the baxter shell script with sim specified:
+
*Run the Intera shell script with sim specified:
 
<syntaxhighlight lang="bash" enclose="div">
 
<syntaxhighlight lang="bash" enclose="div">
$ ./baxter.sh sim
+
$ ./intera.sh sim
 
</syntaxhighlight>
 
</syntaxhighlight>
 
*Start simulation with controllers:
 
*Start simulation with controllers:
 
<syntaxhighlight lang="bash" enclose="div">
 
<syntaxhighlight lang="bash" enclose="div">
$ roslaunch baxter_gazebo baxter_world.launch
+
$ roslaunch sawyer_gazebo sawyer_world.launch
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You should wait for the following three lines before the simulator is truly running:
+
 
[ INFO] [1400513321.531488283, 34.216000000]: Simulator is loaded and started successfully
+
By default the robot will be in the enabled state. To enable, run the [[Enable_Robot_Tool|enable_robot]] script from the baxter_tools package. To start and switch the controllers, use the JointCommand topic as [[API_Reference#Arm_Joints_Control_2|documented in the Baxter SDK]].
[ INFO] [1400513321.535040726, 34.219000000]: Robot is disabled
 
[ INFO] [1400513321.535125386, 34.220000000]: Gravity compensation was turned off
 
By default the robot would be in disabled state. To enable, run the [[Enable_Robot_Tool|enable_robot]] script from the baxter_tools package. To start and switch the controllers, use the JointCommand topic as [[API_Reference#Arm_Joints_Control_2|documented in the Baxter SDK]].
 
 
*Optional: Test/tune the velocity controllers or position controllers using a RQT dashboard GUI. Make sure you are in the right joint command mode when using these:
 
*Optional: Test/tune the velocity controllers or position controllers using a RQT dashboard GUI. Make sure you are in the right joint command mode when using these:
 
<syntaxhighlight lang="bash" enclose="div">
 
<syntaxhighlight lang="bash" enclose="div">

Revision as of 22:25, 30 November 2017

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

Note: This page describes an upcoming feature in Intera 5.2. Gazebo Simulation for Sawyer is not yet released.

Gazebo Logo

Please visit the Gazebo Tutorials homepage for more information

Installation/Prerequisites

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


$ 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

Baxter Simulator Installation

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

Install baxter_simulator

$ cd ~/ros_ws/src
$ wstool init .
$ wstool merge https://raw.githubusercontent.com/RethinkRobotics/sawyer_simulator/development/sawyer_simulator.rosinstall
$ wstool update

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

Build Source

$ source /opt/ros/kinetic/setup.bash
$ cd ~/ros_ws
$ catkin_make
  • Use intera.sh - it has a special hook for sim:
$ cp src/intera_sdk/intera.sh .
  • Edit the your_ip value in intera.sh

Simulation

  • Run the Intera shell script with sim specified:
$ ./intera.sh sim
  • Start simulation with controllers:
$ roslaunch sawyer_gazebo sawyer_world.launch


By default the robot will be in the enabled state. To enable, run the enable_robot script from the baxter_tools package. To start and switch the controllers, use the JointCommand topic as documented in the Baxter SDK.

  • Optional: Test/tune the velocity controllers or position controllers using a RQT dashboard GUI. Make sure you are in the right joint command mode when using these:
$ roslaunch baxter_sim_hardware baxter_sdk_position_rqt.launch

or

$ roslaunch baxter_sim_hardware baxter_sdk_velocity_rqt.launch

Smoke Test

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

$ rosnode list

This should list the nodes as here.

$ rostopic list

This should list the topics as here.

$ 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 Wobbler example:
$ ./baxter.sh sim
$ rosrun baxter_examples joint_velocity_wobbler.py
  • Start keyboard joint position example:
$ ./baxter.sh sim
$ rosrun baxter_examples joint_position_keyboard.py

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

Troubleshooting