Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments Class Reference

Ligament holder. More...

#include <Ligaments.h>

Public Member Functions

 Ligaments ()
 Construct ligaments.
 Ligaments (const Ligaments &other)
 Construct ligaments from other ligaments.
virtual ~Ligaments ()
 Destroy class properly.
Ligaments DeepCopy () const
 Deep copy of ligaments.
void DeepCopy (const Ligaments &other)
 Deep copy of ligaments into another mucles.
std::vector< std::shared_ptr< Ligament > > & ligaments ()
 Returns all the ligaments. It sorts the ligaments by group.
const std::vector< std::shared_ptr< Ligament > > & ligaments () const
 Returns all the ligaments. It sorts the ligaments by group.
Ligament & ligament (size_t idx)
 Returns a specific ligament sorted by ligaments().
const Ligament & ligament (size_t idx) const
 Returns a specific ligament sorted by ligaments().
std::vector< utils::String > ligamentNames () const
 ligamentNames Return the names for all the ligament ordered by their respective name
rigidbody::GeneralizedTorque ligamentsJointTorque (const utils::Vector &F)
 Compute the ligament joint torque.
rigidbody::GeneralizedTorque ligamentsJointTorque (const utils::Vector &F, rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateLigamentKinematics=true)
 Compute the ligament joint torque.
rigidbody::GeneralizedTorque ligamentsJointTorque (const utils::Vector &F, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2)
 Compute the ligament joint torque.
rigidbody::GeneralizedTorque ligamentsJointTorque (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateLigamentKinematics=true)
 Compute the ligament joint torque.
rigidbody::GeneralizedTorque ligamentsJointTorque (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2)
 Compute the ligament joint torque.
utils::Matrix ligamentsLengthJacobian () const
 Return the previously computed ligament length jacobian.
