Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::internal_forces::muscles::Muscle Class Referenceabstract

Base class of all muscle. More...

#include <Muscle.h>

Inheritance diagram for BIORBD_NAMESPACE::internal_forces::muscles::Muscle:
BIORBD_NAMESPACE::internal_forces::Compound BIORBD_NAMESPACE::internal_forces::muscles::HillType BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator BIORBD_NAMESPACE::internal_forces::muscles::HillDeGrooteType BIORBD_NAMESPACE::internal_forces::muscles::HillThelenType BIORBD_NAMESPACE::internal_forces::muscles::HillDeGrooteActiveOnlyType BIORBD_NAMESPACE::internal_forces::muscles::HillDeGrooteTypeFatigable BIORBD_NAMESPACE::internal_forces::muscles::HillThelenActiveOnlyType BIORBD_NAMESPACE::internal_forces::muscles::HillThelenTypeFatigable

Public Member Functions

 Muscle ()
 Construct a muscle.
 Muscle (const utils::String &name, const internal_forces::muscles::MuscleGeometry &position, const Characteristics &characteristics)
 Construct a muscle.
 Muscle (const utils::String &name, const internal_forces::muscles::MuscleGeometry &position, const Characteristics &characteristics, const State &emg)
 Construct a muscle.
 Muscle (const utils::String &name, const internal_forces::muscles::MuscleGeometry &position, const Characteristics &characteristics, const internal_forces::PathModifiers &pathModifiers)
 Construct a muscle.
 Muscle (const utils::String &name, const internal_forces::muscles::MuscleGeometry &position, const Characteristics &characteristics, const internal_forces::PathModifiers &pathModifiers, const State &emg)
 Construct a muscle.
 Muscle (const Muscle &other)
 Construct a muscle from another muscle.
 Muscle (const std::shared_ptr< Muscle > other)
 Construct a muscle from another muscle.
virtual ~Muscle ()
 Destroy class properly.
void DeepCopy (const Muscle &other)
 Deep copy of a muscle in new muscle.
