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

Class Geometry of the muscle. More...

#include <Geometry.h>

Inheritance diagram for BIORBD_NAMESPACE::internal_forces::Geometry:
BIORBD_NAMESPACE::internal_forces::muscles::MuscleGeometry

Public Member Functions

 Geometry ()
 Construct geometry.
 Geometry (const utils::Vector3d &origin, const utils::Vector3d &insertion)
 Construct geometry.
Geometry DeepCopy () const
 Deep copy of a geometry.
void DeepCopy (const Geometry &other)
 Deep copy of a geometry from another geometry.
void updateKinematics (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates *Q=nullptr, const rigidbody::GeneralizedVelocity *Qdot=nullptr)
 Updates the position and dynamic elements of the muscles.
void updateKinematics (rigidbody::Joints &updatedModel, internal_forces::PathModifiers &pathModifiers, const rigidbody::GeneralizedCoordinates *Q=nullptr, const rigidbody::GeneralizedVelocity *Qdot=nullptr)
 Updates the position and dynamic elements of the muscles.
void updateKinematics (std::vector< utils::Vector3d > &musclePointsInGlobal, utils::Matrix &jacoPointsInGlobal, const rigidbody::GeneralizedVelocity *Qdot=nullptr)
 Updates the position and dynamic elements of the muscles by hand.
void setOrigin (const utils::Vector3d &position)
 Set the origin position in the local reference frame of the muscle.
const utils::Vector3d & originInLocal () const
 Return the origin position.
void setInsertionInLocal (const utils::Vector3d &position)
 Set the insertion position.
const utils::Vector3d & insertionInLocal () const
 Return the insertion position.
const utils::Vector3d & originInGlobal () const
 Return the origin position in the global reference.
const utils::Vector3d & insertionInGlobal () const
 Return the insertion position in the global reference.
const std::vector< utils::Vector3d > & pointsInGlobal () const
 Return the muscles points in the global reference.
const utils::Scalar & length () const
 Return the previously computed muscle length.
const utils::Scalar & velocity () const
 Return the previously computed velocity.
const utils::Matrix & jacobian () const
 Return the previously computed muscle jacobian.
utils::Matrix jacobianOrigin () const
 Return the gradient of the jacobian for the origin node.
utils::Matrix jacobianInsertion () const
 Return the gradient of the jacobian for the insertion node.
utils::Matrix jacobian (size_t idxViaPoint) const
 Return the gradient of the jacobian for the via specified node.
const utils::Matrix & jacobianLength () const
 Return the jacobian length of the muscle.

Protected Member Functions

void _updateKinematics (const rigidbody::GeneralizedVelocity *Qdot, internal_forces::PathModifiers *pathModifiers=nullptr)
 Actual function that implements the update of the kinematics.
const utils::Vector3d & originInGlobal (rigidbody::Joints &model, const rigidbody::GeneralizedCoordinates &Q)
 Updates the kinematics and return the position of the origin node.
const utils::Vector3d & insertionInGlobal (rigidbody::Joints &model, const rigidbody::GeneralizedCoordinates &Q)
 Updates the kinematics and return the position of the insertion node.
void setPointsInGlobal (std::vector< utils::Vector3d > &ptsInGlobal)
 Set the muscle points in global.
void setPointsInGlobal (rigidbody::Joints &model, const rigidbody::GeneralizedCoordinates &Q, internal_forces::PathModifiers *pathModifiers=nullptr)
 Set the muscle points in global.
const utils::Scalar & length (internal_forces::PathModifiers *pathModifiers=nullptr)
 Update the kinematics, compute and return the muscle length.
const utils::Scalar & velocity (const rigidbody::GeneralizedVelocity &Qdot)
 Update the kinematics, compute and return the muscle velocity assuming not via points nor wrapping objects.
void setJacobianDimension (rigidbody::Joints &model)
 Set the jacobian dimensions.
void jacobian (const utils::Matrix &jaco)
 Force a jacobian computed from the user.
void jacobian (rigidbody::Joints &model, const rigidbody::GeneralizedCoordinates &Q)
 Compute the jacobian.
void computeJacobianLength ()
 Compute the muscle length jacobian.

Protected Attributes

std::shared_ptr< utils::Vector3d > m_origin
 Origin node.
std::shared_ptr< utils::Vector3d > m_insertion
 Insertion node.
std::shared_ptr< utils::Vector3d > m_originInGlobal
 Position of the origin in the global reference.
std::shared_ptr< utils::Vector3d > m_insertionInGlobal
std::shared_ptr< std::vector< utils::Vector3d > > m_pointsInGlobal
 Position of all the points in the global reference.