utils::Matrix ligamentsLengthJacobian (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
 Compute and return the ligament length Jacobian.
utils::Matrix ligamentsLengthJacobian (const rigidbody::GeneralizedCoordinates &Q, int updateKin=2)
 Compute and return the ligament length Jacobian.
utils::Vector ligamentForces (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
 Compute and return the ligament forces.
utils::Vector ligamentForces (const rigidbody::GeneralizedCoordinates &Q, int updateKin=2)
 Compute and return the ligament forces.
utils::Vector ligamentForces (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateLigamentKinematics=true)
 Compute and return the ligament forces.
utils::Vector ligamentForces (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2)
 Compute and return the ligament forces.
size_t nbLigaments () const
 Return the total number of ligament.
int ligamentID (const utils::String &name)
 Return the ligament index.
void addLigament (const Ligament &ligament)
 Add a ligament to the set of ligaments.
void updateLigaments (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
 Update all the ligaments (positions, jacobian, etc.).
void updateLigaments (const rigidbody::GeneralizedCoordinates &Q, bool updateKin=true)
 Update all the ligaments (positions, jacobian, etc.).
void updateLigaments (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot)
 Update all the ligaments (positions, jacobian, etc.).
void updateLigaments (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateKin=true)
 Update all the ligaments (positions, jacobian, etc.).
void updateLigaments (rigidbody::Joints &updatedModel, std::vector< std::vector< utils::Vector3d > > &ligamentPointsInGlobal, std::vector< utils::Matrix > &jacoPointsInGlobal, const rigidbody::GeneralizedVelocity &Qdot)
 Update by hand all the ligaments (positions, jacobian, velocity, etc.).
void updateLigaments (std::vector< std::vector< utils::Vector3d > > &ligamentPointsInGlobal, std::vector< utils::Matrix > &jacoPointsInGlobal)
 Update by hand all the ligaments (positions, jacobian, velocity, etc.).

Protected Member Functions

utils::Matrix computeLigamentsLengthJacobian (const rigidbody::Joints &model) const
 Assemble the ligament length jacobian using the provided model.

Protected Attributes

std::shared_ptr< std::vector< std::shared_ptr< Ligament > > > m_ligaments
 Holder for ligament groups.

Detailed Description

Ligament holder.

Definition at line 31 of file Ligaments.h.

Constructor & Destructor Documentation

◆ Ligaments() [1/2]

internal_forces::ligaments::Ligaments::Ligaments ( )

Construct ligaments.

Definition at line 18 of file Ligaments.cpp.

◆ Ligaments() [2/2]

internal_forces::ligaments::Ligaments::Ligaments ( const Ligaments & other)

Construct ligaments from other ligaments.

Parameters
otherThe other ligaments

Definition at line 23 of file Ligaments.cpp.

◆ ~Ligaments()

internal_forces::ligaments::Ligaments::~Ligaments ( )
virtual

Destroy class properly.

Definition at line 27 of file Ligaments.cpp.

Member Function Documentation

◆ addLigament()

void internal_forces::ligaments::Ligaments::addLigament ( const Ligament & ligament)

Add a ligament to the set of ligaments.

Parameters
ligamentThe ligament to add

Definition at line 80 of file Ligaments.cpp.

◆ computeLigamentsLengthJacobian()

utils::Matrix internal_forces::ligaments::Ligaments::computeLigamentsLengthJacobian ( const rigidbody::Joints & model) const
protected

Assemble the ligament length jacobian using the provided model.

Parameters
modelThe joint model updated to the proper kinematics level
Returns
The ligament length jacobian

Definition at line 286 of file Ligaments.cpp.

◆ DeepCopy() [1/2]

internal_forces::ligaments::Ligaments internal_forces::ligaments::Ligaments::DeepCopy ( ) const

Deep copy of ligaments.

Returns
A deep copy of ligaments

Definition at line 30 of file Ligaments.cpp.

◆ DeepCopy() [2/2]

void internal_forces::ligaments::Ligaments::DeepCopy ( const Ligaments & other)

Deep copy of ligaments into another mucles.

Parameters
otherThe ligaments to copy

Definition at line 36 of file Ligaments.cpp.

◆ ligament() [1/2]

internal_forces::ligaments::Ligament & internal_forces::ligaments::Ligaments::ligament ( size_t idx)

Returns a specific ligament sorted by ligaments().

Parameters
idxThe ligament index
Returns
The ligament

Definition at line 67 of file Ligaments.cpp.

◆ ligament() [2/2]

const internal_forces::ligaments::Ligament & internal_forces::ligaments::Ligaments::ligament ( size_t idx) const

Returns a specific ligament sorted by ligaments().

Parameters
idxThe ligament index
Returns
The ligament

Definition at line 74 of file Ligaments.cpp.

◆ ligamentForces() [1/4]

utils::Vector internal_forces::ligaments::Ligaments::ligamentForces ( const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
int updateKin = 2 )

Compute and return the ligament forces.

Parameters
QThe generalized coordinates
QdotThe generalized velocities
updateKinIf the kinematics should be updated (0 => no update required, 1 => Only ligament parameters, 2 => Joints model and ligaments)
Returns
The ligament forces

Definition at line 255 of file Ligaments.cpp.

◆ ligamentForces() [2/4]

utils::Vector internal_forces::ligaments::Ligaments::ligamentForces ( const rigidbody::GeneralizedCoordinates & Q,
int updateKin = 2 )

Compute and return the ligament forces.

Parameters
QThe generalized coordinates
updateKinIf the kinematics should be updated (0 => no update required, 1 => Only ligament parameters, 2 => Joints model and ligaments)
Returns
The ligament forces

Definition at line 216 of file Ligaments.cpp.

◆ ligamentForces() [3/4]

utils::Vector internal_forces::ligaments::Ligaments::ligamentForces ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
bool updateLigamentKinematics = true )

Compute and return the ligament forces.

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
updateLigamentKinematicsIf the kinematics parameters of the ligaments should be updated
Returns
The ligament forces

Definition at line 201 of file Ligaments.cpp.

◆ ligamentForces() [4/4]

utils::Vector internal_forces::ligaments::Ligaments::ligamentForces ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
bool updateLigamentKinematics = true )

Compute and return the ligament forces.

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
QdotThe generalized velocities
updateLigamentKinematicsIf the kinematics parameters of the ligaments should be updated
Returns
The ligament forces

Definition at line 239 of file Ligaments.cpp.

◆ ligamentID()

int internal_forces::ligaments::Ligaments::ligamentID ( const utils::String & name)

Return the ligament index.

Parameters
nameThe name of the ligament
Returns
The ligament index

Definition at line 345 of file Ligaments.cpp.

◆ ligamentNames()

std::vector< utils::String > internal_forces::ligaments::Ligaments::ligamentNames ( ) const

ligamentNames Return the names for all the ligament ordered by their respective name

Returns
All the ligament names

Definition at line 107 of file Ligaments.cpp.

◆ ligaments() [1/2]

std::vector< std::shared_ptr< internal_forces::ligaments::Ligament > > & internal_forces::ligaments::Ligaments::ligaments ( )

Returns all the ligaments. It sorts the ligaments by group.

Returns
All the ligament

Definition at line 336 of file Ligaments.cpp.

◆ ligaments() [2/2]

const std::vector< std::shared_ptr< internal_forces::ligaments::Ligament > > & internal_forces::ligaments::Ligaments::ligaments ( ) const

Returns all the ligaments. It sorts the ligaments by group.

Returns
All the ligament

Definition at line 341 of file Ligaments.cpp.

◆ ligamentsJointTorque() [1/5]

rigidbody::GeneralizedTorque internal_forces::ligaments::Ligaments::ligamentsJointTorque ( const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
int updateKin = 2 )

Compute the ligament joint torque.

Parameters
QThe generalized coordinates
QdotThe generalized velocities
updateKinIf the kinematics should be updated (0 => no update required, 1 => Only ligament parameters, 2 => Joints model and ligaments)
Returns
The ligament joint torque

This function updates the ligaments and then performs the computation for the ligament joint torque is done from virtual power:

i.e. \(-J \times F\)

where \(J\) is the ligament lengths jacobian and \(F\) is the force vector of all the ligaments

Warning: This function assumes that ligaments are already updated (via updateligaments)

Definition at line 178 of file Ligaments.cpp.

◆ ligamentsJointTorque() [2/5]

rigidbody::GeneralizedTorque internal_forces::ligaments::Ligaments::ligamentsJointTorque ( const utils::Vector & F)

Compute the ligament joint torque.

Parameters
FThe force vector of all the ligaments
Returns
The ligament joint torque

The computation for the ligament joint torque is done from virtual power:

i.e. \(-J \times F\)

where \(J\) is the ligament lengths jacobian and \(F\) is the force vector of all the ligaments

Warning: This function assumes that ligaments are already updated (via updateligaments)

Definition at line 117 of file Ligaments.cpp.

◆ ligamentsJointTorque() [3/5]

rigidbody::GeneralizedTorque internal_forces::ligaments::Ligaments::ligamentsJointTorque ( const utils::Vector & F,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
int updateKin = 2 )

Compute the ligament joint torque.

Parameters
FThe force vector of all the ligaments
QThe generalized coordinates
QdotThe generalized velocities
updateKinIf the kinematics should be updated (0 => no update required, 1 => Only ligament parameters, 2 => Joints model and ligaments)
Returns
The ligament joint torque

This function updates the ligaments and then performs the computation for the ligament joint torque is done from virtual power:

i.e. \(-J \times F\)

where \(J\) is the ligament lengths jacobian and \(F\) is the force vector of all the ligaments

Warning: This function assumes that ligaments are already updated (via updateligaments)

Definition at line 141 of file Ligaments.cpp.

◆ ligamentsJointTorque() [4/5]

rigidbody::GeneralizedTorque internal_forces::ligaments::Ligaments::ligamentsJointTorque ( const utils::Vector & F,
rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
bool updateLigamentKinematics = true )

Compute the ligament joint torque.

Parameters
FThe force vector of all the ligaments
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
QdotThe generalized velocities
updateLigamentKinematicsIf the ligament kinematics parameters should be updated
Returns
The ligament joint torque

This function updates the ligaments and then performs the computation for the ligament joint torque is done from virtual power:

i.e. \(-J \times F\)

where \(J\) is the ligament lengths jacobian and \(F\) is the force vector of all the ligaments

Warning: This function assumes that ligaments are already updated (via updateligaments)

Definition at line 128 of file Ligaments.cpp.

◆ ligamentsJointTorque() [5/5]

rigidbody::GeneralizedTorque internal_forces::ligaments::Ligaments::ligamentsJointTorque ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
bool updateLigamentKinematics = true )

