Biorbd
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
biorbd::muscles::Muscle Class Referenceabstract

Base class of all muscle. More...

#include <Muscle.h>

Inheritance diagram for biorbd::muscles::Muscle:
biorbd::muscles::Compound biorbd::muscles::HillType biorbd::muscles::IdealizedActuator biorbd::muscles::HillThelenType biorbd::muscles::HillThelenTypeFatigable

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::shared_ptr< biorbd::muscles::Geometrym_position
 The position of all the nodes of the muscle (0 being the origin and last being insertion.
 
std::shared_ptr< biorbd::muscles::Characteristicsm_characteristics
 The muscle characteristics.
 
std::shared_ptr< biorbd::muscles::Statem_state
 The dynamic state.
 
- Protected Attributes inherited from biorbd::muscles::Compound
std::shared_ptr< biorbd::utils::Stringm_name
 The name of the muscle.
 
std::shared_ptr< biorbd::muscles::MUSCLE_TYPE > m_type
 The type of muscle.
 
std::shared_ptr< biorbd::muscles::PathModifiersm_pathChanger
 The set of path modifiers.
 
std::shared_ptr< biorbd::utils::Scalar > m_force
 The last computed force.
 

Detailed Description

Base class of all muscle.

Definition at line 22 of file Muscle.h.

Constructor & Destructor Documentation

◆ Muscle() [1/6]

biorbd::muscles::Muscle::Muscle ( const biorbd::utils::String name,
const biorbd::muscles::Geometry position,
const biorbd::muscles::Characteristics characteristics 
)

Construct a muscle.

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

Definition at line 24 of file Muscle.cpp.

◆ Muscle() [2/6]

biorbd::muscles::Muscle::Muscle ( const biorbd::utils::String name,
const biorbd::muscles::Geometry position,
const biorbd::muscles::Characteristics characteristics,
const biorbd::muscles::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 36 of file Muscle.cpp.

◆ Muscle() [3/6]

biorbd::muscles::Muscle::Muscle ( const biorbd::utils::String name,
const biorbd::muscles::Geometry position,
const biorbd::muscles::Characteristics characteristics,
const biorbd::muscles::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 49 of file Muscle.cpp.

◆ Muscle() [4/6]

biorbd::muscles::Muscle::Muscle ( const biorbd::utils::String name,
const biorbd::muscles::Geometry position,
const biorbd::muscles::Characteristics characteristics,
const biorbd::muscles::PathModifiers pathModifiers,
const biorbd::muscles::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 80 of file Muscle.cpp.

◆ Muscle() [5/6]

biorbd::muscles::Muscle::Muscle ( const biorbd::muscles::Muscle other)

Construct a muscle from another muscle.

Parameters
otherThe other muscle

Definition at line 62 of file Muscle.cpp.

◆ Muscle() [6/6]

biorbd::muscles::Muscle::Muscle ( const std::shared_ptr< biorbd::muscles::Muscle other)

Construct a muscle from another muscle.

Parameters
otherThe other muscle

Definition at line 71 of file Muscle.cpp.

Member Function Documentation

◆ activationDot()

const biorbd::utils::Scalar & biorbd::muscles::Muscle::activationDot ( const biorbd::muscles::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 189 of file Muscle.cpp.

◆ characteristics()

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

Return the muscle characteristics.

Returns
The muscle characteristics

Definition at line 232 of file Muscle.cpp.

◆ computeForce()

void biorbd::muscles::Muscle::computeForce ( const biorbd::muscles::State emg)
protectedvirtual

Computer the forces from a specific emg.

Parameters
emgEMG data

Definition at line 202 of file Muscle.cpp.

◆ DeepCopy()

void biorbd::muscles::Muscle::DeepCopy ( const biorbd::muscles::Muscle other)

Deep copy of a muscle in new muscle.

Parameters
otherThe muscle to copy

Definition at line 100 of file Muscle.cpp.

◆ getForceFromActivation()

virtual biorbd::utils::Scalar biorbd::muscles::Muscle::getForceFromActivation ( const biorbd::muscles::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::muscles::HillType, and biorbd::muscles::IdealizedActuator.

◆ length()

const biorbd::utils::Scalar & biorbd::muscles::Muscle::length ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
int  updateKin = 2 
)

Get the length of the muscle.

Parameters
modelThe joint model
QThe generalized coordinates
updateKinUpdate kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])
Returns
The length of the muscle

Definition at line 149 of file Muscle.cpp.

◆ musclesPointsInGlobal() [1/2]

const std::vector< biorbd::utils::Vector3d > & biorbd::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 216 of file Muscle.cpp.

◆ musclesPointsInGlobal() [2/2]

const std::vector< biorbd::utils::Vector3d > & biorbd::muscles::Muscle::musclesPointsInGlobal ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q 
)

Return the muscle points in global reference frame.

Parameters
modelThe joint model
QThe generalized coordinates
Returns
The muscle points in global reference frame

Definition at line 207 of file Muscle.cpp.

◆ musculoTendonLength()

const biorbd::utils::Scalar & biorbd::muscles::Muscle::musculoTendonLength ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
int  updateKin = 2 
)

Return the musculo tendon length.

Parameters
modelThe joint model
QThe generalized coordinates
updateKinUpdate kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])
Returns
The musculo tendon length