const utils::Scalar & length (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
 Get the length of the muscle.
const utils::Scalar & musculoTendonLength (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
 Return the musculo tendon length.
const utils::Scalar & velocity (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateMuscleParameters=true)
 Return the velocity of the muscle.
void updateOrientations (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
 Update the position of the origin and insertion positions of the muscle.
void updateOrientations (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot)
 Update the position of the origin and insertion nodes of the muscle.
void updateOrientations (std::vector< utils::Vector3d > &musclePointsInGlobal, utils::Matrix &jacoPointsInGlobal)
 Update by hand the position of the origin and insertion nodes of the muscle.
void updateOrientations (std::vector< utils::Vector3d > &musclePointsInGlobal, utils::Matrix &jacoPointsInGlobal, const rigidbody::GeneralizedVelocity &Qdot)
 Update by hand the position of the origin and insertion nodes of the muscle.
void setPosition (const internal_forces::muscles::MuscleGeometry &positions)
 Set the position of all the points attached to the muscle (0 being the origin).
const internal_forces::muscles::MuscleGeometry & position () const
 Return the position of all the points attached to the muscle (0 being the origin).
void setCharacteristics (const Characteristics &characteristics)
 Set the muscle characteristics.
Characteristics & characteristics () const
 Return the muscle characteristics.
const std::vector< utils::Vector3d > & musclesPointsInGlobal (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
 Return the muscle points in global reference frame.
const std::vector< utils::Vector3d > & musclesPointsInGlobal () const
 Return the previously computed muscle points in global reference frame.
void setForceIsoMax (const utils::Scalar &forceMax)
 Set the maximal isometric force.
void setState (const State &emg)
 Set the dynamic state.
const State & state () const
 Return the dynamic state.
State & state ()
 Return the dynamic state.
const utils::Scalar & activationDot (const State &state, bool alreadyNormalized=false) const
 Return the activation time derivative.
virtual const utils::Scalar & force (const State &emg)=0
 Computes and returns the forces norm from the EMG.
virtual const utils::Scalar & force (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const State &emg, bool updateMuscleParameters=true)=0
 Return the computed force norm from EMG.
virtual const utils::Scalar & force (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const State &emg, bool updateMuscleParameters=true)=0
 Return the computed force norm from EMG.
MUSCLE_TYPE type () const
 Return the type of the muscle.
Public Member Functions inherited from BIORBD_NAMESPACE::internal_forces::Compound
 Compound ()
 Construct muscle compound.
 Compound (const utils::String &name)
 Construct compound.
 Compound (const utils::String &name, const internal_forces::PathModifiers &pathModifiers)
 Construct compound.
 Compound (const Compound &other)
 Construct compound from another muscle.
 Compound (const std::shared_ptr< Compound > other)
 Construct compound from another compound.
virtual ~Compound ()
 Destroy class properly.
void DeepCopy (const Compound &other)
 Deep copy of a compound.
void setName (const utils::String &name)
 Set the name of a muscle.
const utils::String & name () const
 Return the name of the muscle.
const internal_forces::PathModifiers & pathModifier ()
 Return the path modifier.
void addPathObject (utils::Vector3d &wrap)
 Add a path modifier object.
virtual const utils::Scalar & force ()
 Return the last computed muscle force norm.

Protected Member Functions

virtual void computeForce (const State &emg)
 Computer the forces from a specific emg.
virtual utils::Scalar getForceFromActivation (const State &emg)=0
 Function allowing modification of the way the multiplication is done in computeForce(EMG).
virtual void setType ()
 Set the type of muscle.

Protected Attributes

std::shared_ptr< MUSCLE_TYPE > m_type
 The type of the muscle.
std::shared_ptr< internal_forces::muscles::MuscleGeometry > m_position
 The geometry (position of the nodes) of the muscle.
std::shared_ptr< Characteristics > m_characteristics
 The muscle characteristics.
std::shared_ptr< State > m_state
 The dynamic state.
std::shared_ptr< utils::Scalar > m_muscleLength
 muscle tendon length
Protected Attributes inherited from BIORBD_NAMESPACE::internal_forces::Compound
std::shared_ptr< utils::String > m_name
 The name of the muscle.
std::shared_ptr< internal_forces::PathModifiers > m_pathChanger
 The set of path modifiers.
std::shared_ptr< utils::Scalar > m_force
 The last computed force.

Detailed Description

Base class of all muscle.

Definition at line 27 of file Muscle.h.

Constructor & Destructor Documentation

◆ Muscle() [1/7]

internal_forces::muscles::Muscle::Muscle ( )

Construct a muscle.

Definition at line 19 of file Muscle.cpp.

◆ Muscle() [2/7]

internal_forces::muscles::Muscle::Muscle ( const utils::String & name,
const internal_forces::muscles::MuscleGeometry & position,
const Characteristics & characteristics )

Construct a muscle.

Parameters
nameName of the muscle
positionPosition of the origin/insertion
characteristicsMuscle characteristics from an initial state

Definition at line 31 of file Muscle.cpp.

◆ Muscle() [3/7]

internal_forces::muscles::Muscle::Muscle ( const utils::String & name,
const internal_forces::muscles::MuscleGeometry & position,
const Characteristics & characteristics,
const State & emg )

Construct a muscle.

Parameters
nameName of the muscle
positionPosition of the origin/insertion
characteristicsMuscle characteristics from an initial state
emgDynamic state

Definition at line 46 of file Muscle.cpp.

◆ Muscle() [4/7]

internal_forces::muscles::Muscle::Muscle ( const utils::String & name,
const internal_forces::muscles::MuscleGeometry & position,
const Characteristics & characteristics,
const internal_forces::PathModifiers & pathModifiers )

Construct a muscle.

Parameters
nameName of the muscle
positionPosition of the origin/insertion
characteristicsMuscle characteristics from an initial state
pathModifiersThe path modifiers

Definition at line 64 of file Muscle.cpp.

◆ Muscle() [5/7]

internal_forces::muscles::Muscle::Muscle ( const utils::String & name,
const internal_forces::muscles::MuscleGeometry & position,
const Characteristics & characteristics,
const internal_forces::PathModifiers & pathModifiers,
const State & emg )

Construct a muscle.

Parameters
nameName of the muscle
positionPosition of the origin/insertion
characteristicsMuscle characteristics from an initial state
pathModifiersThe path modifier
emgThe dynamic state

Definition at line 95 of file Muscle.cpp.

◆ Muscle() [6/7]

internal_forces::muscles::Muscle::Muscle ( const Muscle & other)

Construct a muscle from another muscle.

Parameters
otherThe other muscle

Definition at line 80 of file Muscle.cpp.

◆ Muscle() [7/7]

internal_forces::muscles::Muscle::Muscle ( const std::shared_ptr< Muscle > other)

Construct a muscle from another muscle.

Parameters
otherThe other muscle

Definition at line 88 of file Muscle.cpp.

◆ ~Muscle()

internal_forces::muscles::Muscle::~Muscle ( )
virtual

Destroy class properly.

Definition at line 116 of file Muscle.cpp.

Member Function Documentation

◆ activationDot()

const utils::Scalar & internal_forces::muscles::Muscle::activationDot ( const State & state,
bool alreadyNormalized = false ) const

Return the activation time derivative.

Parameters
stateThe dynamic state
alreadyNormalizedIf the emg is already normalized
Returns
The activation time derivative

Definition at line 209 of file Muscle.cpp.

◆ characteristics()

internal_forces::muscles::Characteristics & internal_forces::muscles::Muscle::characteristics ( ) const

Return the muscle characteristics.

Returns
The muscle characteristics

Definition at line 254 of file Muscle.cpp.

◆ computeForce()

void internal_forces::muscles::Muscle::computeForce ( const State & emg)
protectedvirtual

Computer the forces from a specific emg.

Parameters
emgEMG data

Definition at line 222 of file Muscle.cpp.

◆ DeepCopy()

void internal_forces::muscles::Muscle::DeepCopy ( const Muscle & other)

Deep copy of a muscle in new muscle.

Parameters
otherThe muscle to copy

Definition at line 120 of file Muscle.cpp.

◆ force() [1/3]

virtual const utils::Scalar & BIORBD_NAMESPACE::internal_forces::muscles::Muscle::force ( const State & emg)
pure virtual

Computes and returns the forces norm from the EMG.

Parameters
emgEMG data
Returns
The computed forces from the EMG

Implemented in BIORBD_NAMESPACE::internal_forces::muscles::HillType, and BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator.

◆ force() [2/3]

virtual const utils::Scalar & BIORBD_NAMESPACE::internal_forces::muscles::Muscle::force ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
const State & emg,
bool updateMuscleParameters = true )
pure virtual

Return the computed force norm from EMG.

Parameters
updatedModelThe joint model previously updated to the proper level
QThe generalized coordinates of the model
QdotThe generalized velocities of the model
emgEMG data
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The computed force from EMG

Implemented in BIORBD_NAMESPACE::internal_forces::muscles::HillType, and BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator.

◆ force() [3/3]

virtual const utils::Scalar & BIORBD_NAMESPACE::internal_forces::muscles::Muscle::force ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const State & emg,
bool updateMuscleParameters = true )
pure virtual

Return the computed force norm from EMG.

Parameters
updatedModelThe joint model previously updated to the proper level
QThe generalized coordinates of the model
emgEMG data
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The computed force from EMG

Implemented in BIORBD_NAMESPACE::internal_forces::muscles::HillType, and BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator.

◆ getForceFromActivation()

virtual utils::Scalar BIORBD_NAMESPACE::internal_forces::muscles::Muscle::getForceFromActivation ( const State & emg)
protectedpure virtual

Function allowing modification of the way the multiplication is done in computeForce(EMG).

Parameters
emgThe EMG data
Returns
The force from activation

Implemented in BIORBD_NAMESPACE::internal_forces::muscles::HillType, and BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator.

◆ length()

const utils::Scalar & internal_forces::muscles::Muscle::length ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
bool updateMuscleParameters = true )

Get the length of the muscle.

Parameters
updatedModelThe joint model previously updated to the proper level
QThe generalized coordinates
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The length of the muscle

Definition at line 178 of file Muscle.cpp.

◆ musclesPointsInGlobal() [1/2]

const std::vector< utils::Vector3d > & internal_forces::muscles::Muscle::musclesPointsInGlobal ( ) const

Return the previously computed muscle points in global reference frame.

Returns
The muscle points in global reference frame

Definition at line 239 of file Muscle.cpp.

◆ musclesPointsInGlobal() [2/2]

const std::vector< utils::Vector3d > & internal_forces::muscles::Muscle::musclesPointsInGlobal ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
bool updateMuscleParameters = true )

