The hand cartesian library enables the DLR/HIT hand to:
cd oid5/robots/kimp/hand/sahand_api ./sahand_yarp.py -n
import hand as h hand=h.Hand(handedness="left",sahand_number=1,portprefix="",sahand_port_name_prefix="/sahand")
Use the values adequate for your configuration. sahand_number indicates the port where the hand was connected to the PCI card. sahand_port_name_prefix indicates the prefix used by the DLR/HIT server. handedness is used for selecting the correct kinematic description. portprefix is used to add a prefix to the client port names.
hand.update_sensor_data() first=hand.fingers[1] print first.cur_joint_pos
This prints the current joint position of the finger. The finger class has a lot of more members that contain data or functions to calculate.
hand.set_controller(Finger_controller_sahand_joint_pos,finger_list=[1])
First argument is a controller class in this case Finger_controller_sahand_joint_pos is the controller that only relays information to the hand directly. There are other controllers like a close loop inverse kinematics one. The second argument is a list of fingers which will have this controller.
from numpy import pi hand.set_refs(1,[0,10*pi/180,0]) hand.update_controller_refs()
Angles are in radians. Any other units are the standard metric scale (meters, seconds,Nm, etc) To know what the refs are, please take a look in the set_refs member in the selected controller class. The joint order is: first in the list corresponds to the first joint of the kinematic chain starting from the base of the chain.