DART  6.6.2
dart::constraint::BallJointConstraint Class Reference

BallJointConstraint represents ball joint constraint between a body and the world or between two bodies. More...

#include <BallJointConstraint.hpp>

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

Public Member Functions

 BallJointConstraint (dynamics::BodyNode *_body, const Eigen::Vector3d &_jointPos)
 Constructor that takes one body and the joint position in the world frame. More...
 
 BallJointConstraint (dynamics::BodyNode *_body1, dynamics::BodyNode *_body2, const Eigen::Vector3d &_jointPos)
 Constructor that takes two bodies and the joint position in the frame of _body1. More...
 
virtual ~BallJointConstraint ()
 Destructor. More...
 
dynamics::BodyNodegetBodyNode1 () const
 Get the first BodyNode that this constraint is associated with. More...
 
dynamics::BodyNodegetBodyNode2 () const
 Get the second BodyNode that this constraint is associated with. More...
 
std::size_t getDimension () const
 Return dimesion of this constranit. More...
 

Static Public Member Functions

static void setErrorAllowance (double _allowance)
 Set global error reduction parameter. More...
 
static double getErrorAllowance ()
 Get global error reduction parameter. More...
 
static void setErrorReductionParameter (double _erp)
 Set global error reduction parameter. More...
 
static double getErrorReductionParameter ()
 Get global error reduction parameter. More...
 
static void setMaxErrorReductionVelocity (double _erv)
 Set global error reduction parameter. More...
 
static double getMaxErrorReductionVelocity ()
 Get global error reduction parameter. More...
 
static void setConstraintForceMixing (double _cfm)
 Set global constraint force mixing parameter. More...
 
static double getConstraintForceMixing ()
 Get global constraint force mixing parameter. More...
 
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. More...
 
void getInformation (ConstraintInfo *_lcp) override
 Fill LCP variables. More...
 
void applyUnitImpulse (std::size_t _index) override
 Apply unit impulse to constraint space. More...
 
void getVelocityChange (double *_vel, bool _withCfm) override
 Get velocity change due to the uint impulse. More...
 
void excite () override
 Excite the constraint. More...
 
void unexcite () override
 Unexcite the constraint. More...
 
void applyImpulse (double *_lambda) override
 Apply computed constraint impulse to constrained skeletons. More...
 
bool isActive () const override
 Return true if this constraint is active. More...
 
dynamics::SkeletonPtr getRootSkeleton () const override
 
void uniteSkeletons () override
 

Protected Attributes

dynamics::BodyNodemBodyNode1
 First body node. More...
 
dynamics::BodyNodemBodyNode2
 Second body node. More...
 
std::size_t mDim
 Dimension of constraint. More...
 

Static Protected Attributes

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

Private Attributes

Eigen::Vector3d mOffset1
 Offset from the origin of body frame 1 to the ball joint position where the offset is expressed in body frame 1. More...
 
Eigen::Vector3d mOffset2
 Offset from the origin of body frame 2 to the ball joint position where the offset is expressed in body frame 2. More...
 
Eigen::Vector3d mViolation
 Position constraint violation expressed in body frame 1. More...
 
Eigen::Matrix< double, 3, 6 > mJacobian1
 Linear map between constraint space and Cartesian space for body1. More...
 
Eigen::Matrix< double, 3, 6 > mJacobian2
 Linear map between constraint space and Cartesian space for body2. More...
 
double mOldX [3]
 
std::size_t mAppliedImpulseIndex
 Index of applied impulse. More...
 

Detailed Description

BallJointConstraint represents ball joint constraint between a body and the world or between two bodies.

Constructor & Destructor Documentation

◆ BallJointConstraint() [1/2]

dart::constraint::BallJointConstraint::BallJointConstraint ( dynamics::BodyNode _body,
const Eigen::Vector3d &  _jointPos 
)

Constructor that takes one body and the joint position in the world frame.

Parameters
[in]_jointPosJoint position expressed in world frame

◆ BallJointConstraint() [2/2]

dart::constraint::BallJointConstraint::BallJointConstraint ( dynamics::BodyNode _body1,
dynamics::BodyNode _body2,
const Eigen::Vector3d &  _jointPos 
)

Constructor that takes two bodies and the joint position in the frame of _body1.

Parameters
[in]_jointPosJoint position expressed in world frame

◆ ~BallJointConstraint()

dart::constraint::BallJointConstraint::~BallJointConstraint ( )
virtual

Destructor.

Member Function Documentation

◆ applyImpulse()

void dart::constraint::BallJointConstraint::applyImpulse ( double *  _lambda)
overrideprotectedvirtual

