Running Both Hands
This tutorial assumes you have worked through the single-hand driver bringup tutorial.
With both hands, we can't simply launch the driver twice (with different IP's), since the topic/parameter/service names would collide. Instead, we will launch two driver instances in their own namespaces, allocating host ports so they don't overlap:
In one terminal we will launch the right hand in its own namespace, naming it right_hand_node :
rosrun sandia_hand_driver sandia_hand_node __ns:=right_hand _ip:=10.66.171.23 _port:=12321
Note the use of double-underscores for the system-level ns (namespace) parameter, and the single underscore for the private node parameters ip and port.
In another terminal, we can now launch the left hand in its own namespace. The port number will be offset by 4, since the driver actually requires four UDP ports:
rosrun sandia_hand_driver sandia_hand_node __ns:=left_hand _ip:=10.66.171.22 _port:=12325
Now, we have two instances of the driver up and running, one in namespace right_hand and one in namespace left_hand. The topic list then includes things like:
/left_hand/mobo/raw_state /left_hand/palm/raw_state /left_hand/joint_commands /right_hand/mobo/raw_state /right_hand/palm/raw_state /right_hand/joint_commands
To run the simple grasp controllers as in the single-hand tutorial, we need to launch a pair of simple_grasp.py nodes in the namespaces of the left and right hands. In one terminal:
rosrun sandia_hand_teleop simple_grasp.py __ns:=left_hand
In another terminal:
rosrun sandia_hand_teleop simple_grasp.py __ns:=right_hand
Note that those invocations require specifying the namespace for each grasp controller (right_hand vs. left_hand).
Finally, we can now send commands to the grasp controllers. In a new terminal, we can try the following commands to move the right and left hands independently:
rosrun sandia_hand_teleop simple_grasp_client.py left cylindrical 0.5 rosrun sandia_hand_teleop simple_grasp_client.py right spherical 0.2
When finished exercising the hands, don't forget to send them both back home (so that you don't have to do it manually later):
rosrun sandia_hand_teleop simple_grasp_client.py left cylindrical 0 rosrun sandia_hand_teleop simple_grasp_client.py right cylindrical 0
Then you can ctrl-C everything to power down the fingers.
Of course, it was somewhat cumbersome to type the long incantations of sandia_hand_node at the beginning, in their own terminals. To make this easier next time, you can do this:
roslaunch sandia_hand_driver both_hands.launch