Simulator Installation

From sdk-wiki
Jump to: navigation, search

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 gazebo2 ros-indigo-qt-build ros-indigo-driver-common ros-indigo-gazebo-ros-control ros-indigo-gazebo-ros-pkgs ros-indigo-ros-control ros-indigo-control-toolbox ros-indigo-realtime-tools ros-indigo-ros-controllers ros-indigo-xacro python-wstool ros-indigo-tf-conversions ros-indigo-kdl-parser
$ 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
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list'
$ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install python-wstool python-rosdep ros-groovy-pcl-conversions ros-groovy-control-msgs ros-groovy-cmake-modules ros-groovy-qt-build ros-groovy-moveit-full ros-groovy-driver-common ros-groovy-image-common ros-groovy-rostest gazebo

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/baxter_simulator/master/baxter_simulator.rosinstall
$ wstool update

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

Build Source

$ source /opt/ros/indigo/setup.bash
$ cd ~/ros_ws
$ catkin_make
  • Use baxter.sh - it has a special hook for sim:
$ cp src/baxter/baxter.sh .
  • Edit the your_ip value in baxter.sh
  • 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/baxter_simulator/kinetic-devel/baxter_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 baxter.sh - it has a special hook for sim:
$ cp src/baxter/baxter.sh .
  • Edit the your_ip value in baxter.sh

Install baxter_simulator

$ sudo apt-get install ros-indigo-baxter-simulator
  • Use baxter.sh - it has a special hook for sim:
$ cd ~/ros_ws
$ wget https://raw.githubusercontent.com/RethinkRobotics/baxter/master/baxter.sh
  • Edit the your_ip value in baxter.sh
  • From your catkin workspace where the SDK resides, use wstool to install and update:
$ cd ~/ros_ws/src
$ wstool merge https://raw.githubusercontent.com/RethinkRobotics/baxter_simulator/release-0.8.1/baxter_simulator.rosinstall 
$ cd ~/ros_ws/src
$ wstool init .
$ wstool merge baxter_simulator/baxter_simulator.rosinstall
$ wstool update

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

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

Simulation

  • Run the baxter shell script with sim specified:
$ ./baxter.sh sim
  • Start simulation with controllers:
$ roslaunch baxter_gazebo baxter_world.launch

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
[ 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 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