A hand is a special type of robot that can have a grasp associated with it. More...
#include <robot.h>
Public Member Functions | |
virtual bool | approachToContact (double moveDist, bool oneStep=true) |
Moves the hand in the pre-specified approach direction until contact is made. | |
virtual bool | autoGrasp (bool renderIt, double speedFactor=1.0, bool stopAtContact=false) |
Closes all fingers in a direction pre-specified (usually in config file). | |
virtual void | cloneFrom (Hand *original) |
Clones this hand from another. | |
virtual bool | findInitialContact (double moveDist) |
Moves the hand back until it is out of collision, then forward until a contact is made. | |
KinematicChain * | getFinger (int i) const |
Grasp * | getGrasp () const |
int | getNumFingers () const |
Link * | getPalm () const |
Hand (World *w, const char *name) | |
Constructs the instance of the Grasp, then calls the Robot constructor. | |
virtual bool | quickOpen (double speedFactor=0.1) |
Opens the fingers in the opposite direction of autoGrasp. | |
virtual | ~Hand () |
Also deletes the instance of the Grasp. | |
Protected Attributes | |
Grasp * | grasp |
A pointer to the grasp associated with this hand. |
A hand is a special type of robot that can have a grasp associated with it.
A hand is a special type of a more generic robot. Generally it consists of a palm as the base link and one or more fingers, which are kinematic chains. One instance of a grasp is associated with each hand, and it is usually analyzed each time contacts between the hand and the object to be grasped change. The hand class also provides an autograsp method which closes the fingers at fixed rates until further motion is prevented by contacts.
This class is more the results of legacy architecture than any conceptual differences. Arguably, any robot is also a "hand", especially since we allow any robot to have multiple kinematic chains. It is possible that we will get rid of the Hand class altogether at some point.
Definition at line 669 of file robot.h.
Hand::Hand | ( | World * | w, | |
const char * | name | |||
) |
Hand::~Hand | ( | ) | [virtual] |
bool Hand::approachToContact | ( | double | moveDist, | |
bool | oneStep = true | |||
) | [virtual] |
Moves the hand in the pre-specified approach direction until contact is made.
Moves the palm (robot) in the direction specified by approachDirection. It stops if an object has been touched, or the maximum distance of moveDist has been covered. Returns true if object has been hit. It expects an initial state that is collision-free.
bool Hand::autoGrasp | ( | bool | renderIt, | |
double | speedFactor = 1.0 , |
|||
bool | stopAtContact = false | |||
) | [virtual] |
Closes all fingers in a direction pre-specified (usually in config file).
Closes each DOF at a rate equal to speedFactor * its default velocity. The closing continues until a joint limit is reached or a contact prevents further motion. The larger the speedFactor, the larger the individual steps will be and increases the likelyhood that a collision may be missed. The renderIt flag controls whether the intermediate steps will be rendered.
If stopAtContact is set and the execution is in static mode, movement will stop as soon as any contact is made. Otherwise, movement will continue untill all joints have been stopped and no movement is possible.
If you want the opposite motion, just pass a negative speedFactor.
void Hand::cloneFrom | ( | Hand * | original | ) | [virtual] |
bool Hand::findInitialContact | ( | double | moveDist | ) | [virtual] |
Moves the hand back until it is out of collision, then forward until a contact is made.
Moves the hand back along its approach direction until it is collision free, then forward until it finds the exact moment of contact. It moves forward at most moveDist. It can accept an initial state that is in collision, as it will move back until collision is resolved.
KinematicChain* Hand::getFinger | ( | int | i | ) | const [inline] |
Grasp* Hand::getGrasp | ( | ) | const [inline] |
int Hand::getNumFingers | ( | ) | const [inline] |
Link* Hand::getPalm | ( | ) | const [inline] |
bool Hand::quickOpen | ( | double | speedFactor = 0.1 |
) | [virtual] |
Grasp* Hand::grasp [protected] |