std::shared_ptr< std::vector< utils::Vector3d > > m_pointsInLocal
 Position of all the points in local.
std::shared_ptr< utils::Matrix > m_jacobian
 The jacobian matrix.
std::shared_ptr< utils::Matrix > m_jacobianLength
 The muscle length jacobian.
std::shared_ptr< utils::Scalar > m_length
 length
std::shared_ptr< utils::Scalar > m_velocity
 Velocity of the muscular elongation.
std::shared_ptr< bool > m_isGeometryComputed
std::shared_ptr< bool > m_isVelocityComputed
std::shared_ptr< bool > m_posAndJacoWereForced

Detailed Description

Class Geometry of the muscle.

Definition at line 31 of file Geometry.h.

Constructor & Destructor Documentation

◆ Geometry() [1/2]

internal_forces::Geometry::Geometry ( )

Construct geometry.

Definition at line 22 of file Geometry.cpp.

◆ Geometry() [2/2]

internal_forces::Geometry::Geometry ( const utils::Vector3d & origin,
const utils::Vector3d & insertion )

Construct geometry.

Parameters
originThe origin node of the muscle
insertionThe insertion node of the muscle

Definition at line 39 of file Geometry.cpp.

Member Function Documentation

◆ _updateKinematics()

void internal_forces::Geometry::_updateKinematics ( const rigidbody::GeneralizedVelocity * Qdot,
internal_forces::PathModifiers * pathModifiers = nullptr )
protected

Actual function that implements the update of the kinematics.

Parameters
QdotThe generalized velocities
pathModifiersThe set of path modifiers

Definition at line 236 of file Geometry.cpp.

◆ computeJacobianLength()

void internal_forces::Geometry::computeJacobianLength ( )
protected

Compute the muscle length jacobian.

Definition at line 444 of file Geometry.cpp.

◆ DeepCopy() [1/2]

internal_forces::Geometry internal_forces::Geometry::DeepCopy ( ) const

Deep copy of a geometry.

Returns
A deep copy of a geometry

Definition at line 58 of file Geometry.cpp.

◆ DeepCopy() [2/2]

void internal_forces::Geometry::DeepCopy ( const Geometry & other)

Deep copy of a geometry from another geometry.

Parameters
otherThe geometry to copy

Definition at line 64 of file Geometry.cpp.

◆ insertionInGlobal() [1/2]

const utils::Vector3d & internal_forces::Geometry::insertionInGlobal ( ) const

Return the insertion position in the global reference.

Returns
The insertion position in the global reference

Geometry (updateKin) must be computed at least once before calling

Definition at line 169 of file Geometry.cpp.

◆ insertionInGlobal() [2/2]

const utils::Vector3d & internal_forces::Geometry::insertionInGlobal ( rigidbody::Joints & model,
const rigidbody::GeneralizedCoordinates & Q )
protected

Updates the kinematics and return the position of the insertion node.

Parameters
modelThe joint model
QThe generalized coordinates of the model
Returns
The origin position in the global reference

Definition at line 262 of file Geometry.cpp.

◆ insertionInLocal()

const utils::Vector3d & internal_forces::Geometry::insertionInLocal ( ) const

Return the insertion position.

Returns
The insertion position

Definition at line 158 of file Geometry.cpp.

◆ jacobian() [1/4]

const utils::Matrix & internal_forces::Geometry::jacobian ( ) const

Return the previously computed muscle jacobian.

Returns
The muscle jacobian

Definition at line 201 of file Geometry.cpp.

◆ jacobian() [2/4]

void internal_forces::Geometry::jacobian ( const utils::Matrix & jaco)
protected

Force a jacobian computed from the user.

Parameters
jacoThe jacobian

Definition at line 421 of file Geometry.cpp.

◆ jacobian() [3/4]

void internal_forces::Geometry::jacobian ( rigidbody::Joints & model,
const rigidbody::GeneralizedCoordinates & Q )
protected

Compute the jacobian.

Parameters
modelThe joint model
QThe generalize coordinates

Definition at line 428 of file Geometry.cpp.

◆ jacobian() [4/4]

utils::Matrix internal_forces::Geometry::jacobian ( size_t idxViaPoint) const

Return the gradient of the jacobian for the via specified node.

Parameters
idxViaPointthe index of the via point (0 being the the origin)
Returns
The via point's node jacobian

Definition at line 219 of file Geometry.cpp.

◆ jacobianInsertion()

utils::Matrix internal_forces::Geometry::jacobianInsertion ( ) const

