DART 6.12.2
Loading...
Searching...
No Matches
dart::constraint::JointConstraint Class Reference

JointConstraint handles multiple constraints that are defined in the joint space, such as joint position/velocity limits and servo motor. More...

#include <JointConstraint.hpp>

Inheritance diagram for dart::constraint::JointConstraint:
dart::constraint::ConstraintBase

Public Member Functions

 JointConstraint (dynamics::Joint *joint)
 Constructor.
 
 ~JointConstraint () override=default
 Destructor.
 
const std::string & getType () const override
 Returns a string representing the constraint type.
 
std::size_t getDimension () const
 Return dimesion of this constranit.
 
virtual void uniteSkeletons ()
 

Static Public Member Functions

static const std::string & getStaticType ()
 Returns constraint type for this class.
 
static void setErrorAllowance (double allowance)
 Set global error reduction parameter.
 
static double getErrorAllowance ()
 Get global error reduction parameter.
 
static void setErrorReductionParameter (double erp)
 Set global error reduction parameter.
 
static double getErrorReductionParameter ()
 Get global error reduction parameter.
 
static void setMaxErrorReductionVelocity (double erv)
 Set global error reduction parameter.
 
static double getMaxErrorReductionVelocity ()
 Get global error reduction parameter.
 
static void setConstraintForceMixing (double cfm)
 Set global constraint force mixing parameter.
 
static double getConstraintForceMixing ()
 Get global constraint force mixing parameter.
 
static dynamics::SkeletonPtr getRootSkeleton (dynamics::SkeletonPtr skeleton)
 
static dynamics::SkeletonPtr compressPath (dynamics::SkeletonPtr skeleton)
 

Protected Member Functions

void update () override
 Update constraint using updated Skeleton's states.
 
void getInformation (ConstraintInfo *lcp) override
 Fill LCP variables.
 
void applyUnitImpulse (std::size_t index) override
 Apply unit impulse to constraint space.
 
void getVelocityChange (double *delVel, bool withCfm) override
 Get velocity change due to the uint impulse.
 
void excite () override
 Excite the constraint.
 
void unexcite () override
 Unexcite the constraint.
 
void applyImpulse (double *lambda) override
 Apply computed constraint impulse to constrained skeletons.
 
dynamics::SkeletonPtr getRootSkeleton () const override
 
bool isActive () const override
 Return true if this constraint is active.
 

Protected Attributes

std::size_t mDim
 Dimension of constraint.
 

Private Attributes

dynamics::JointmJoint
 The Joint that this constraint is associated with.
 
dynamics::BodyNodemBodyNode
 The child BodyNode of the Joint that this constraint is associated with.
 
std::size_t mAppliedImpulseIndex
 Index of applied impulse.
 
Eigen::Matrix< std::size_t, 6, 1 > mLifeTime
 Life time of constraint of each DOF.
 
Eigen::Matrix< bool, 6, 1 > mActive
 Whether any of the joint contraint is active of each joint.
 
Eigen::Matrix< double, 6, 1 > mDesiredVelocityChange
 The desired delta velocity to satisfy the joint limit constraint.
 
Eigen::Matrix< double, 6, 1 > mOldX
 Constraint impulse of the previous step.
 
Eigen::Matrix< double, 6, 1 > mImpulseUpperBound
 Upper limit of the constraint impulse.
 
Eigen::Matrix< double, 6, 1 > mImpulseLowerBound
 Lower limit of the constraint impulse.
 

Static Private Attributes

static double mErrorAllowance = 0.0
 Global constraint error allowance.
 
static double mErrorReductionParameter = 0.01
 Global constraint error redection parameter in the range of [0, 1].
 
static double mMaxErrorReductionVelocity = 1e+1
 Maximum error reduction velocity.
 
static double mConstraintForceMixing = 1e-9
 Global constraint force mixing parameter in the range of [1e-9, 1].
 

Friends

class ConstraintSolver
 
class ConstrainedGroup
 

Detailed Description

JointConstraint handles multiple constraints that are defined in the joint space, such as joint position/velocity limits and servo motor.

Constructor & Destructor Documentation

◆ JointConstraint()

dart::constraint::JointConstraint::JointConstraint ( dynamics::Joint joint)
explicit

Constructor.

◆ ~JointConstraint()

dart::constraint::JointConstraint::~JointConstraint ( )
overridedefault

Destructor.

Member Function Documentation

◆ applyImpulse()

void dart::constraint::JointConstraint::applyImpulse ( double *  lambda)
overrideprotectedvirtual

Apply computed constraint impulse to constrained skeletons.

Implements dart::constraint::ConstraintBase.

◆ applyUnitImpulse()

void dart::constraint::JointConstraint::applyUnitImpulse ( std::size_t  index)
overrideprotectedvirtual

Apply unit impulse to constraint space.

Implements dart::constraint::ConstraintBase.

◆ compressPath()

dynamics::SkeletonPtr dart::constraint::ConstraintBase::compressPath ( dynamics::SkeletonPtr  skeleton)
staticinherited

◆ excite()

void dart::constraint::JointConstraint::excite ( )
overrideprotectedvirtual

Excite the constraint.

Implements dart::constraint::ConstraintBase.

◆ getConstraintForceMixing()

double dart::constraint::JointConstraint::getConstraintForceMixing ( )
static

Get global constraint force mixing parameter.

◆ getDimension()

std::size_t dart::constraint::ConstraintBase::getDimension ( ) const
inherited

Return dimesion of this constranit.

◆ getErrorAllowance()