Definition at line 162 of file Muscle.cpp.

◆ position()

const biorbd::muscles::Geometry & biorbd::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 145 of file Muscle.cpp.

◆ setCharacteristics()

void biorbd::muscles::Muscle::setCharacteristics ( const biorbd::muscles::Characteristics characteristics)

Set the muscle characteristics.

Parameters
characteristicsNew value of the muscle characteristics

Definition at line 227 of file Muscle.cpp.

◆ setForceIsoMax()

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

Set the maximal isometric force.

Parameters
forceMaxThe force to set

Definition at line 221 of file Muscle.cpp.

◆ setPosition()

void biorbd::muscles::Muscle::setPosition ( const biorbd::muscles::Geometry 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 140 of file Muscle.cpp.

◆ setState()

void biorbd::muscles::Muscle::setState ( const biorbd::muscles::State emg)

Set the dynamic state.

Parameters
emgThe dynamic state value

Definition at line 238 of file Muscle.cpp.

◆ state() [1/2]

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

Return the dynamic state.

Returns
The dynamic state

Definition at line 258 of file Muscle.cpp.

◆ state() [2/2]

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

Return the dynamic state.

Returns
The dynamic state

Definition at line 254 of file Muscle.cpp.

◆ updateOrientations() [1/4]

void biorbd::muscles::Muscle::updateOrientations ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
const biorbd::rigidbody::GeneralizedVelocity Qdot,
int  updateKin = 2 
)

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

Parameters
modelThe joint model
QThe generalized coordinates
QdotThe generalized velocities
updateKinUpdate kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])

Definition at line 116 of file Muscle.cpp.

◆ updateOrientations() [2/4]

void biorbd::muscles::Muscle::updateOrientations ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
int  updateKin = 2 
)

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

Parameters
modelThe joint model
QThe generalized coordinates
updateKinUpdate kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])

Definition at line 108 of file Muscle.cpp.

◆ updateOrientations() [3/4]

void biorbd::muscles::Muscle::updateOrientations ( std::vector< biorbd::utils::Vector3d > &  musclePointsInGlobal,
biorbd::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 125 of file Muscle.cpp.

◆ updateOrientations() [4/4]

void biorbd::muscles::Muscle::updateOrientations ( std::vector< biorbd::utils::Vector3d > &  musclePointsInGlobal,
biorbd::utils::Matrix jacoPointsInGlobal,
const biorbd::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 131 of file Muscle.cpp.

◆ velocity()

const biorbd::utils::Scalar & biorbd::muscles::Muscle::velocity ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
const biorbd::rigidbody::GeneralizedVelocity Qdot,
bool  updateKin = true 
)

Return the velocity of the muscle.

Parameters
modelThe joint model
QThe generalized coordinates
QdotThe generalized velocities
updateKinUpdate kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])
Returns
The velocity of the muscle

Definition at line 175 of file Muscle.cpp.


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