Tutorials/drcsim/2.0/Sandia Hand Grasp Control


 * 1) DRC Tutorial: Sending Grasp Commands to Sandia Hands in Atlas Simulation

In this tutorial, we'll send desired grasp pose to Sandia hands mounted on an Atlas robot in simulation through the use of a simple ROS topic publisher. Please note that this is a tremendously simplistic implementation of grasping, and is not in any way attempting to be a "reference" implementation of any sort. The controller is just a strawman to demonstrate motion of the hands into several canonical grasps.


 * 1) Setup

We assume that you've already done the installation step.

If you haven't done so, make sure to source the environment setup.sh files with every new terminal you open:

source /usr/share/drcsim/setup.sh

To save on typing, you can add this script to your `.bashrc` files, so it's automatically sourced every time you start a new terminal.

echo 'source /usr/share/drcsim/setup.sh' >> ~/.bashrc source ~/.bashrc

But remember to remove them from your `.bashrc` file when they are not needed any more.


 * 1) Running the Simulation

1. In terminal, source the DRC simulator setup script and start the DRC robot simulation:

roslaunch atlas_utils atlas_sandia_hands.launch

1. Look for ros nodes controlling Sandia hands by typing

rosservice list | grep sandia_hand

In particular, note the Sandia hands services:

/sandia_hands/l_hand/simple_grasp /sandia_hands/r_hand/simple_grasp

1. To get more information on the type of service offered, type

$ rosservice info /sandia_hands/l_hand/simple_grasp Node: /sandia_hands/l_hand/simple_grasp_left URI: rosrpc://lcp1:37083 Type: sandia_hand_msgs/SimpleGraspSrv Args: grasp

If you get this message:

ERROR: Unable to load type [sandia_hand_msgs/SimpleGraspSrv]. Have you typed 'make' in [sandia_hand_msgs]?

run:

rosmake sandia_hand_teleop rosmake sandia_hand_msgs rosmake sandia_hand_description rosmake sandia_hand_driver

The service type is [sandia_hand_msgs/SimpleGraspSrv](https://bitbucket.org/osrf/sandia-hand/src/ca4a3950defe543cffc6d826ce9c1f6cbce74055/ros/sandia_hand_msgs/srv/SimpleGraspSrv.srv?at=default) which contains a [SimpleGrasp message](https://bitbucket.org/osrf/sandia-hand/src/ca4a3950defe/ros/sandia_hand_msgs/msg/SimpleGrasp.msg?at=default), to see what it is, do:

$ rosmsg show SimpleGrasp [sandia_hand_msgs/SimpleGrasp]: string name float64 closed_amount

1. In a separate terminal, invoke the service call to close left hand half way by executing:

rosservice call /sandia_hands/l_hand/simple_grasp ' { grasp: { name: "spherical", closed_amount: 0.8 } }'




 * 1) Next ##

Next: