Defines a tendon geometry by listing its insertion points. More...
#include <humanHand.h>
Public Member Functions | |
void | addInsertionPoint (int chain, int link, vec3 point, bool isPerm) |
Adds an insertion point at the end of the insPointList. | |
void | applyForces () |
Applies previously computed forces at links that have insertion points. | |
void | checkWrapperIntersections () |
Checks if tendon intersect a wrapper and adds insertion points around the wrapper if needed. | |
void | computeSimplePassiveForces () |
Computes a naive version of passive forces based on tendon excursion; more of a placeholder. | |
void | deselect () |
bool | forcesVisible () |
float | getActiveForce () |
float | getCurrentLength () |
Gets the current length of the tendon. Assumes updateGeometry() has been called. | |
float | getDefaultRestLength () |
float | getExcursion () |
Returns the excursion of the end of the tendon compared to its rest position. | |
void | getInsertionPointForceMagnitudes (std::vector< double > &magnitudes) |
Returns the magnitudes of the forces at each insertion point, assuming a total tendon force of 1.0. | |
void | getInsertionPointLinkTransforms (std::list< std::pair< transf, Link * > > &insPointLinkTrans) |
Returns pairs of insertion points and their links, with ins. pt. transforms relative to their links. | |
void | getInsertionPointTransforms (std::vector< transf > &insPointTrans) |
Returns the locations of all insertion points in world coordinates. | |
transf | getInsertionPointWorldTransform (std::list< TendonInsertionPoint * >::iterator insPt) |
SoSeparator * | getIVRoot () |
QString | getName () |
int | getNumInsPoints () const |
Returns the total number of insertion points. | |
int | getNumPermInsPoints () const |
Returns the number of permanent insertion points. | |
float | getPassiveForce () |
TendonInsertionPoint * | getPermInsPoint (int n) |
Returns the n-th permanent insertion point. | |
float | getPreTensionLength () |
Robot * | getRobot () |
double | getStiffness () |
float | getTotalForce () |
std::list < TendonInsertionPoint * > ::iterator | insertInsertionPoint (std::list< TendonInsertionPoint * >::iterator itPos, int chain, int link, vec3 point, bool isPerm) |
Inserts an insertion point at a given position in insPointList. | |
bool | insPointInsideWrapper () |
Returns true if any of the permanent insertion points is inside a wrapper. | |
bool | isSelected () |
bool | isVisible () |
bool | loadFromXml (const TiXmlElement *root) |
double | minInsPointDistance () |
Returns the minimum distance between two consecutive permanent insertion points. | |
std::list < TendonInsertionPoint * > ::iterator | removeInsertionPoint (std::list< TendonInsertionPoint * >::iterator itPos) |
Removes the insertion point pointed to by the given iterator. | |
void | removeTemporaryInsertionPoints () |
Removes all temporary insertion points. | |
void | removeWrapperIntersections () |
Removes wrapper intersections if they are no longer needed. | |
void | select () |
void | setActiveForce (float f) |
void | setApplyPassiveForce (bool b) |
void | setDefaultRestLength (double l) |
void | setForcesVisible (bool v) |
void | setName (QString name) |
void | setPassiveForce (float f) |
void | setPreTensionLength (double l) |
void | setRestLength (double length) |
void | setStiffness (double k) |
void | setVisible (bool v) |
Tendon (Robot *myOwner) | |
void | updateGeometry () |
Updates connector geometry based on movement of links that tendon inserts into. | |
void | updateInsertionForces () |
Updates insertion point forces based on movement of links that tendon inserts into. | |
Private Member Functions | |
void | updateForceIndicators () |
Private Attributes | |
float | mActiveForce |
Force applied as a result of voluntary muscle contraction. | |
bool | mApplyPassiveForce |
Used to flip passive force application on or off. | |
float | mCurrentLength |
The current length of the tendon. | |
float | mDefaultRestLength |
The default rest length, or -1 if no default has been specified. | |
bool | mForcesVisible |
std::list< TendonInsertionPoint * > | mInsPointList |
The list of insertion points that defines the geometry of the tendon. | |
SoSeparator * | mIVForceIndicators |
Root for the arrows themselves showing forces at insertion points. | |
SoMaterial * | mIVForceIndMaterial |
Material for force indicators. | |
SoSeparator * | mIVForceIndRoot |
Root for holding all related to force indicators rendering. | |
SoDrawStyle * | mIVForceIndToggle |
Used to toggle wether force indicators are visible or not. | |
SoSeparator * | mIVRoot |
SoDrawStyle * | mIVVisibleToggle |
Used to toggle wether the tendon is visible or not; is inserted as first child of the root. | |
double | mK |
The spring constant of this tendon, if thought of as a linear spring. | |
Robot * | mOwner |
float | mPassiveForce |
Force applied as a result of tendon / muscle elongation. | |
float | mPreTensionLength |
float | mRestLength |
The currently used length of the tendon at the resting position. | |
bool | mSelected |
QString | mTendonName |
bool | mVisible |
Defines a tendon geometry by listing its insertion points.
Definition at line 182 of file humanHand.h.
Tendon::Tendon | ( | Robot * | myOwner | ) |
Definition at line 232 of file humanHand.cpp.
void Tendon::addInsertionPoint | ( | int | chain, | |
int | link, | |||
vec3 | point, | |||
bool | isPerm | |||
) |
Adds an insertion point at the end of the insPointList.
Definition at line 825 of file humanHand.cpp.
void Tendon::applyForces | ( | ) |
Applies previously computed forces at links that have insertion points.
Forces MUST have been updated by updateGeometry() and updateInsertionForces()
Definition at line 879 of file humanHand.cpp.
void Tendon::checkWrapperIntersections | ( | ) |
Checks if tendon intersect a wrapper and adds insertion points around the wrapper if needed.
Definition at line 418 of file humanHand.cpp.
void Tendon::computeSimplePassiveForces | ( | ) |
Computes a naive version of passive forces based on tendon excursion; more of a placeholder.
Simple method for some passive force computation
Definition at line 672 of file humanHand.cpp.
void Tendon::deselect | ( | ) |
Definition at line 781 of file humanHand.cpp.
bool Tendon::forcesVisible | ( | ) | [inline] |
Definition at line 328 of file humanHand.h.
float Tendon::getActiveForce | ( | ) | [inline] |
Definition at line 300 of file humanHand.h.
float Tendon::getCurrentLength | ( | ) | [inline] |
Gets the current length of the tendon. Assumes updateGeometry() has been called.
Definition at line 345 of file humanHand.h.
float Tendon::getDefaultRestLength | ( | ) | [inline] |
Definition at line 310 of file humanHand.h.
float Tendon::getExcursion | ( | ) | [inline] |
Returns the excursion of the end of the tendon compared to its rest position.
For the moment we consider that tendon elongation is actually excursion, as if the origin was free to move.
Definition at line 342 of file humanHand.h.
void Tendon::getInsertionPointForceMagnitudes | ( | std::vector< double > & | magnitudes | ) |
Returns the magnitudes of the forces at each insertion point, assuming a total tendon force of 1.0.
Definition at line 641 of file humanHand.cpp.
void Tendon::getInsertionPointLinkTransforms | ( | std::list< std::pair< transf, Link * > > & | insPointLinkTrans | ) |
Returns pairs of insertion points and their links, with ins. pt. transforms relative to their links.
The result of this function can be fed directly into the Grasp::Jacobian computation
Definition at line 625 of file humanHand.cpp.
void Tendon::getInsertionPointTransforms | ( | std::vector< transf > & | insPointTrans | ) |
Returns the locations of all insertion points in world coordinates.
The transform is such that the resultant tendon force, if any, points along the z axis of the local insertion point coordinate frame.
Definition at line 610 of file humanHand.cpp.
transf Tendon::getInsertionPointWorldTransform | ( | std::list< TendonInsertionPoint * >::iterator | insPt | ) |
Definition at line 589 of file humanHand.cpp.
SoSeparator* Tendon::getIVRoot | ( | ) | [inline] |
Definition at line 248 of file humanHand.h.
QString Tendon::getName | ( | ) | [inline] |
Definition at line 320 of file humanHand.h.
int Tendon::getNumInsPoints | ( | ) | const [inline] |
Returns the total number of insertion points.
Definition at line 278 of file humanHand.h.
int Tendon::getNumPermInsPoints | ( | ) | const |
Returns the number of permanent insertion points.
Definition at line 841 of file humanHand.cpp.
float Tendon::getPassiveForce | ( | ) | [inline] |
Definition at line 302 of file humanHand.h.
TendonInsertionPoint * Tendon::getPermInsPoint | ( | int | n | ) |
Returns the n-th permanent insertion point.
Definition at line 852 of file humanHand.cpp.
float Tendon::getPreTensionLength | ( | ) | [inline] |
Definition at line 314 of file humanHand.h.
Robot* Tendon::getRobot | ( | ) | [inline] |
Definition at line 246 of file humanHand.h.
double Tendon::getStiffness | ( | ) | [inline] |
Definition at line 308 of file humanHand.h.
float Tendon::getTotalForce | ( | ) | [inline] |
Definition at line 304 of file humanHand.h.
std::list< TendonInsertionPoint * >::iterator Tendon::insertInsertionPoint | ( | std::list< TendonInsertionPoint * >::iterator | itPos, | |
int | chain, | |||
int | link, | |||
vec3 | point, | |||
bool | isPerm | |||
) |
Inserts an insertion point at a given position in insPointList.
Definition at line 831 of file humanHand.cpp.
bool Tendon::insPointInsideWrapper | ( | ) |
Returns true if any of the permanent insertion points is inside a wrapper.
Definition at line 353 of file humanHand.cpp.
bool Tendon::isSelected | ( | ) | [inline] |
Definition at line 294 of file humanHand.h.
bool Tendon::isVisible | ( | ) | [inline] |
Definition at line 324 of file humanHand.h.
bool Tendon::loadFromXml | ( | const TiXmlElement * | root | ) |
Definition at line 896 of file humanHand.cpp.
double Tendon::minInsPointDistance | ( | ) |
Returns the minimum distance between two consecutive permanent insertion points.
Definition at line 388 of file humanHand.cpp.
std::list< TendonInsertionPoint * >::iterator Tendon::removeInsertionPoint | ( | std::list< TendonInsertionPoint * >::iterator | itPos | ) |
Removes the insertion point pointed to by the given iterator.
Definition at line 866 of file humanHand.cpp.
void Tendon::removeTemporaryInsertionPoints | ( | ) |
Removes all temporary insertion points.
Definition at line 280 of file humanHand.cpp.
void Tendon::removeWrapperIntersections | ( | ) |
Removes wrapper intersections if they are no longer needed.
Definition at line 292 of file humanHand.cpp.
void Tendon::select | ( | ) |
Definition at line 763 of file humanHand.cpp.
void Tendon::setActiveForce | ( | float | f | ) |
Definition at line 264 of file humanHand.cpp.
void Tendon::setApplyPassiveForce | ( | bool | b | ) | [inline] |
Definition at line 334 of file humanHand.h.
void Tendon::setDefaultRestLength | ( | double | l | ) | [inline] |
Definition at line 312 of file humanHand.h.
void Tendon::setForcesVisible | ( | bool | v | ) |
Definition at line 813 of file humanHand.cpp.
void Tendon::setName | ( | QString | name | ) | [inline] |
Definition at line 318 of file humanHand.h.
void Tendon::setPassiveForce | ( | float | f | ) |
Definition at line 271 of file humanHand.cpp.
void Tendon::setPreTensionLength | ( | double | l | ) | [inline] |
Definition at line 316 of file humanHand.h.
void Tendon::setRestLength | ( | double | length | ) |
Definition at line 754 of file humanHand.cpp.
void Tendon::setStiffness | ( | double | k | ) | [inline] |
Definition at line 306 of file humanHand.h.
void Tendon::setVisible | ( | bool | v | ) |
Definition at line 799 of file humanHand.cpp.
void Tendon::updateForceIndicators | ( | ) | [private] |
Definition at line 554 of file humanHand.cpp.
void Tendon::updateGeometry | ( | ) |
Updates connector geometry based on movement of links that tendon inserts into.
Definition at line 494 of file humanHand.cpp.
void Tendon::updateInsertionForces | ( | ) |
Updates insertion point forces based on movement of links that tendon inserts into.
Definition at line 698 of file humanHand.cpp.
float Tendon::mActiveForce [private] |
Force applied as a result of voluntary muscle contraction.
Definition at line 204 of file humanHand.h.
bool Tendon::mApplyPassiveForce [private] |
Used to flip passive force application on or off.
Definition at line 210 of file humanHand.h.
float Tendon::mCurrentLength [private] |
The current length of the tendon.
Definition at line 228 of file humanHand.h.
float Tendon::mDefaultRestLength [private] |
The default rest length, or -1 if no default has been specified.
Definition at line 238 of file humanHand.h.
bool Tendon::mForcesVisible [private] |
Definition at line 223 of file humanHand.h.
std::list<TendonInsertionPoint *> Tendon::mInsPointList [private] |
The list of insertion points that defines the geometry of the tendon.
This has to be a list because we create ins points dynamically when wrapping around wrappers.
Definition at line 217 of file humanHand.h.
SoSeparator* Tendon::mIVForceIndicators [private] |
Root for the arrows themselves showing forces at insertion points.
Definition at line 201 of file humanHand.h.
SoMaterial* Tendon::mIVForceIndMaterial [private] |
Material for force indicators.
Definition at line 198 of file humanHand.h.
SoSeparator* Tendon::mIVForceIndRoot [private] |
Root for holding all related to force indicators rendering.
Definition at line 192 of file humanHand.h.
SoDrawStyle* Tendon::mIVForceIndToggle [private] |
Used to toggle wether force indicators are visible or not.
Definition at line 195 of file humanHand.h.
SoSeparator* Tendon::mIVRoot [private] |
Definition at line 186 of file humanHand.h.
SoDrawStyle* Tendon::mIVVisibleToggle [private] |
Used to toggle wether the tendon is visible or not; is inserted as first child of the root.
Definition at line 189 of file humanHand.h.
double Tendon::mK [private] |
The spring constant of this tendon, if thought of as a linear spring.
Definition at line 213 of file humanHand.h.
Robot* Tendon::mOwner [private] |
Definition at line 184 of file humanHand.h.
float Tendon::mPassiveForce [private] |
Force applied as a result of tendon / muscle elongation.
Definition at line 207 of file humanHand.h.
float Tendon::mPreTensionLength [private] |
pre tensioning subtracted from rest length, of -1 if no pre-tensioning is used used only if mDefaultRestLength (absolute default rest length is specified)
Definition at line 235 of file humanHand.h.
float Tendon::mRestLength [private] |
The currently used length of the tendon at the resting position.
Definition at line 231 of file humanHand.h.
bool Tendon::mSelected [private] |
Definition at line 225 of file humanHand.h.
QString Tendon::mTendonName [private] |
Definition at line 219 of file humanHand.h.
bool Tendon::mVisible [private] |
Definition at line 221 of file humanHand.h.