#include <bhandforceext.h>
Inheritance diagram for BHandForceExt:
Public Member Functions | |
BHandForceExt (std::string devName) | |
Constructor for class BHandForce. | |
void | init () |
Initializes the BarrettHand. | |
virtual | ~BHandForceExt () |
Destructor. | |
Movement Commands | |
Movement commands are motor commands: they immediately affect one or more of the motors. | |
void | adjustForce (const Motors motors, const double force) throw (BHandException) |
Moves the finger(s) that the force is obtained. | |
void | force2File (std::string fileName, bool showPlot=false) |
Records force values to file. | |
void | move (const Motors motors, const int position[4]) throw (BHandException) |
Moves all Motors to the given Position. | |
void | move (const Motors motors, const int position) throw (BHandException) |
Moves all Motors to the given Position. | |
void | move (const Motors motors, const bool plotIt=false) throw (BHandException) |
Moves vereryone of the motors to its desired position. | |
void | moveForce (const Motors motors, double force) throw (BHandException, BHMotorException) |
Moves (closes) the fingers until the finger is not moving or the limit force is reached. | |
void | moveForce (const Motors motors, double force[3], const bool sameSpeed=false) throw (BHandException, BHMotorException) |
Moves (closes) the fingers until the finger is not moving or the limit force is reached. | |
void | moveG (const Motors motors, const int position) throw (BHandException) |
void | moveG (const Motors motors) throw (BHandException) |
Force commands | |
void | getForce (double *forces, const bool update=true) |
Returns the finger force values. | |
Movement Parameter Commands | |
Movement parameter commands have effects on the movement commands. | |
void | setMaxForce (const double force, const Motors motors=FINGERS) |
Sets the maximal allowed force for the given fingers. | |
void | setMinForce (const double force, const Motors motors=FINGERS) |
Sets the minimal allowed force for the given fingers. | |
Protected Attributes | |
ZLinearFunction | RealForceFunction [NUM_FINGERS] |
This class provides higher-level functions for force controll of the BarrettHand with use of the strain-gage sensors.
Due to the fact that the TorqueSwitch is not detectable by hardware a force log mechanis is implemented to detect the activation. For activation the speed has to be above 40. The logging mechanis is implemented to detect activations at a speed of 50. If the speed is over 70 a secure detection is not possible, because you do not get enough force feedback value for detection.
The activation of the TorqueSwicth has a dramatical impact on the force values observed by the force sensor of the corresponding finger. For this reasion it is impossible to have both: contorl of the TorqueSwitch and a force to reach.
add force calibration for fingers after pos 8000...
adjust controller for position movements
BHandForceExt::BHandForceExt | ( | std::string | devName | ) |
Constructor for class BHandForce.
devName | Name for the device the BarrettHand is connected to (e.g. /dev/ttyS0). |
BHandForceExt::~BHandForceExt | ( | ) | [virtual] |
Destructor.
void BHandForceExt::adjustForce | ( | const Motors | motors, | |
const double | force | |||
) | throw (BHandException) |
Moves the finger(s) that the force is obtained.
The direction of the movement depends on the dircetion of the force. Negative force will close the hand and positive will open it.
So, if you want to hold an object with a specific force, you have to define the force negative.
WARNING The move functions (re)start the realtime mode by themself for the motors of the movement. If rt-mode is enabled it will not be disabled, because it costs to much time. So if you start rt-mode for F1 and want ot adjust the force for F2 you will have call stop() before calling adjustForce() !
motors | Motors to be Moved. If spread is included it will be ignored. | |
force | Force which should be applied to finger tips. |
void BHandForceExt::force2File | ( | std::string | fileName, | |
bool | showPlot = false | |||
) |
Records force values to file.
The Hand opens all Fingers and closes them with a rather small velocity. During this close movement all force values form the fingers ar recorded into the given file. If the output file exist, it will be clear before recording.
The output file has the format:
position_F1 force_F1 position_F2 force_F2 poistion_F3 force_F3
fileName | Output file with force and positon values. | |
showPlot | If true the force-position data will be plotted with gnuplot. |
Reimplemented from BHandForce.
void BHandForceExt::getForce | ( | double * | forces, | |
const bool | update = true | |||
) | [inline] |
Returns the finger force values.
I.e. Reads the finger force values, without moving them and updates force values on internal data structures. Returns the force value minus initialization force value.
forces | Array in which the forces are stored (Must have size of 3). | |
update | Weather the force values should be updated or not. Maybe the update is done before by getForce() or getForce(int *forces). |
Here is the call graph for this function:
void BHandForceExt::init | ( | ) |
Initializes the BarrettHand.
Does the same as BHand::init() but additionally it sets the default prameters for rel time mode.
Reimplemented from BHandForce.
void BHandForceExt::move | ( | const Motors | motors, | |
const int | position[4] | |||
) | throw (BHandException) |
Moves all Motors to the given Position.
If the Limit force of one of the fingers is reached, the motion for the coressponding will be stopped. If F1 or F2 force is exceeded Spread Motion will be stoped also.
The proportional gain value of each motor is ignored!
The function watches the Temperature of the Hand!
motors | Motors to move. | |
position | Desired positions of motors. Unit: MotorCounts The order of the positions must be is [F!,F2,F3,Spread] |
Reimplemented from BHandForce.
void BHandForceExt::move | ( | const Motors | motors, | |
const int | position | |||
) | throw (BHandException) |
Moves all Motors to the given Position.
If the Limit force of one of the fingers is reached, the motion for the coressponding finger will be stopped. If F1 or F2 force is exceeded Spread Motion will be stoped also.
The proportional gain value of each motor is ignored!
The function watches the Temperature of the Hand!
motors | Motors to move. | |
position | Destinated position. Unit: Motor Counts |
Reimplemented from BHandForce.
Reimplemented in BHandForceExtKin.
void BHandForceExt::move | ( | const Motors | motors, | |
const bool | plotIt = false | |||
) | throw (BHandException) |
Moves vereryone of the motors to its desired position.
If the Hand is not in RTMode it will be started. If the hand is already in RTMode and RTMode was set for different motors than the parameter given to this command. is probably will fail.
motors | Motors to move. |
Reimplemented from BHandForce.
void BHandForceExt::moveForce | ( | const Motors | motors, | |
double | force | |||
) | throw (BHandException, BHMotorException) [inline] |
Moves (closes) the fingers until the finger is not moving or the limit force is reached.
motors | Motors to be Moved. If spread is included it will be ignored. | |
force | Force which should be applied to finger tips. |
void BHandForceExt::moveForce | ( | const Motors | motors, | |
double | force[3], | |||
const bool | sameSpeed = false | |||
) | throw (BHandException, BHMotorException) |
Moves (closes) the fingers until the finger is not moving or the limit force is reached.
motors | Motors to be Moved. If spread is included it will be ignored. | |
force | Force which should be applied to finger tips. | |
sameSpeed | If True all motors will move with the same speed -> then they might have not the desired force any more The speed will be the lowest value of all computed. |
void BHandForceExt::setMaxForce | ( | const double | force, | |
const Motors | motors = FINGERS | |||
) |
Sets the maximal allowed force for the given fingers.
The positive froce is the force in open direction.
motors | Fingers for which the minimum force should be set. (Spread joint has no force sensor). | |
force | The value of maximal allowed force. |
void BHandForceExt::setMinForce | ( | const double | force, | |
const Motors | motors = FINGERS | |||
) |
Sets the minimal allowed force for the given fingers.
The minmum foce is the force in close direction.
motors | Fingers for which the minimum force should be set. (Spread joint has no force sensor). | |
force | The value of minimal allowed force. |
ZLinearFunction BHandForceExt::RealForceFunction[NUM_FINGERS] [protected] |
This function is used to compute real force values from the values auf the strain gage senors
![]() |
Generated Wed Aug 16 14:59:02 2006 by
![]() |