Apply computed constraint impulse to constrained skeletons.

Implements dart::constraint::ConstraintBase.

◆ applyUnitImpulse()

void dart::constraint::BallJointConstraint::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::BallJointConstraint::excite ( )
overrideprotectedvirtual

Excite the constraint.

Implements dart::constraint::ConstraintBase.

◆ getBodyNode1()

dynamics::BodyNode * dart::constraint::JointConstraint::getBodyNode1 ( ) const
inherited

Get the first BodyNode that this constraint is associated with.

◆ getBodyNode2()

dynamics::BodyNode * dart::constraint::JointConstraint::getBodyNode2 ( ) const
inherited

Get the second BodyNode that this constraint is associated with.

◆ getConstraintForceMixing()

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

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 ( )
staticinherited

Get global error reduction parameter.

◆ getErrorReductionParameter()

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

Get global error reduction parameter.

◆ getInformation()

void dart::constraint::BallJointConstraint::getInformation ( ConstraintInfo _info)
overrideprotectedvirtual

Fill LCP variables.

Implements dart::constraint::ConstraintBase.

◆ getMaxErrorReductionVelocity()

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

Get global error reduction parameter.

◆ getRootSkeleton() [1/2]

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

◆ getRootSkeleton() [2/2]

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

◆ getVelocityChange()

void dart::constraint::BallJointConstraint::getVelocityChange ( double *  _vel,
bool  _withCfm 
)
overrideprotectedvirtual

Get velocity change due to the uint impulse.

Implements dart::constraint::ConstraintBase.

◆ isActive()

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

Return true if this constraint is active.

Implements dart::constraint::ConstraintBase.

◆ setConstraintForceMixing()

void dart::constraint::JointConstraint::setConstraintForceMixing ( double  _cfm)
staticinherited

Set global constraint force mixing parameter.

◆ setErrorAllowance()

void dart::constraint::JointConstraint::setErrorAllowance ( double  _allowance)
staticinherited

Set global error reduction parameter.

◆ setErrorReductionParameter()

void dart::constraint::JointConstraint::setErrorReductionParameter ( double  _erp)
staticinherited

Set global error reduction parameter.

◆ setMaxErrorReductionVelocity()

void dart::constraint::JointConstraint::setMaxErrorReductionVelocity ( double  _erv)
staticinherited

Set global error reduction parameter.

◆ unexcite()

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

Unexcite the constraint.

Implements dart::constraint::ConstraintBase.

◆ uniteSkeletons()

void dart::constraint::BallJointConstraint::uniteSkeletons ( )
overrideprotectedvirtual

Reimplemented from dart::constraint::ConstraintBase.

◆ update()

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

Update constraint using updated Skeleton's states.

Implements dart::constraint::ConstraintBase.

Member Data Documentation

◆ mAppliedImpulseIndex

std::size_t dart::constraint::BallJointConstraint::mAppliedImpulseIndex
private

Index of applied impulse.

◆ mBodyNode1

dynamics::BodyNode* dart::constraint::JointConstraint::mBodyNode1
protectedinherited

First body node.

◆ mBodyNode2

dynamics::BodyNode* dart::constraint::JointConstraint::mBodyNode2
protectedinherited

Second body node.

◆ mConstraintForceMixing

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

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

◆ mDim

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

Dimension of constraint.

◆ mErrorAllowance

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

Global constraint error allowance.

◆ mErrorReductionParameter

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

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

The default is 0.01.

◆ mJacobian1

Eigen::Matrix<double, 3, 6> dart::constraint::BallJointConstraint::mJacobian1
private

Linear map between constraint space and Cartesian space for body1.

◆ mJacobian2

Eigen::Matrix<double, 3, 6> dart::constraint::BallJointConstraint::mJacobian2
private

Linear map between constraint space and Cartesian space for body2.

◆ mMaxErrorReductionVelocity

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

Maximum error reduction velocity.

◆ mOffset1

Eigen::Vector3d dart::constraint::BallJointConstraint::mOffset1
private

Offset from the origin of body frame 1 to the ball joint position where the offset is expressed in body frame 1.

◆ mOffset2

Eigen::Vector3d dart::constraint::BallJointConstraint::mOffset2
private

Offset from the origin of body frame 2 to the ball joint position where the offset is expressed in body frame 2.

◆ mOldX

double dart::constraint::BallJointConstraint::mOldX[3]
private

◆ mViolation

Eigen::Vector3d dart::constraint::BallJointConstraint::mViolation
private

Position constraint violation expressed in body frame 1.