double dart::constraint::JointConstraint::getErrorAllowance ( )
static

Get global error reduction parameter.

◆ getErrorReductionParameter()

double dart::constraint::JointConstraint::getErrorReductionParameter ( )
static

Get global error reduction parameter.

◆ getInformation()

void dart::constraint::JointConstraint::getInformation ( ConstraintInfo info)
overrideprotectedvirtual

Fill LCP variables.

Implements dart::constraint::ConstraintBase.

◆ getMaxErrorReductionVelocity()

double dart::constraint::JointConstraint::getMaxErrorReductionVelocity ( )
static

Get global error reduction parameter.

◆ getRootSkeleton() [1/2]

dynamics::SkeletonPtr dart::constraint::JointConstraint::getRootSkeleton ( ) const
overrideprotectedvirtual

◆ getRootSkeleton() [2/2]

dynamics::SkeletonPtr dart::constraint::ConstraintBase::getRootSkeleton ( dynamics::SkeletonPtr  skeleton)
staticinherited

◆ getStaticType()

const std::string & dart::constraint::JointConstraint::getStaticType ( )
static

Returns constraint type for this class.

◆ getType()

const std::string & dart::constraint::JointConstraint::getType ( ) const
overridevirtual

Returns a string representing the constraint type.

Reimplemented from dart::constraint::ConstraintBase.

◆ getVelocityChange()

void dart::constraint::JointConstraint::getVelocityChange ( double *  vel,
bool  withCfm 
)
overrideprotectedvirtual

Get velocity change due to the uint impulse.

Implements dart::constraint::ConstraintBase.

◆ isActive()

bool dart::constraint::JointConstraint::isActive ( ) const
overrideprotectedvirtual

Return true if this constraint is active.

Implements dart::constraint::ConstraintBase.

◆ setConstraintForceMixing()

void dart::constraint::JointConstraint::setConstraintForceMixing ( double  cfm)
static

Set global constraint force mixing parameter.

◆ setErrorAllowance()

void dart::constraint::JointConstraint::setErrorAllowance ( double  allowance)
static

Set global error reduction parameter.

◆ setErrorReductionParameter()

void dart::constraint::JointConstraint::setErrorReductionParameter ( double  erp)
static

Set global error reduction parameter.

◆ setMaxErrorReductionVelocity()

void dart::constraint::JointConstraint::setMaxErrorReductionVelocity ( double  erv)
static

Set global error reduction parameter.

◆ unexcite()

void dart::constraint::JointConstraint::unexcite ( )
overrideprotectedvirtual

Unexcite the constraint.

Implements dart::constraint::ConstraintBase.

◆ uniteSkeletons()

void dart::constraint::ConstraintBase::uniteSkeletons ( )
virtualinherited

◆ update()

void dart::constraint::JointConstraint::update ( )
overrideprotectedvirtual

Update constraint using updated Skeleton's states.

Implements dart::constraint::ConstraintBase.

Friends And Related Symbol Documentation

◆ ConstrainedGroup

friend class ConstrainedGroup
friend

◆ ConstraintSolver

friend class ConstraintSolver
friend

Member Data Documentation

◆ mActive

Eigen::Matrix<bool, 6, 1> dart::constraint::JointConstraint::mActive
private

Whether any of the joint contraint is active of each joint.

◆ mAppliedImpulseIndex

std::size_t dart::constraint::JointConstraint::mAppliedImpulseIndex
private

Index of applied impulse.

◆ mBodyNode

dynamics::BodyNode* dart::constraint::JointConstraint::mBodyNode
private

The child BodyNode of the Joint that this constraint is associated with.

◆ mConstraintForceMixing

double dart::constraint::JointConstraint::mConstraintForceMixing = 1e-9
staticprivate

Global constraint force mixing parameter in the range of [1e-9, 1].

The default is 1e-5

See also
http://www.ode.org/ode-latest-userguide.html#sec_3_8_0

◆ mDesiredVelocityChange

Eigen::Matrix<double, 6, 1> dart::constraint::JointConstraint::mDesiredVelocityChange
private

The desired delta velocity to satisfy the joint limit constraint.

◆ mDim

std::size_t dart::constraint::ConstraintBase::mDim
protectedinherited

Dimension of constraint.

◆ mErrorAllowance

double dart::constraint::JointConstraint::mErrorAllowance = 0.0
staticprivate

Global constraint error allowance.

◆ mErrorReductionParameter

double dart::constraint::JointConstraint::mErrorReductionParameter = 0.01
staticprivate

Global constraint error redection parameter in the range of [0, 1].

The default is 0.01.

◆ mImpulseLowerBound

Eigen::Matrix<double, 6, 1> dart::constraint::JointConstraint::mImpulseLowerBound
private

Lower limit of the constraint impulse.

◆ mImpulseUpperBound

Eigen::Matrix<double, 6, 1> dart::constraint::JointConstraint::mImpulseUpperBound
private

Upper limit of the constraint impulse.

◆ mJoint

dynamics::Joint* dart::constraint::JointConstraint::mJoint
private

The Joint that this constraint is associated with.

◆ mLifeTime

Eigen::Matrix<std::size_t, 6, 1> dart::constraint::JointConstraint::mLifeTime
private

Life time of constraint of each DOF.

◆ mMaxErrorReductionVelocity

double dart::constraint::JointConstraint::mMaxErrorReductionVelocity = 1e+1
staticprivate

Maximum error reduction velocity.

◆ mOldX

Eigen::Matrix<double, 6, 1> dart::constraint::JointConstraint::mOldX
private

Constraint impulse of the previous step.