IK Pick and Place Demo

From sdk-wiki
Jump to: navigation, search


The IK Pick and Place Demo is an intermediate level example program, found in the baxter_sim_examples package of baxter_simulator. It combines calling the simulated Inverse-Kinematics (IK) Service to obtain a joint angles solution for a given endpoint Cartesian point & orientation with Position control movement, and grasping / releasing an object. Additionally, this example shows how to load objects into Gazebo programmatically, and how to pause sending joint commands until the baxter_emulator has fully loaded.

Code Walkthrough

IK Pick and Place Demo - Code Walkthrough


To quickly launch this demo, from an RSDK Shell (simulated), use this command to bring up Baxter in simulation with a table and a block to pick and place:

    $ ./baxter.sh sim
    $ roslaunch baxter_sim_examples baxter_pick_and_place_demo.launch


From an RSDK Shell (simulated), use two shells to run first launch baxter_world.launch, then the ik_pick_and_place_demo.py demo from the baxter_sim_examples package, Ex:

    $ ./baxter.sh sim
    $ roslaunch baxter_gazebo baxter_world.launch
    $ ./baxter.sh sim
    $ rosrun baxter_sim_examples ik_pick_and_place_demo.py

The first command will spawn Baxter in Gazebo. Then the second command will spawn a table with a block on top of it in a known location. Once the baxter_emulator is fully loaded, the example will call the IK Service for hard-coded Cartesian Poses for the given arm.

The poses are intended to show the capability of a pick and place demo and the behind the scene mechanics for manipulation objects in simulation. Between randomness in the Gazebo physics and the hard-coded nature of this demo, however, it will surely fail after just a few picks and places. To make this demo more robust, try adding perception.

As mentioned in the Quick Start section, if you would prefer to launch Baxter in Gazebo and have it proceed directly into the pick and place demo, you can use the roslaunch file instead of the above commands:

    $ ./baxter.sh sim
    $ roslaunch baxter_sim_examples baxter_pick_and_place_demo.launch

For more information on Arm Control, see Using the Arms.



See the API Reference page for details.

  • IK Solver Service: /ExternalTools/<limb>/PositionKinematicsNode/IKService
  • Gazebo SDF Model Spawner: /gazebo/spawn_sdf_model
  • Gazebo URDF Model Spawner: /gazebo/spawn_urdf_model
  • Gazebo Model Deleter: /gazebo/delete_model

baxter_interface APIs

Limb class: limb.py
Gripper class: gripper.py
RobotEnable class: robot_enable.py