Biorbd
|
Base class of all muscle. More...
#include <Muscle.h>
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::Geometry & | position () 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::Characteristics & | characteristics () 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::State & | state () const |
Return the dynamic state. More... | |
biorbd::muscles::State & | state () |
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... | |
![]() | |
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::String & | name () const |
Return the name of the muscle. More... | |
biorbd::muscles::MUSCLE_TYPE | type () const |
Return the type of the muscle. More... | |
const biorbd::muscles::PathModifiers & | pathModifier () |
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... | |
![]() | |
virtual void | setType ()=0 |
Set the type of muscle. | |
Protected Attributes | |
std::shared_ptr< biorbd::muscles::Geometry > | m_position |
The position of all the nodes of the muscle (0 being the origin and last being insertion. | |
std::shared_ptr< biorbd::muscles::Characteristics > | m_characteristics |
The muscle characteristics. | |
std::shared_ptr< biorbd::muscles::State > | m_state |
The dynamic state. | |
![]() | |
std::shared_ptr< biorbd::utils::String > | m_name |
The name of the muscle. | |
std::shared_ptr< biorbd::muscles::MUSCLE_TYPE > | m_type |
The type of muscle. | |
std::shared_ptr< biorbd::muscles::PathModifiers > | m_pathChanger |
The set of path modifiers. | |
std::shared_ptr< biorbd::utils::Scalar > | m_force |
The last computed force. | |
biorbd::muscles::Muscle::Muscle | ( | const biorbd::utils::String & | name, |
const biorbd::muscles::Geometry & | position, | ||
const biorbd::muscles::Characteristics & | characteristics | ||
) |
Construct a muscle.
name | Name of the muscle |
position | Position of the origin/insertion |
characteristics | Muscle characteristics from an initial state |
Definition at line 24 of file Muscle.cpp.
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.
name | Name of the muscle |
position | Position of the origin/insertion |
characteristics | Muscle characteristics from an initial state |
emg | Dynamic state |
Definition at line 36 of file Muscle.cpp.
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.
name | Name of the muscle |
position | Position of the origin/insertion |
characteristics | Muscle characteristics from an initial state |
pathModifiers | The path modifiers |
Definition at line 49 of file Muscle.cpp.
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.
name | Name of the muscle |
position | Position of the origin/insertion |
characteristics | Muscle characteristics from an initial state |
pathModifiers | The path modifier |
emg | The dynamic state |
Definition at line 80 of file Muscle.cpp.
biorbd::muscles::Muscle::Muscle | ( | const biorbd::muscles::Muscle & | other | ) |
Construct a muscle from another muscle.
other | The other muscle |
Definition at line 62 of file Muscle.cpp.
biorbd::muscles::Muscle::Muscle | ( | const std::shared_ptr< biorbd::muscles::Muscle > | other | ) |
Construct a muscle from another muscle.
other | The other muscle |
Definition at line 71 of file Muscle.cpp.
const biorbd::utils::Scalar & biorbd::muscles::Muscle::activationDot | ( | const biorbd::muscles::State & | state, |
bool | alreadyNormalized = false |
||
) | const |
Return the activation time derivative.
state | The dynamic state |
alreadyNormalized | If the emg is already normalized |
Definition at line 189 of file Muscle.cpp.
const biorbd::muscles::Characteristics & biorbd::muscles::Muscle::characteristics | ( | ) | const |
Return the muscle characteristics.
Definition at line 232 of file Muscle.cpp.
|
protectedvirtual |
Computer the forces from a specific emg.
emg | EMG data |
Definition at line 202 of file Muscle.cpp.
void biorbd::muscles::Muscle::DeepCopy | ( | const biorbd::muscles::Muscle & | other | ) |
Deep copy of a muscle in new muscle.
other | The muscle to copy |
Definition at line 100 of file Muscle.cpp.
|
protectedpure virtual |
Function allowing modification of the way the multiplication is done in computeForce(EMG)
emg | The EMG data |
Implemented in biorbd::muscles::HillType, and biorbd::muscles::IdealizedActuator.
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.
model | The joint model |
Q | The generalized coordinates |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 149 of file Muscle.cpp.
const std::vector< biorbd::utils::Vector3d > & biorbd::muscles::Muscle::musclesPointsInGlobal | ( | ) | const |
Return the previously computed muscle points in global reference frame.
Definition at line 216 of file Muscle.cpp.
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.
model | The joint model |
Q | The generalized coordinates |
Definition at line 207 of file Muscle.cpp.
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.
model | The joint model |
Q | The generalized coordinates |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 162 of file Muscle.cpp.
const biorbd::muscles::Geometry & biorbd::muscles::Muscle::position | ( | ) | const |
Return the position of all the points attached to the muscle (0 being the origin)
Definition at line 145 of file Muscle.cpp.
void biorbd::muscles::Muscle::setCharacteristics | ( | const biorbd::muscles::Characteristics & | characteristics | ) |
Set the muscle characteristics.
characteristics | New value of the muscle characteristics |
Definition at line 227 of file Muscle.cpp.
void biorbd::muscles::Muscle::setForceIsoMax | ( | const biorbd::utils::Scalar & | forceMax | ) |
Set the maximal isometric force.
forceMax | The force to set |
Definition at line 221 of file Muscle.cpp.
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)
positions | New value of the position |
Definition at line 140 of file Muscle.cpp.
void biorbd::muscles::Muscle::setState | ( | const biorbd::muscles::State & | emg | ) |
Set the dynamic state.
emg | The dynamic state value |
Definition at line 238 of file Muscle.cpp.
biorbd::muscles::State & biorbd::muscles::Muscle::state | ( | ) |
const biorbd::muscles::State & biorbd::muscles::Muscle::state | ( | ) | const |
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.
model | The joint model |
Q | The generalized coordinates |
Qdot | The generalized velocities |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 116 of file Muscle.cpp.
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.
model | The joint model |
Q | The generalized coordinates |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 108 of file Muscle.cpp.
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.
musclePointsInGlobal | The muscle points |
jacoPointsInGlobal | The jacobian matrix |
Definition at line 125 of file Muscle.cpp.
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.
musclePointsInGlobal | The muscle points |
jacoPointsInGlobal | The Jacobian matrix |
Qdot | The genelized velocities |
Definition at line 131 of file Muscle.cpp.
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.
model | The joint model |
Q | The generalized coordinates |
Qdot | The generalized velocities |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 175 of file Muscle.cpp.