Return the gradient of the jacobian for the insertion node.

Returns
The insertion's node jacobian

Definition at line 213 of file Geometry.cpp.

◆ jacobianLength()

const utils::Matrix & internal_forces::Geometry::jacobianLength ( ) const

Return the jacobian length of the muscle.

Returns
The jacobian length

Definition at line 227 of file Geometry.cpp.

◆ jacobianOrigin()

utils::Matrix internal_forces::Geometry::jacobianOrigin ( ) const

Return the gradient of the jacobian for the origin node.

Returns
The origin's node jacobian

Definition at line 207 of file Geometry.cpp.

◆ length() [1/2]

const utils::Scalar & internal_forces::Geometry::length ( ) const

Return the previously computed muscle length.

Returns
The muscle lengh

Definition at line 186 of file Geometry.cpp.

◆ length() [2/2]

const utils::Scalar & internal_forces::Geometry::length ( internal_forces::PathModifiers * pathModifiers = nullptr)
protected

Update the kinematics, compute and return the muscle length.

Parameters
pathModifiersThe set of path modifiers
Returns
The muscle length

Definition at line 372 of file Geometry.cpp.

◆ originInGlobal() [1/2]

const utils::Vector3d & internal_forces::Geometry::originInGlobal ( ) const

Return the origin position in the global reference.

Returns
The origin position in the global reference

Geometry (updateKin) must be computed at least once before calling originInLocal()

Definition at line 163 of file Geometry.cpp.

◆ originInGlobal() [2/2]

const utils::Vector3d & internal_forces::Geometry::originInGlobal ( rigidbody::Joints & model,
const rigidbody::GeneralizedCoordinates & Q )
protected

Updates the kinematics and return the position of the origin node.

Parameters
modelThe joint model
QThe generalized coordinates of the model
Returns
The origin position in the global reference

Definition at line 253 of file Geometry.cpp.

◆ originInLocal()

const utils::Vector3d & internal_forces::Geometry::originInLocal ( ) const

Return the origin position.

Returns
The origin position

Definition at line 145 of file Geometry.cpp.

◆ pointsInGlobal()

const std::vector< utils::Vector3d > & internal_forces::Geometry::pointsInGlobal ( ) const

Return the muscles points in the global reference.

Returns
The muscle points in the global reference

Geometry (updateKin) must be computed at least once before calling. Return already computed via points

Definition at line 176 of file Geometry.cpp.

◆ setInsertionInLocal()

void internal_forces::Geometry::setInsertionInLocal ( const utils::Vector3d & position)

Set the insertion position.

Parameters
positionThe insertion position value to set

Definition at line 149 of file Geometry.cpp.

◆ setJacobianDimension()

void internal_forces::Geometry::setJacobianDimension ( rigidbody::Joints & model)
protected

Set the jacobian dimensions.

Parameters
modelThe joint model

Definition at line 416 of file Geometry.cpp.

◆ setOrigin()

void internal_forces::Geometry::setOrigin ( const utils::Vector3d & position)

Set the origin position in the local reference frame of the muscle.

Parameters
positionThe origin position to set

Definition at line 137 of file Geometry.cpp.

◆ setPointsInGlobal() [1/2]

void internal_forces::Geometry::setPointsInGlobal ( rigidbody::Joints & model,
const rigidbody::GeneralizedCoordinates & Q,
internal_forces::PathModifiers * pathModifiers = nullptr )
protected

Set the muscle points in global.

Parameters
modelThe joint model
QThe generalized coordinates of the model
pathModifiersThe set of path modifiers

Definition at line 282 of file Geometry.cpp.

◆ setPointsInGlobal() [2/2]

void internal_forces::Geometry::setPointsInGlobal ( std::vector< utils::Vector3d > & ptsInGlobal)
protected

Set the muscle points in global.

Parameters
ptsInGlobalThe new muscle points in global

Definition at line 271 of file Geometry.cpp.

◆ updateKinematics() [1/3]

void internal_forces::Geometry::updateKinematics ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates * Q = nullptr,
const rigidbody::GeneralizedVelocity * Qdot = nullptr )

Updates the position and dynamic elements of the muscles.

Parameters
updatedModelThe joint model updated to the proper kinematics level
QThe generalized coordinates of the joints (not needed if updateKin is less than 2)
QdotThe generalized velocities of the joints (not needed if updateKin is less than 2)

updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot

WARNING If one used updateKinematics providing the jacobian, using updateKinematics overrides this previously sent position and jacobian

Definition at line 88 of file Geometry.cpp.

