Marine systems simulation
CoRiBoDynamics::JointConstraint Class Reference

#include <JointConstraint.h>

+ Inheritance diagram for CoRiBoDynamics::JointConstraint:
+ Collaboration diagram for CoRiBoDynamics::JointConstraint:

Classes

struct  BallJointCoupling
 
struct  ExternalBallJointCoupling
 
struct  ExternalRigidCoupling
 
struct  HingeCoupling
 
struct  RigidCoupling
 

Public Member Functions

 JointConstraint (ConstraintSolver *solver)
 
virtual void ComputeConstraints (const double T, const double *const X)
 
void addBallJointCoupling (int elementA, int elementB, vec3 vectorA, vec3 vectorB, double Beta, double Alpha, double Gamma)
 
void addHingeCoupling (int elementA, int elementB, vec3 vectorA, vec3 vectorB, vec3 axisA, vec3 axisB, double Beta, double Alpha, double Gamma, double AlphaFriction, double GammaFriction)
 
void addRigidCoupling (int elementA, int elementB, vec3 vectorA, vec3 vectorB, double BetaN, double AlphaN, double GammaN, const Quat &nullAngle, const Quat &BetaM, const Quat &AlphaM, const Quat &GammaM)
 
int addExternalBallJointCoupling (int element, vec3 vector, double Beta, double Alpha, double Gamma, const double *Position, const double *Velocity)
 
void updateExternalBallJointCoupling (int ballJointCoupling, const double *Position, const double *Velocity)
 
vec3 getExternalBallJointCouplingForce (int ballJointCoupling)
 
int addExternalRigidCoupling (int element, vec3 vectorExternalObject, vec3 vectorInternalObject, double BetaN, double AlphaN, double GammaN, const Quat &nullAngle, const Quat &BetaM, const Quat &AlphaM, const Quat &GammaM, const double *Position, const double *Velocity, const double *Orientation, const double *AngularVelocity)
 
void updateExternalRigidCoupling (int rigidCoupling, const double *Position, const double *Velocity, const double *Orientation, const double *AngularVelocity)
 
vec6 getExternalRigidCouplingForce (int rigidCoupling)
 
vec3 getExternalBallJointCouplingForce (ExternalBallJointCoupling &Constraint)
 
vec6 getExternalRigidCouplingForce (ExternalRigidCoupling &Constraint)
 
- Public Member Functions inherited from CoRiBoDynamics::ConstraintSet
 ConstraintSet (ConstraintSolver *solver)
 
virtual void ComputeConstraints (const double T, const double *const X)=0
 

Protected Member Functions

void ComputeHingeCoupling (HingeCoupling &Constraint)
 
void ComputeBallJointCoupling (BallJointCoupling &Constraint)
 
void ComputeRigidCoupling (RigidCoupling &Constraint)
 
void ComputeExternalBallJointCoupling (ExternalBallJointCoupling &Constraint)
 
void ComputeExternalVaryingBallJointCoupling (ExternalBallJointCoupling &Constraint, double vector_length_changerate)
 
void ComputeExternalRigidCoupling (ExternalRigidCoupling &Constraint)
 
- Protected Member Functions inherited from CoRiBoDynamics::ConstraintSet
const std::vector< RigidElement * > & ElementVector ()
 
void addConstraintResultantForce (int element, const vec6 &Force)
 
const vec3 Acceleration (int element)
 
const vec3 AngularAcceleration (int element)
 
const vec6 SecondDerivatives (int element)
 
void addMatrix (int i, int j, const mat6 &M)
 

Static Protected Member Functions

static mat4 QuaternionConstraint_Jacobian (const Quat &q)
 
static mat43 Quaternion_Kinematics (const Quat &q)
 

Protected Attributes

std::vector< HingeCoupling,Eigen::aligned_allocator< HingeCoupling > > m_HingeCoupling
 
std::vector< BallJointCoupling,Eigen::aligned_allocator< BallJointCoupling > > m_BallJointCoupling
 BallJoint Coupling.
 
std::vector< RigidCoupling,Eigen::aligned_allocator< RigidCoupling > > m_RigidCoupling
 BallJoint Coupling.
 
std::vector< ExternalBallJointCoupling, Eigen::aligned_allocator< ExternalBallJointCoupling > > m_ExternalBallJointCoupling
 Rigid Coupling.
 
std::vector< ExternalRigidCoupling, Eigen::aligned_allocator< ExternalRigidCoupling > > m_ExternalRigidCoupling
 External Ball Joint Coupling.
 

Detailed Description

Author
Jorgen Haavind Jensen

