This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| projects:hand_cartesian [2010/08/24 17:36] – memeruiz | projects:hand_cartesian [2010/08/24 17:36] (current) – memeruiz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== DLR/HIT hand cartesian library ====== | ||
| + | |||
| + | The hand cartesian library enables the DLR/HIT hand to: | ||
| + | |||
| + | * Calculate current cartesian position of finger tips. | ||
| + | * Calculate current forces at finger tips. | ||
| + | * Run different types of controllers for each finger. | ||
| + | * Close loop inverse kinematics controller. | ||
| + | * Velocity inverse kinematics. | ||
| + | |||
| + | ===== Installation instructions ===== | ||
| + | |||
| + | * Get the code from oid5 repository | ||
| + | * Compile patched version of orocos-kdl | ||
| + | * Compile yarp | ||
| + | |||
| + | ===== Prerequisite: | ||
| + | |||
| + | * Run the server for the DLR/HIT hand in the computer where the hand is connected: | ||
| + | |||
| + | cd oid5/ | ||
| + | ./ | ||
| + | |||
| + | ===== Usage ===== | ||
| + | |||
| + | * Creating the hand object: | ||
| + | |||
| + | import hand as h | ||
| + | hand=h.Hand(handedness=" | ||
| + | |||
| + | 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. | ||
| + | |||
| + | * Getting data from the hand: | ||
| + | |||
| + | 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. | ||
| + | |||
| + | * To get access to the kinematics members of the finger just look into fingerobject.kinematics.* | ||
| + | * To get access to the controller members of the finger just look into fingerobject.controller.* | ||
| + | * To control the hand. First select the controller for each finger that you want to use: | ||
| + | |||
| + | hand.set_controller(Finger_controller_sahand_joint_pos, | ||
| + | |||
| + | 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. | ||
| + | |||
| + | * To command a finger to move to a joint position: | ||
| + | |||
| + | from numpy import pi | ||
| + | hand.set_refs(1, | ||
| + | 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. | ||
| + | |||
| + | * One can also change the controller parameters in the same than the references using hand.set_params(finger, | ||