Compute the ligament joint torque.

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
QdotThe generalized velocities
updateLigamentKinematicsIf the ligament kinematics parameters should be updated
Returns
The ligament joint torque

This function updates the ligaments and then performs the computation for the ligament joint torque is done from virtual power:

i.e. \(-J \times F\)

where \(J\) is the ligament lengths jacobian and \(F\) is the force vector of all the ligaments

Warning: This function assumes that ligaments are already updated (via updateligaments)

Definition at line 167 of file Ligaments.cpp.

◆ ligamentsLengthJacobian() [1/3]

utils::Matrix internal_forces::ligaments::Ligaments::ligamentsLengthJacobian ( ) const

Return the previously computed ligament length jacobian.

Returns
The ligament length jacobian

Definition at line 278 of file Ligaments.cpp.

◆ ligamentsLengthJacobian() [2/3]

utils::Matrix internal_forces::ligaments::Ligaments::ligamentsLengthJacobian ( const rigidbody::GeneralizedCoordinates & Q,
int updateKin = 2 )

Compute and return the ligament length Jacobian.

Parameters
QThe generalized coordinates
updateKinIf the kinematics should be updated (0 => no update required, 1 => Only ligament parameters, 2 => Joints model and ligaments)
Returns
The ligament length Jacobian

Definition at line 309 of file Ligaments.cpp.