Return the muscle points in global reference frame.

Parameters
updatedModelThe updated joint model (The user must ensure that the model is updated to the proper level)
QThe generalized coordinates
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The muscle points in global reference frame

Definition at line 228 of file Muscle.cpp.

◆ musculoTendonLength()

const utils::Scalar & internal_forces::muscles::Muscle::musculoTendonLength ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
bool updateMuscleParameters = true )

Return the musculo tendon length.

Parameters
updatedModelThe joint model previously updated to the proper level
QThe generalized coordinates
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The musculo tendon length

Definition at line 188 of file Muscle.cpp.

◆ position()

const internal_forces::muscles::MuscleGeometry & internal_forces::muscles::Muscle::position ( ) const

Return the position of all the points attached to the muscle (0 being the origin).

Returns
The positions

Definition at line 174 of file Muscle.cpp.

◆ setCharacteristics()

void internal_forces::muscles::Muscle::setCharacteristics ( const Characteristics & characteristics)

Set the muscle characteristics.

Parameters
characteristicsNew value of the muscle characteristics

Definition at line 248 of file Muscle.cpp.

◆ setForceIsoMax()

void internal_forces::muscles::Muscle::setForceIsoMax ( const utils::Scalar & forceMax)

Set the maximal isometric force.

Parameters
forceMaxThe force to set