Set of basic mechanical constraints e.g. ball joints and hinges.

Revision history:
Q3 2011 JHJ: Initial version.

Member Function Documentation

◆ addBallJointCoupling()

void CoRiBoDynamics::JointConstraint::addBallJointCoupling ( int  elementA,
int  elementB,
vec3  vectorA,
vec3  vectorB,
double  Beta,
double  Alpha,
double  Gamma 
)

Adds a ball joint constraint between element A and B. VectorA on element A is connected to vectorB on element B.

◆ addExternalBallJointCoupling()

int CoRiBoDynamics::JointConstraint::addExternalBallJointCoupling ( int  element,
vec3  vector,
double  Beta,
double  Alpha,
double  Gamma,
const double *  Position,
const double *  Velocity 
)

Adds an external ball joint constraint to #element. Connects the vector on #element to the supplied Position and Velocity. Note that the pointers to Position and Velocity must be persistent in memory. Returns a reference index to the constraint.

◆ addExternalRigidCoupling()

int CoRiBoDynamics::JointConstraint::addExternalRigidCoupling ( int  element,
vec3  vectorExternalObject,
vec3  vectorInternalObject,
double  BetaN,
double  AlphaN,
double  GammaN,
const Quat &  nullAngle,
const Quat &  BetaM,
const Quat &  AlphaM,
const Quat &  GammaM,
const double *  Position,
const double *  Velocity,
const double *  Orientation,
const double *  AngularVelocity 
)

Adds an external rigid constraint between #element Connects vectorInternalObject on #element to vectorExternalObject on the external object with the given position and orientation. Note that the pointers to Position, Velocity, Orientation and AngularVelocity must be persistent in memory. Returns a reference index to the constraint.

◆ addHingeCoupling()

void CoRiBoDynamics::JointConstraint::addHingeCoupling ( int  elementA,
int  elementB,
vec3  vectorA,
vec3  vectorB,
vec3  axisA,
vec3  axisB,
double  Beta,
double  Alpha,
double  Gamma,
double  AlphaFriction,
double  GammaFriction 
)

Adds a hinge constraint between element A and B. VectorA on element A is connected to vectorB on element B. The rotation direction of the hinge is defined by axisA and axisB. Both axis must be unit vectors. AlphaFriction and GammaFriction defines the linear friction coeffient of the hinge according to Cf = 2*AlphaFrictionGammaFriction.

◆ addRigidCoupling()

void CoRiBoDynamics::JointConstraint::addRigidCoupling ( int  elementA,
int  elementB,
vec3  vectorA,
vec3  vectorB,
double  BetaN,
double  AlphaN,
double  GammaN,
const Quat &  nullAngle,
const Quat &  BetaM,
const Quat &  AlphaM,
const Quat &  GammaM 
)

Adds a full rigid constraint between element A and B. VectorA on element A is connected to vectorB on element B. NullAngle defines the relative rotation between A and B. BetaN, AlphaN and GammaN defines the regulator parameters of the ball joint constraint, while BetaM, AlphaM and GammaM defines the orientation constraint.

◆ ComputeConstraints()

virtual void CoRiBoDynamics::JointConstraint::ComputeConstraints ( const double  T,
const double *const  X 
)
virtual

◆ getExternalBallJointCouplingForce()

vec3 CoRiBoDynamics::JointConstraint::getExternalBallJointCouplingForce ( int  ballJointCoupling)

Returns the current reaction force of the given ball joint coupling. Must be called after the ConstraintSolver has computed system accelerations.

◆ getExternalRigidCouplingForce()

vec6 CoRiBoDynamics::JointConstraint::getExternalRigidCouplingForce ( int  rigidCoupling)

Returns the current reaction force and torque of the given rigid coupling. Must be called after the ConstraintSolver has computed system accelerations.

◆ updateExternalBallJointCoupling()

void CoRiBoDynamics::JointConstraint::updateExternalBallJointCoupling ( int  ballJointCoupling,
const double *  Position,
const double *  Velocity 
)

Updates the pointers to Position and Velocity for the given ball joint coupling. Note that the pointers to Position and Velocity must be persistent in memory.

◆ updateExternalRigidCoupling()

void CoRiBoDynamics::JointConstraint::updateExternalRigidCoupling ( int  rigidCoupling,
const double *  Position,
const double *  Velocity,
const double *  Orientation,
const double *  AngularVelocity 
)

Updates the pointers to Position, Velocity, Orientation and AngularVelocity for the given r coupling. Note that the pointers must be persistent in memory.


The documentation for this class was generated from the following file: