Getting started with Baxter Simulator

To learn robotics properly, one needs a robot to play with. Building a robot is costly and not simple, so a simulated robot can be utilised to replace the physical one. Most of robots for research purpose currently utilise Robot Operating System (ROS), because it is flexible, modular, and open source. Mastering ROS is a must for robotics researchers or enthusiasts nowadays. Baxter robot, created by Rethink Robotics, is a good medium to learn ROS and robotics.

baxter_pick_placeAlthough Baxter is a great robot with unique features, but it is reasonably expensive. For learning purpose, it can be replaced with Baxter simulator. Previously, it is only available for the organisation who has bought Baxter, and it does not have any grippers attached in the Baxter’s arms. Since the end of 2015, the simulator has been updated, one of the biggest change is the grippers addition, and now it is open-source, so everyone can use it. This post will guide you to learn to use Baxter simulator in more systematic way.

Why Baxter simulator?

Here are several reasons to use Baxter simulator:

  • It is fully functioning, and open source, simulator.
  • Baxter is ROS-ready. It provides a user friendly Python API that wrapped ROS interfaces in Python classes. Baxter simulator is developed in Gazebo, another open source program.
  • While one can learn about ROS by using the turtlebot simulator, it is only a mobile robot. On the other hand, Baxter has two manipulators, so one can learn to control the arm control using a simple joints control, an inverse kinematics (IK) solving or a complex trajectory planning. Many other complex extension can be performed on Baxter.
  • Baxter robot is well documented. This post just fills the small gap on that excellent documentation.

Requirements

To be able to follow this post without hassles, one must understands the basic of ROS [1]. Mastering Gazebo will be very helpful but it is not necessary at this stage. It also will be useful to understand the concepts behind Baxter [2], [3] and Baxter simulator [4].

Our aim here is performing the Baxter examples in the simulator. As requirements, you must have ROS Indigo and Gazebo 2.2 installed in your computer. Currently, other versions are not officially supported. Follow the guideline [5] to install ROS Indigo (if you have not done it) and Baxter RSDK 1.2.0. If you have physical Baxter robot, then you can proceed to perform “Hello Baxter” example. If not, go on to next step by installing Gazebo 2 and the Baxter simulator [6].

To start using the real Baxter, one must type: ./baxter.sh in a terminal, while when using simulated Baxter, this command is given: ./baxter.sh sim . Baxter provides program examples [7] that many of them can be performed in a simulation.

Learning from Examples

Among those examples, I list several examples that I found useful below. To learn deeply, you are suggested to dive into each “code walk-through” of the example and try to understand it well.

1. Hello Baxter [8]

This is a general example that teach you these things:

  • How to set up ROS environment and verify ROS connectivity
  • How to enable Baxter robot
    • This step is important as a robot need to be enabled before it can perform many other things
  • How to program robot to do waving movement using interactive Python

It is not so important to understand each little things that happens here. This example just want you to grasp the idea about Baxter robot and how to program it. You will need to give more attentions on code in later examples.

I copy the code in the example and put in a new Python program, “hello_baxter.py”, then I put it in “baxter_example/scripts” folder. I run these commands from different terminals :

  • roslaunch baxter_gazebo baxter_world.launch
  • rosrun baxter_tools enable_robot.py -e
  • rosrun baxter_example hello_baxter.py

Here is the video:

2. Wobbler [9]

The easiest way to control a manipulator is by doing it in joint space, where we assign each motor joint to rotate in a particular angle. Practically, we can control Baxter’s joint position or joint velocity. The former is simpler than the latter. Controlling the joints directly always works, as long as it is in the range of motor’s capability, however it is hard for humans to control the arm that way as we observe the world in task or operational space. More on this later.

The example is about controlling Baxter in joint space, specifically using joint velocity control. I run these commands from different terminals :

  • roslaunch baxter_gazebo baxter_world.launch
  • rosrun baxter_examples joint_velocity_wobbler.py

Here is the video:

3. IK service  [10]

The more complex, but useful, way to control a manipulator is by controlling it in task or operational space. It means that humans only specify the spatial coordinates in 3D cartesian space and then use an Inverse Kinematic solver to convert them into the angles of joints [11]. Some time the IK solver fails because there are problems that can’t be solved analytically.

There is an example of using the IK service. Although this example has not involved interface to Baxter arm, so there is no movement in the robot, but it is still useful to understand how IK service is implemented in Baxter.

In the future post, I will describe about “pick and place demo” (provided by Rethink Robotics) which includes simple IK solver implementation.

References:

  1. www.ros.org
  2. http://sdk.rethinkrobotics.com/wiki/Foundations
  3. http://sdk.rethinkrobotics.com/wiki/Advanced_Understanding
  4. http://sdk.rethinkrobotics.com/wiki/Baxter_Simulator
  5. http://sdk.rethinkrobotics.com/wiki/Workstation_Setup
  6. http://sdk.rethinkrobotics.com/wiki/Simulator_Installation
  7. http://sdk.rethinkrobotics.com/wiki/Example_Programs
  8. http://sdk.rethinkrobotics.com/wiki/Hello_Baxter
  9. http://sdk.rethinkrobotics.com/wiki/Wobbler_Example
  10. http://sdk.rethinkrobotics.com/wiki/IK_Service_Example
  11. https://en.wikipedia.org/wiki/Inverse_kinematics

Leave a Reply