DART
6.7.3
|
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coordinates) of the Skeleton. More...
#include <DegreeOfFreedom.hpp>
Public Member Functions | |
DegreeOfFreedom (const DegreeOfFreedom &)=delete | |
const std::string & | setName (const std::string &_name, bool _preserveName=true) |
Change the name of this DegreeOfFreedom. More... | |
const std::string & | getName () const |
Get the name of this DegreeOfFreedom. More... | |
void | preserveName (bool _preserve) |
Prevent Joint::updateDegreeOfFreedomNames() from changing the name of this degree of freedom. More... | |
bool | isNamePreserved () const |
Check whether DegreeOfFreedom::lockName(bool) is activate. More... | |
std::size_t | getIndexInSkeleton () const |
Get this DegreeOfFreedom's index within its Skeleton. More... | |
std::size_t | getIndexInTree () const |
Get this DegreeOfFreedom's index within its tree. More... | |
std::size_t | getIndexInJoint () const |
Get this DegreeOfFreedom's index within its Joint. More... | |
std::size_t | getTreeIndex () const |
Get the index of the tree that this DegreeOfFreedom belongs to. More... | |
Command | |
void | setCommand (double _command) |
Set the command of this DegreeOfFreedom. More... | |
double | getCommand () const |
Get the command of this DegreeOfFreedom. More... | |
void | resetCommand () |
Set the command of this DegreeOfFreedom to zero. More... | |
Position | |
void | setPosition (double _position) |
Set the position of this DegreeOfFreedom. More... | |
double | getPosition () const |
Get the position of this DegreeOfFreedom. More... | |
void | setPositionLimits (double _lowerLimit, double _upperLimit) |
Set the position limits of this DegreeOfFreedom. More... | |
void | setPositionLimits (const std::pair< double, double > &_limits) |
Set the position limits of this DegreeOfFreedom. More... | |
std::pair< double, double > | getPositionLimits () const |
Get the position limits of this DegreeOfFreedom. More... | |
void | setPositionLowerLimit (double _limit) |
Set the lower position limit of this DegreeOfFreedom. More... | |
double | getPositionLowerLimit () const |
Get the lower position limit of this DegreeOfFreedom. More... | |
void | setPositionUpperLimit (double _limit) |
Set the upper position limit of this DegreeOfFreedom. More... | |
double | getPositionUpperLimit () const |
Get the upper position limit of this DegreeOfFreedom. More... | |
bool | isCyclic () const |
Get whether this DOF is cyclic. More... | |
bool | hasPositionLimit () const |
Get whether the position of this DegreeOfFreedom has limits. More... | |
void | resetPosition () |
Set the position of this DegreeOfFreedom to zero. More... | |
void | setInitialPosition (double _initial) |
Change the position that resetPosition() will give to this DegreeOfFreedom. More... | |
double | getInitialPosition () const |
Get the position that resetPosition() will give to this DegreeOfFreedom. More... | |
Velocity | |
void | setVelocity (double _velocity) |
Set the velocity of this DegreeOfFreedom. More... | |
double | getVelocity () const |
Get the velocity of this DegreeOfFreedom. More... | |
void | setVelocityLimits (double _lowerLimit, double _upperLimit) |
Set the velocity limits of this DegreeOfFreedom. More... | |
void | setVelocityLimits (const std::pair< double, double > &_limits) |
Set the velocity limtis of this DegreeOfFreedom. More... | |
std::pair< double, double > | getVelocityLimits () const |
Get the velocity limits of this DegreeOfFreedom. More... | |
void | setVelocityLowerLimit (double _limit) |
Set the lower velocity limit of this DegreeOfFreedom. More... | |
double | getVelocityLowerLimit () const |
Get the lower velocity limit of this DegreeOfFreedom. More... | |
void | setVelocityUpperLimit (double _limit) |
Set the upper velocity limit of this DegreeOfFreedom. More... | |
double | getVelocityUpperLimit () const |
Get the upper Velocity limit of this DegreeOfFreedom. More... | |
void | resetVelocity () |
Set the velocity of this DegreeOfFreedom to zero. More... | |
void | setInitialVelocity (double _initial) |
Change the velocity that resetVelocity() will give to this DegreeOfFreedom. More... | |
double | getInitialVelocity () const |
Get the velocity that resetVelocity() will give to this DegreeOfFreedom. More... | |
Acceleration | |
void | setAcceleration (double _acceleration) |
Set the acceleration of this DegreeOfFreedom. More... | |
double | getAcceleration () const |
Get the acceleration of this DegreeOfFreedom. More... | |
void | resetAcceleration () |
Set the acceleration of this DegreeOfFreedom to zero. More... | |
void | setAccelerationLimits (double _lowerLimit, double _upperLimit) |
Set the acceleration limits of this DegreeOfFreedom. More... | |
void | setAccelerationLimits (const std::pair< double, double > &_limits) |
Set the acceleartion limits of this DegreeOfFreedom. More... | |
std::pair< double, double > | getAccelerationLimits () const |
Get the acceleration limits of this DegreeOfFreedom. More... | |
void | setAccelerationLowerLimit (double _limit) |
Set the lower acceleration limit of this DegreeOfFreedom. More... | |
double | getAccelerationLowerLimit () const |
Get the lower acceleration limit of this DegreeOfFreedom. More... | |
void | setAccelerationUpperLimit (double _limit) |
Set the upper acceleration limit of this DegreeOfFreedom. More... | |
double | getAccelerationUpperLimit () const |
Get the upper acceleration limit of this DegreeOfFreedom. More... | |
Force | |
void | setForce (double _force) |
Set the generalized force of this DegreeOfFreedom. More... | |
double | getForce () const |
Get the generalized force of this DegreeOfFreedom. More... | |
void | resetForce () |
Set the generalized force of this DegreeOfFreedom to zero. More... | |
void | setForceLimits (double _lowerLimit, double _upperLimit) |
Set the generalized force limits of this DegreeOfFreedom. More... | |
void | setForceLimits (const std::pair< double, double > &_limits) |
Set the generalized force limits of this DegreeOfFreedom. More... | |
std::pair< double, double > | getForceLimits () const |
Get the generalized force limits of this DegreeOfFreedom. More... | |
void | setForceLowerLimit (double _limit) |
Set the lower generalized force limit of this DegreeOfFreedom. More... | |
double | getForceLowerLimit () const |
Get the lower generalized force limit of this DegreeOfFreedom. More... | |
void | setForceUpperLimit (double _limit) |
Set the upper generalized force limit of this DegreeOfFreedom. More... | |
double | getForceUpperLimit () const |
Get the upper generalized force limit of this DegreeOfFreedom. More... | |
Velocity change | |
void | setVelocityChange (double _velocityChange) |
Set the velocity change of this DegreeOfFreedom. More... | |
double | getVelocityChange () const |
Get the velocity change of this DegreeOfFreedom. More... | |
void | resetVelocityChange () |
Set the velocity change of this DegreeOfFreedom to zero. More... | |
Constraint impulse | |
void | setConstraintImpulse (double _impulse) |
Set the constraint impulse of this generalized coordinate. More... | |
double | getConstraintImpulse () const |
Get the constraint impulse of this generalized coordinate. More... | |
void | resetConstraintImpulse () |
Set the constraint impulse of this generalized coordinate to zero. More... | |
Passive forces - spring, viscous friction, Coulomb friction | |
void | setSpringStiffness (double _k) |
Set stiffness of the spring force for this generalized coordinate. More... | |
double | getSpringStiffness () const |
Get stiffness of the spring force for this generalized coordinate. More... | |
void | setRestPosition (double _q0) |
Set rest position for the spring force of this generalized coordinate. More... | |
double | getRestPosition () const |
Get rest position for the spring force of this generalized coordinate. More... | |
void | setDampingCoefficient (double _coeff) |
Set coefficient of damping (viscous friction) force for this generalized coordinate. More... | |
double | getDampingCoefficient () const |
Get coefficient of damping (viscous friction) force for this generalized coordinate. More... | |
void | setCoulombFriction (double _friction) |
Set Coulomb friction force for this generalized coordinate. More... | |
double | getCoulombFriction () const |
Get Coulomb friction force for this generalized coordinate. More... | |
Relationships | |
Joint * | getJoint () |
Get the Joint that this DegreeOfFreedom belongs to. More... | |
const Joint * | getJoint () const |
Get the Joint that this DegreeOfFreedom belongs to. More... | |
SkeletonPtr | getSkeleton () |
Get the Skeleton that this DegreeOfFreedom is inside of. More... | |
ConstSkeletonPtr | getSkeleton () const |
Get the Skeleton that this DegreeOfFreedom is inside of. More... | |
BodyNode * | getChildBodyNode () |
Get the BodyNode downstream of this DegreeOfFreedom. More... | |
const BodyNode * | getChildBodyNode () const |
Get the BodyNode downstream of this DegreeOfFreedom. More... | |
BodyNode * | getParentBodyNode () |
Get the BodyNode upstream of this DegreeOfFreedom. More... | |
const BodyNode * | getParentBodyNode () const |
Get the BodyNode upstream of this DegreeOfFreedom. More... | |
Protected Member Functions | |
DegreeOfFreedom (Joint *_joint, std::size_t _indexInJoint) | |
The constructor is protected so that only Joints can create DegreeOfFreedom classes. More... | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. More... | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. More... | |
Protected Attributes | |
std::size_t | mIndexInJoint |
Index of this DegreeOfFreedom within its Joint. More... | |
std::size_t | mIndexInSkeleton |
Index of this DegreeOfFreedom within its Skeleton. More... | |
std::size_t | mIndexInTree |
Index of this DegreeOfFreedom within its tree. More... | |
Joint * | mJoint |
The joint that this DegreeOfFreedom belongs to. More... | |
std::set< Observer * > | mObservers |
List of current Observers. More... | |
Friends | |
class | Joint |
template<class > | |
class | GenericJoint |
class | Skeleton |
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coordinates) of the Skeleton.
|
delete |
|
protected |
The constructor is protected so that only Joints can create DegreeOfFreedom classes.
|
protectedinherited |
Add an Observer to the list of Observers.
double dart::dynamics::DegreeOfFreedom::getAcceleration | ( | ) | const |
Get the acceleration of this DegreeOfFreedom.
std::pair< double, double > dart::dynamics::DegreeOfFreedom::getAccelerationLimits | ( | ) | const |
Get the acceleration limits of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getAccelerationLowerLimit | ( | ) | const |
Get the lower acceleration limit of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getAccelerationUpperLimit | ( | ) | const |
Get the upper acceleration limit of this DegreeOfFreedom.
BodyNode * dart::dynamics::DegreeOfFreedom::getChildBodyNode | ( | ) |
Get the BodyNode downstream of this DegreeOfFreedom.
const BodyNode * dart::dynamics::DegreeOfFreedom::getChildBodyNode | ( | ) | const |
Get the BodyNode downstream of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getCommand | ( | ) | const |
Get the command of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getConstraintImpulse | ( | ) | const |
Get the constraint impulse of this generalized coordinate.
double dart::dynamics::DegreeOfFreedom::getCoulombFriction | ( | ) | const |
Get Coulomb friction force for this generalized coordinate.
double dart::dynamics::DegreeOfFreedom::getDampingCoefficient | ( | ) | const |
Get coefficient of damping (viscous friction) force for this generalized coordinate.
double dart::dynamics::DegreeOfFreedom::getForce | ( | ) | const |
Get the generalized force of this DegreeOfFreedom.
std::pair< double, double > dart::dynamics::DegreeOfFreedom::getForceLimits | ( | ) | const |
Get the generalized force limits of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getForceLowerLimit | ( | ) | const |
Get the lower generalized force limit of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getForceUpperLimit | ( | ) | const |
Get the upper generalized force limit of this DegreeOfFreedom.
std::size_t dart::dynamics::DegreeOfFreedom::getIndexInJoint | ( | ) | const |
Get this DegreeOfFreedom's index within its Joint.
std::size_t dart::dynamics::DegreeOfFreedom::getIndexInSkeleton | ( | ) | const |
Get this DegreeOfFreedom's index within its Skeleton.
std::size_t dart::dynamics::DegreeOfFreedom::getIndexInTree | ( | ) | const |
Get this DegreeOfFreedom's index within its tree.
double dart::dynamics::DegreeOfFreedom::getInitialPosition | ( | ) | const |
Get the position that resetPosition() will give to this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getInitialVelocity | ( | ) | const |
Get the velocity that resetVelocity() will give to this DegreeOfFreedom.
Joint * dart::dynamics::DegreeOfFreedom::getJoint | ( | ) |
Get the Joint that this DegreeOfFreedom belongs to.
const Joint * dart::dynamics::DegreeOfFreedom::getJoint | ( | ) | const |
Get the Joint that this DegreeOfFreedom belongs to.
const std::string & dart::dynamics::DegreeOfFreedom::getName | ( | ) | const |
Get the name of this DegreeOfFreedom.
DegreeOfFreedom's name will be automatically given by the joint it belongs to. Below is the naming policy:
The default name can be renamed by setName() as well.
BodyNode * dart::dynamics::DegreeOfFreedom::getParentBodyNode | ( | ) |
Get the BodyNode upstream of this DegreeOfFreedom.
const BodyNode * dart::dynamics::DegreeOfFreedom::getParentBodyNode | ( | ) | const |
Get the BodyNode upstream of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getPosition | ( | ) | const |
Get the position of this DegreeOfFreedom.
std::pair< double, double > dart::dynamics::DegreeOfFreedom::getPositionLimits | ( | ) | const |
Get the position limits of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getPositionLowerLimit | ( | ) | const |
Get the lower position limit of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getPositionUpperLimit | ( | ) | const |
Get the upper position limit of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getRestPosition | ( | ) | const |
Get rest position for the spring force of this generalized coordinate.
SkeletonPtr dart::dynamics::DegreeOfFreedom::getSkeleton | ( | ) |
Get the Skeleton that this DegreeOfFreedom is inside of.
ConstSkeletonPtr dart::dynamics::DegreeOfFreedom::getSkeleton | ( | ) | const |
Get the Skeleton that this DegreeOfFreedom is inside of.
double dart::dynamics::DegreeOfFreedom::getSpringStiffness | ( | ) | const |
Get stiffness of the spring force for this generalized coordinate.
std::size_t dart::dynamics::DegreeOfFreedom::getTreeIndex | ( | ) | const |
Get the index of the tree that this DegreeOfFreedom belongs to.
double dart::dynamics::DegreeOfFreedom::getVelocity | ( | ) | const |
Get the velocity of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getVelocityChange | ( | ) | const |
Get the velocity change of this DegreeOfFreedom.
std::pair< double, double > dart::dynamics::DegreeOfFreedom::getVelocityLimits | ( | ) | const |
Get the velocity limits of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getVelocityLowerLimit | ( | ) | const |
Get the lower velocity limit of this DegreeOfFreedom.
double dart::dynamics::DegreeOfFreedom::getVelocityUpperLimit | ( | ) | const |
Get the upper Velocity limit of this DegreeOfFreedom.
bool dart::dynamics::DegreeOfFreedom::hasPositionLimit | ( | ) | const |
Get whether the position of this DegreeOfFreedom has limits.
bool dart::dynamics::DegreeOfFreedom::isCyclic | ( | ) | const |
Get whether this DOF is cyclic.
Return true if and only if an infinite number of DOF positions produce the same local transform. If this DOF is part of a multi-DOF joint, then producing a cycle may require altering the position of the Joint's other DOFs.
bool dart::dynamics::DegreeOfFreedom::isNamePreserved | ( | ) | const |
Check whether DegreeOfFreedom::lockName(bool) is activate.
void dart::dynamics::DegreeOfFreedom::preserveName | ( | bool | _preserve | ) |
Prevent Joint::updateDegreeOfFreedomNames() from changing the name of this degree of freedom.
This is useful if you (the user) have customized the name for this DegreeOfFreedom and want to prevent DART from automatically updating its name if its parent Joint properties ever change.
|
protectedinherited |
Remove an Observer from the list of Observers.
void dart::dynamics::DegreeOfFreedom::resetAcceleration | ( | ) |
Set the acceleration of this DegreeOfFreedom to zero.
void dart::dynamics::DegreeOfFreedom::resetCommand | ( | ) |
Set the command of this DegreeOfFreedom to zero.
void dart::dynamics::DegreeOfFreedom::resetConstraintImpulse | ( | ) |
Set the constraint impulse of this generalized coordinate to zero.
void dart::dynamics::DegreeOfFreedom::resetForce | ( | ) |
Set the generalized force of this DegreeOfFreedom to zero.
void dart::dynamics::DegreeOfFreedom::resetPosition | ( | ) |
Set the position of this DegreeOfFreedom to zero.
void dart::dynamics::DegreeOfFreedom::resetVelocity | ( | ) |
Set the velocity of this DegreeOfFreedom to zero.
void dart::dynamics::DegreeOfFreedom::resetVelocityChange | ( | ) |
Set the velocity change of this DegreeOfFreedom to zero.
|
protectedinherited |
Send a destruction notification to all Observers.
This will cause all Observers to behave as if this Subject has been permanently deleted, so it should only be called when that behavior is desired.
void dart::dynamics::DegreeOfFreedom::setAcceleration | ( | double | _acceleration | ) |
Set the acceleration of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setAccelerationLimits | ( | const std::pair< double, double > & | _limits | ) |
Set the acceleartion limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setAccelerationLimits | ( | double | _lowerLimit, |
double | _upperLimit | ||
) |
Set the acceleration limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setAccelerationLowerLimit | ( | double | _limit | ) |
Set the lower acceleration limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setAccelerationUpperLimit | ( | double | _limit | ) |
Set the upper acceleration limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setCommand | ( | double | _command | ) |
Set the command of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setConstraintImpulse | ( | double | _impulse | ) |
Set the constraint impulse of this generalized coordinate.
void dart::dynamics::DegreeOfFreedom::setCoulombFriction | ( | double | _friction | ) |
Set Coulomb friction force for this generalized coordinate.
void dart::dynamics::DegreeOfFreedom::setDampingCoefficient | ( | double | _coeff | ) |
Set coefficient of damping (viscous friction) force for this generalized coordinate.
void dart::dynamics::DegreeOfFreedom::setForce | ( | double | _force | ) |
Set the generalized force of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setForceLimits | ( | const std::pair< double, double > & | _limits | ) |
Set the generalized force limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setForceLimits | ( | double | _lowerLimit, |
double | _upperLimit | ||
) |
Set the generalized force limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setForceLowerLimit | ( | double | _limit | ) |
Set the lower generalized force limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setForceUpperLimit | ( | double | _limit | ) |
Set the upper generalized force limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setInitialPosition | ( | double | _initial | ) |
Change the position that resetPosition() will give to this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setInitialVelocity | ( | double | _initial | ) |
Change the velocity that resetVelocity() will give to this DegreeOfFreedom.
const std::string & dart::dynamics::DegreeOfFreedom::setName | ( | const std::string & | _name, |
bool | _preserveName = true |
||
) |
Change the name of this DegreeOfFreedom.
The _preserveName argument will be passed to the preserveName(bool) function. Set _preserveName to true when customizing the name of the DegreeOfFreedom; that way the name will not be overwritten if the Joint name changes.
void dart::dynamics::DegreeOfFreedom::setPosition | ( | double | _position | ) |
Set the position of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setPositionLimits | ( | const std::pair< double, double > & | _limits | ) |
Set the position limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setPositionLimits | ( | double | _lowerLimit, |
double | _upperLimit | ||
) |
Set the position limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setPositionLowerLimit | ( | double | _limit | ) |
Set the lower position limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setPositionUpperLimit | ( | double | _limit | ) |
Set the upper position limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setRestPosition | ( | double | _q0 | ) |
Set rest position for the spring force of this generalized coordinate.
void dart::dynamics::DegreeOfFreedom::setSpringStiffness | ( | double | _k | ) |
Set stiffness of the spring force for this generalized coordinate.
void dart::dynamics::DegreeOfFreedom::setVelocity | ( | double | _velocity | ) |
Set the velocity of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setVelocityChange | ( | double | _velocityChange | ) |
Set the velocity change of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setVelocityLimits | ( | const std::pair< double, double > & | _limits | ) |
Set the velocity limtis of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setVelocityLimits | ( | double | _lowerLimit, |
double | _upperLimit | ||
) |
Set the velocity limits of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setVelocityLowerLimit | ( | double | _limit | ) |
Set the lower velocity limit of this DegreeOfFreedom.
void dart::dynamics::DegreeOfFreedom::setVelocityUpperLimit | ( | double | _limit | ) |
Set the upper velocity limit of this DegreeOfFreedom.
|
friend |
|
friend |
|
friend |
|
protected |
Index of this DegreeOfFreedom within its Joint.
The index is determined when this DegreeOfFreedom is created by the Joint it belongs to. Note that the index should be unique within the Joint.
|
protected |
Index of this DegreeOfFreedom within its Skeleton.
|
protected |
Index of this DegreeOfFreedom within its tree.
|
protected |
The joint that this DegreeOfFreedom belongs to.
|
mutableprotectedinherited |
List of current Observers.