◆ ligamentsLengthJacobian() [3/3]

utils::Matrix internal_forces::ligaments::Ligaments::ligamentsLengthJacobian ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
bool updateLigamentKinematics = true )

Compute and return the ligament length Jacobian.

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
updateLigamentKinematicsIf the ligament kinematics parameters should be updated
Returns
The ligament length Jacobian

Definition at line 300 of file Ligaments.cpp.

◆ nbLigaments()

size_t internal_forces::ligaments::Ligaments::nbLigaments ( ) const

Return the total number of ligament.

Returns
The total number of ligaments

Definition at line 331 of file Ligaments.cpp.

◆ updateLigaments() [1/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( const rigidbody::GeneralizedCoordinates & Q,
bool updateKin = true )

Update all the ligaments (positions, jacobian, etc.).

Parameters
QThe generalized coordinates
updateKinIf the joint model should be updated

Definition at line 387 of file Ligaments.cpp.

◆ updateLigaments() [2/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
bool updateKin = true )

Update all the ligaments (positions, jacobian, etc.).

Parameters
QThe generalized coordinates
QdotThe generalized velocities
updateKinIf the joint model should be updated

Definition at line 364 of file Ligaments.cpp.

◆ updateLigaments() [3/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q )

Update all the ligaments (positions, jacobian, etc.).

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates

Definition at line 379 of file Ligaments.cpp.

◆ updateLigaments() [4/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot )

Update all the ligaments (positions, jacobian, etc.).

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates
QdotThe generalized velocities

Definition at line 355 of file Ligaments.cpp.

◆ updateLigaments() [5/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( rigidbody::Joints & updatedModel,
std::vector< std::vector< utils::Vector3d > > & ligamentPointsInGlobal,
std::vector< utils::Matrix > & jacoPointsInGlobal,
const rigidbody::GeneralizedVelocity & Qdot )

Update by hand all the ligaments (positions, jacobian, velocity, etc.).

Parameters
updatedModelThe joint model updated to the proper kinematics level
ligamentPointsInGlobalThe ligament points in global reference frame
jacoPointsInGlobalThe jacobian points in global reference frame
QdotThe generalized velocities

Definition at line 401 of file Ligaments.cpp.

◆ updateLigaments() [6/6]

void internal_forces::ligaments::Ligaments::updateLigaments ( std::vector< std::vector< utils::Vector3d > > & ligamentPointsInGlobal,
std::vector< utils::Matrix > & jacoPointsInGlobal )

Update by hand all the ligaments (positions, jacobian, velocity, etc.).

Parameters
ligamentPointsInGlobalThe ligament points in global reference frame
jacoPointsInGlobalThe jacobian points in global reference frame

Definition at line 412 of file Ligaments.cpp.

Member Data Documentation

◆ m_ligaments

std::shared_ptr<std::vector<std::shared_ptr<Ligament> > > BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::m_ligaments
protected

Holder for ligament groups.

Definition at line 394 of file Ligaments.h.


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