◆ updateKinematics() [2/3]

void internal_forces::Geometry::updateKinematics ( rigidbody::Joints & updatedModel,
internal_forces::PathModifiers & pathModifiers,
const rigidbody::GeneralizedCoordinates * Q = nullptr,
const rigidbody::GeneralizedVelocity * Qdot = nullptr )

Updates the position and dynamic elements of the muscles.

Parameters
updatedModelThe joint model updated to the proper kinematics level
pathModifiersThe path modifiers
QThe generalized coordinates of the joints (not needed if updateKin is less than 2)
QdotThe generalized velocities of the joints (not needed if updateKin is less than 2)

updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot

WARNING If one used updateKinematics providing the jacobian, using updateKinematics overrides this previously sent position and jacobian

Definition at line 104 of file Geometry.cpp.

◆ updateKinematics() [3/3]

void internal_forces::Geometry::updateKinematics ( std::vector< utils::Vector3d > & musclePointsInGlobal,
utils::Matrix & jacoPointsInGlobal,
const rigidbody::GeneralizedVelocity * Qdot = nullptr )

Updates the position and dynamic elements of the muscles by hand.

Parameters
musclePointsInGlobalPosition of all the points in global
jacoPointsInGlobalPosition of all the Jacobian points in global
QdotThe generalized velocities of the joints

updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot

Definition at line 120 of file Geometry.cpp.

◆ velocity() [1/2]

const utils::Scalar & internal_forces::Geometry::velocity ( ) const

Return the previously computed velocity.

Returns
The computed velocity

Definition at line 193 of file Geometry.cpp.

◆ velocity() [2/2]

const utils::Scalar & internal_forces::Geometry::velocity ( const rigidbody::GeneralizedVelocity & Qdot)
protected

Update the kinematics, compute and return the muscle velocity assuming not via points nor wrapping objects.

Parameters
QdotThe generalized velocities
Returns
The muscle velocity

Definition at line 409 of file Geometry.cpp.

Member Data Documentation

◆ m_insertion

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::Geometry::m_insertion
protected

Insertion node.

Definition at line 297 of file Geometry.h.

◆ m_insertionInGlobal

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::Geometry::m_insertionInGlobal
protected

Position of the insertion node in the global reference

Definition at line 302 of file Geometry.h.

◆ m_isGeometryComputed

std::shared_ptr<bool> BIORBD_NAMESPACE::internal_forces::Geometry::m_isGeometryComputed
protected

To know if the geometry was computed at least once

Definition at line 316 of file Geometry.h.

◆ m_isVelocityComputed

std::shared_ptr<bool> BIORBD_NAMESPACE::internal_forces::Geometry::m_isVelocityComputed
protected

To know if the velocity was computed in the last update

Definition at line 318 of file Geometry.h.

◆ m_jacobian

std::shared_ptr<utils::Matrix> BIORBD_NAMESPACE::internal_forces::Geometry::m_jacobian
protected

The jacobian matrix.

Definition at line 308 of file Geometry.h.

◆ m_jacobianLength

std::shared_ptr<utils::Matrix> BIORBD_NAMESPACE::internal_forces::Geometry::m_jacobianLength
protected

The muscle length jacobian.

Definition at line 310 of file Geometry.h.

◆ m_length

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::Geometry::m_length
protected

length

Definition at line 312 of file Geometry.h.

◆ m_origin

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::Geometry::m_origin
protected

Origin node.

Definition at line 296 of file Geometry.h.

◆ m_originInGlobal

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::Geometry::m_originInGlobal
protected

Position of the origin in the global reference.

Definition at line 300 of file Geometry.h.

◆ m_pointsInGlobal

std::shared_ptr<std::vector<utils::Vector3d> > BIORBD_NAMESPACE::internal_forces::Geometry::m_pointsInGlobal
protected

Position of all the points in the global reference.

Definition at line 305 of file Geometry.h.

◆ m_pointsInLocal

std::shared_ptr<std::vector<utils::Vector3d> > BIORBD_NAMESPACE::internal_forces::Geometry::m_pointsInLocal
protected

Position of all the points in local.

Definition at line 307 of file Geometry.h.

◆ m_posAndJacoWereForced

std::shared_ptr<bool> BIORBD_NAMESPACE::internal_forces::Geometry::m_posAndJacoWereForced
protected

To know if the override was used on the muscle position and the Jacobian

Definition at line 321 of file Geometry.h.

◆ m_velocity

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::Geometry::m_velocity
protected

Velocity of the muscular elongation.

Definition at line 314 of file Geometry.h.


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