DART 6.12.2
Loading...
Searching...
No Matches
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::DynamicJointConstraint 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.
 
 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.
 
virtual ~BallJointConstraint ()
 Destructor.
 
const std::string & getType () const override
 Returns a string representing the constraint type.
 
dynamics::BodyNodegetBodyNode1 () const
 Get the first BodyNode that this constraint is associated with.
 
dynamics::BodyNodegetBodyNode2 () const
 Get the second BodyNode that this constraint is associated with.
 
std::size_t getDimension () const
 Return dimesion of this constranit.
 

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 *_vel, 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.
 
bool isActive () const override
 Return true if this constraint is active.
 
dynamics::SkeletonPtr getRootSkeleton () const override
 
void uniteSkeletons () override
 

Protected Attributes

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

Static Protected 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].
 

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.
 
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.
 
Eigen::Vector3d mViolation
 Position constraint violation expressed in body frame 1.
 
Eigen::Matrix< double, 3, 6 > mJacobian1
 Linear map between constraint space and Cartesian space for body1.
 
Eigen::Matrix< double, 3, 6 > mJacobian2
 Linear map between constraint space and Cartesian space for body2.
 
double mOldX [3]
 
std::size_t mAppliedImpulseIndex
 Index of applied impulse.
 

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]_body
[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]_body1
[in]_body2
[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::DynamicJointConstraint::getBodyNode1 ( ) const
inherited

Get the first BodyNode that this constraint is associated with.

◆ getBodyNode2()

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

Get the second BodyNode that this constraint is associated with.

◆ getConstraintForceMixing()

double dart::constraint::DynamicJointConstraint::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::DynamicJointConstraint::getErrorAllowance ( )
staticinherited

Get global error reduction parameter.

◆ getErrorReductionParameter()

double dart::constraint::DynamicJointConstraint::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::DynamicJointConstraint::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

◆ getStaticType()

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

Returns constraint type for this class.

◆ getType()

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

Returns a string representing the constraint type.

Reimplemented from dart::constraint::ConstraintBase.

◆ 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::DynamicJointConstraint::setConstraintForceMixing ( double  cfm)
staticinherited

Set global constraint force mixing parameter.

◆ setErrorAllowance()

void dart::constraint::DynamicJointConstraint::setErrorAllowance ( double  allowance)
staticinherited

Set global error reduction parameter.

◆ setErrorReductionParameter()

void dart::constraint::DynamicJointConstraint::setErrorReductionParameter ( double  erp)
staticinherited

Set global error reduction parameter.

◆ setMaxErrorReductionVelocity()

void dart::constraint::DynamicJointConstraint::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::DynamicJointConstraint::mBodyNode1
protectedinherited

First body node.

◆ mBodyNode2

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

Second body node.

◆ mConstraintForceMixing

double dart::constraint::DynamicJointConstraint::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::DynamicJointConstraint::mErrorAllowance = 0.0
staticprotectedinherited

Global constraint error allowance.

◆ mErrorReductionParameter

double dart::constraint::DynamicJointConstraint::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::DynamicJointConstraint::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.