Definition at line 243 of file Muscle.cpp.

◆ setPosition()

void internal_forces::muscles::Muscle::setPosition ( const internal_forces::muscles::MuscleGeometry & positions)

Set the position of all the points attached to the muscle (0 being the origin).

Parameters
positionsNew value of the position

Definition at line 169 of file Muscle.cpp.

◆ setState()

void internal_forces::muscles::Muscle::setState ( const State & emg)

Set the dynamic state.

Parameters
emgThe dynamic state value

Definition at line 259 of file Muscle.cpp.

◆ setType()

◆ state() [1/2]

internal_forces::muscles::State & internal_forces::muscles::Muscle::state ( )

Return the dynamic state.

Returns
The dynamic state

Definition at line 281 of file Muscle.cpp.

◆ state() [2/2]

const internal_forces::muscles::State & internal_forces::muscles::Muscle::state ( ) const

Return the dynamic state.

Returns
The dynamic state

Definition at line 277 of file Muscle.cpp.

◆ type()

internal_forces::muscles::MUSCLE_TYPE internal_forces::muscles::Muscle::type ( ) const

Return the type of the muscle.

Returns
The type of the muscle

Definition at line 129 of file Muscle.cpp.

◆ updateOrientations() [1/4]

void internal_forces::muscles::Muscle::updateOrientations ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q )

Update the position of the origin and insertion positions of the muscle.

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

Definition at line 138 of file Muscle.cpp.

◆ updateOrientations() [2/4]

void internal_forces::muscles::Muscle::updateOrientations ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot )

Update the position of the origin and insertion nodes of the muscle.

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

Definition at line 145 of file Muscle.cpp.

◆ updateOrientations() [3/4]

void internal_forces::muscles::Muscle::updateOrientations ( std::vector< utils::Vector3d > & musclePointsInGlobal,
utils::Matrix & jacoPointsInGlobal )

Update by hand the position of the origin and insertion nodes of the muscle.

Parameters
musclePointsInGlobalThe muscle points
jacoPointsInGlobalThe jacobian matrix

Definition at line 153 of file Muscle.cpp.

◆ updateOrientations() [4/4]

void internal_forces::muscles::Muscle::updateOrientations ( std::vector< utils::Vector3d > & musclePointsInGlobal,
utils::Matrix & jacoPointsInGlobal,
const rigidbody::GeneralizedVelocity & Qdot )

Update by hand the position of the origin and insertion nodes of the muscle.

Parameters
musclePointsInGlobalThe muscle points
jacoPointsInGlobalThe Jacobian matrix
QdotThe genelized velocities

Definition at line 160 of file Muscle.cpp.

◆ velocity()

const utils::Scalar & internal_forces::muscles::Muscle::velocity ( rigidbody::Joints & updatedModel,
const rigidbody::GeneralizedCoordinates & Q,
const rigidbody::GeneralizedVelocity & Qdot,
bool updateMuscleParameters = true )

Return the velocity of the muscle.

Parameters
updatedModelThe joint model previously updated to the proper level
QThe generalized coordinates
QdotThe generalized velocities
updateMuscleParametersUpdate the kinematic related parameters of the muscles
Returns
The velocity of the muscle

Definition at line 198 of file Muscle.cpp.

Member Data Documentation

◆ m_characteristics

std::shared_ptr<Characteristics> BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_characteristics
protected

The muscle characteristics.

Definition at line 347 of file Muscle.h.

◆ m_muscleLength

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_muscleLength
protected

muscle tendon length

Definition at line 349 of file Muscle.h.

◆ m_position

std::shared_ptr<internal_forces::muscles::MuscleGeometry> BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_position
protected

The geometry (position of the nodes) of the muscle.

Definition at line 345 of file Muscle.h.

◆ m_state

std::shared_ptr<State> BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_state
protected

The dynamic state.

Definition at line 348 of file Muscle.h.

◆ m_type

std::shared_ptr<MUSCLE_TYPE> BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_type
protected

The type of the muscle.

Definition at line 343 of file Muscle.h.


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