Biorbd
Public Member Functions | Protected Attributes | List of all members
biorbd::rigidbody::Contacts Class Reference

Class Contacts. More...

#include <Contacts.h>

Inheritance diagram for biorbd::rigidbody::Contacts:
biorbd::Model

Public Member Functions

 Contacts ()
 Construct contacts.
 
biorbd::rigidbody::Contacts DeepCopy () const
 Deep copy of contacts. More...
 
void DeepCopy (const biorbd::rigidbody::Contacts &other)
 Deep copy of contacts. More...
 
unsigned int AddConstraint (unsigned int body_id, const biorbd::utils::Vector3d &body_point, const biorbd::utils::Vector3d &world_normal, const biorbd::utils::String &name, double acc=0)
 Add a constraint to the constraint set. More...
 
unsigned int AddConstraint (unsigned int body_id, const biorbd::utils::Vector3d &body_point, const biorbd::utils::String &axis, const biorbd::utils::String &name, double acc=0)
 Add a constraint to the constraint set. More...
 
unsigned int AddLoopConstraint (unsigned int body_id_predecessor, unsigned int body_id_successor, const biorbd::utils::RotoTrans &X_predecessor, const biorbd::utils::RotoTrans &X_successor, const biorbd::utils::SpatialVector &axis, const biorbd::utils::String &name, bool enableStabilization=false, double stabilizationParam=0.1)
 Add a loop constraint to the constraint set. More...
 
virtual ~Contacts ()
 Destroy the class properly.
 
ContactsgetConstraints ()
 Get constraints. More...
 
bool hasContacts () const
 Check if there are contacts. More...
 
unsigned int nbContacts () const
 Return the number of contacts. More...
 
std::vector< biorbd::utils::StringcontactNames ()
 Return the name of the all contacts. More...
 
biorbd::utils::String contactName (unsigned int i)
 Return the name of the contact of a specified axis. More...
 
std::vector< biorbd::utils::Vector3dconstraintsInGlobal (const biorbd::rigidbody::GeneralizedCoordinates &Q, bool updateKin)
 Return the contraints position in the global reference. More...
 
biorbd::utils::Vector getForce () const
 Return the force acting on the contraint. More...
 

Protected Attributes

std::shared_ptr< unsigned int > m_nbreConstraint
 Number of constraints.
 
std::shared_ptr< bool > m_isBinded
 If the model is ready.
 

Detailed Description

Class Contacts.

Definition at line 28 of file Contacts.h.

Member Function Documentation

◆ AddConstraint() [1/2]

unsigned int biorbd::rigidbody::Contacts::AddConstraint ( unsigned int  body_id,
const biorbd::utils::Vector3d body_point,
const biorbd::utils::String axis,
const biorbd::utils::String name,
double  acc = 0 
)

Add a constraint to the constraint set.

Parameters
body_idThe body which is affected directly by the constraint
body_pointThe point that is constrained relative to the contact body
axisThe axis along which the constraint acts
nameA human readable name
accThe acceleration of the contact along the normal

Definition at line 46 of file Contacts.cpp.

◆ AddConstraint() [2/2]

unsigned int biorbd::rigidbody::Contacts::AddConstraint ( unsigned int  body_id,
const biorbd::utils::Vector3d body_point,
const biorbd::utils::Vector3d world_normal,
const biorbd::utils::String name,
double  acc = 0 
)

Add a constraint to the constraint set.

Parameters
body_idThe body which is affected directly by the constraint
body_pointThe point that is constrained relative to the contact body
world_normalThe normal along the constraint acts (in base coordinates)
nameA human readable name
accThe acceleration of the contact along the normal

Definition at line 37 of file Contacts.cpp.

◆ AddLoopConstraint()

unsigned int biorbd::rigidbody::Contacts::AddLoopConstraint ( unsigned int  body_id_predecessor,
unsigned int  body_id_successor,
const biorbd::utils::RotoTrans X_predecessor,
const biorbd::utils::RotoTrans X_successor,
const biorbd::utils::SpatialVector axis,
const biorbd::utils::String name,
bool  enableStabilization = false,
double  stabilizationParam = 0.1 
)

Add a loop constraint to the constraint set.

Parameters
body_id_predecessorThe identifier of the predecessor body
body_id_successorThe identifier of the successor body
X_predecessorA spatial transform localizing the constrained frames on the predecessor body, expressed with respect to the predecessor body frame
X_successorA spatial transform localizing the constrained frames on the successor body, expressed with respect to the successor body frame
axisA spatial vector indicating the axis along which the constraint acts
nameA human readable name
enableStabilizationWhether stabilization should be enabled or not
stabilizationParamThe value used for stabilization

Definition at line 71 of file Contacts.cpp.

◆ constraintsInGlobal()

std::vector< biorbd::utils::Vector3d > biorbd::rigidbody::Contacts::constraintsInGlobal ( const biorbd::rigidbody::GeneralizedCoordinates Q,
bool  updateKin 
)

Return the contraints position in the global reference.

Parameters
QThe generalized coordinates of the joints
updateKinWhether the kinematics of the model should be updated from Q
Returns
The contraints positions in the global reference

Definition at line 135 of file Contacts.cpp.

◆ contactName()

biorbd::utils::String biorbd::rigidbody::Contacts::contactName ( unsigned int  i)

Return the name of the contact of a specified axis.

Parameters
iThe axis
Returns
The name of the contact of a specified axis

Definition at line 128 of file Contacts.cpp.

◆ contactNames()

std::vector< biorbd::utils::String > biorbd::rigidbody::Contacts::contactNames ( )

Return the name of the all contacts.

Returns
The name of the contacts

Definition at line 119 of file Contacts.cpp.

◆ DeepCopy() [1/2]

biorbd::rigidbody::Contacts biorbd::rigidbody::Contacts::DeepCopy ( ) const

Deep copy of contacts.

Returns
Copy of contacts

Definition at line 22 of file Contacts.cpp.

◆ DeepCopy() [2/2]

void biorbd::rigidbody::Contacts::DeepCopy ( const biorbd::rigidbody::Contacts other)

Deep copy of contacts.

Parameters
otherThe contacts to copy

Definition at line 29 of file Contacts.cpp.

◆ getConstraints()

biorbd::rigidbody::Contacts & biorbd::rigidbody::Contacts::getConstraints ( )

Get constraints.

Returns
The constraints

Definition at line 95 of file Contacts.cpp.

◆ getForce()

biorbd::utils::Vector biorbd::rigidbody::Contacts::getForce ( ) const

Return the force acting on the contraint.

Returns
The force acting on the contraint

Definition at line 157 of file Contacts.cpp.

◆ hasContacts()

bool biorbd::rigidbody::Contacts::hasContacts ( ) const

Check if there are contacts.

Returns
The presence of contacts

Definition at line 106 of file Contacts.cpp.

◆ nbContacts()

unsigned int biorbd::rigidbody::Contacts::nbContacts ( ) const

Return the number of contacts.

Returns
The number of contacts

Definition at line 114 of file Contacts.cpp.


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