|
Biorbd
|
#include <Muscles.h>
Public Member Functions | |
| Muscles () | |
| Construct muscles. | |
| Muscles (const biorbd::muscles::Muscles &other) | |
| Construct muscles from other muscles. More... | |
| virtual | ~Muscles () |
| Destroy class properly. | |
| biorbd::muscles::Muscles | DeepCopy () const |
| Deep copy of muscles. More... | |
| void | DeepCopy (const biorbd::muscles::Muscles &other) |
| Deep copy of muscles into another mucles. More... | |
| void | addMuscleGroup (const biorbd::utils::String &name, const biorbd::utils::String &originName, const biorbd::utils::String &insertionName) |
| Add a muscle group to the set. More... | |
| int | getGroupId (const biorbd::utils::String &name) const |
| Return the group ID. More... | |
| const std::vector< std::shared_ptr< biorbd::muscles::Muscle > > | muscles () const |
| Returns all the muscles. It sorts the muscles by group. More... | |
| const biorbd::muscles::Muscle & | muscle (unsigned int idx) const |
| Returns a specific muscle sorted by muscles() More... | |
| std::vector< biorbd::utils::String > | muscleNames () const |
| muscleNames Return the names for all the muscle ordered by their respective group name More... | |
| std::vector< biorbd::muscles::MuscleGroup > & | muscleGroups () |
| Return the muscle groups. More... | |
| const std::vector< biorbd::muscles::MuscleGroup > & | muscleGroups () const |
| Return the muscle groups. More... | |
| biorbd::muscles::MuscleGroup & | muscleGroup (unsigned int idx) |
| Return the muscle group of specific index. More... | |
| const biorbd::muscles::MuscleGroup & | muscleGroup (unsigned int idx) const |
| Return the muscle group of specific index. More... | |
| const biorbd::muscles::MuscleGroup & | muscleGroup (const biorbd::utils::String &name) const |
| Return the muscle group of specific name. More... | |
| void | updateMuscles (const biorbd::rigidbody::GeneralizedCoordinates &Q, bool updateKin) |
| Update all the muscles (positions, jacobian, etc.) More... | |
| void | updateMuscles (const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::rigidbody::GeneralizedVelocity &QDot, bool updateKin) |
| Update all the muscles (positions, jacobian, etc.) More... | |
| void | updateMuscles (std::vector< std::vector< biorbd::utils::Vector3d >> &musclePointsInGlobal, std::vector< biorbd::utils::Matrix > &jacoPointsInGlobal) |
| Update by hand all the muscles (positions, jacobian, velocity, etc.) More... | |
| void | updateMuscles (std::vector< std::vector< biorbd::utils::Vector3d >> &musclePointsInGlobal, std::vector< biorbd::utils::Matrix > &jacoPointsInGlobal, const biorbd::rigidbody::GeneralizedVelocity &QDot) |
| Update by hand all the muscles (positions, jacobian, velocity, etc.) More... | |
| biorbd::rigidbody::GeneralizedTorque | muscularJointTorque (const biorbd::utils::Vector &F) |
| Compute the muscular joint torque. More... | |
| biorbd::rigidbody::GeneralizedTorque | muscularJointTorque (const biorbd::utils::Vector &F, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::rigidbody::GeneralizedVelocity &QDot) |
| Compute the muscular joint torque. More... | |
| biorbd::rigidbody::GeneralizedTorque | muscularJointTorque (const std::vector< std::shared_ptr< biorbd::muscles::State >> &emg) |
| Compute the muscular joint torque. More... | |
| biorbd::rigidbody::GeneralizedTorque | muscularJointTorque (const std::vector< std::shared_ptr< biorbd::muscles::State >> &emg, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::rigidbody::GeneralizedVelocity &QDot) |
| Compute the muscular joint torque. More... | |
| biorbd::utils::Vector | activationDot (const std::vector< std::shared_ptr< biorbd::muscles::State >> &states, bool areadyNormalized=true) |
| Interface that returns in a vector all the activations dot. More... | |
| biorbd::utils::Matrix | musclesLengthJacobian () |
| Return the previously computed muscle length jacobian. More... | |
| biorbd::utils::Matrix | musclesLengthJacobian (const biorbd::rigidbody::GeneralizedCoordinates &Q) |
| Compute and return the muscle length Jacobian. More... | |
| biorbd::utils::Vector | muscleForces (const std::vector< std::shared_ptr< biorbd::muscles::State >> &emg) |
| Compute and return the muscle forces. More... | |
| biorbd::utils::Vector | muscleForces (const std::vector< std::shared_ptr< biorbd::muscles::State >> &emg, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::rigidbody::GeneralizedVelocity &QDot) |
| Compute and return the muscle forces. More... | |
| unsigned int | nbMuscleGroups () const |
| Return the total number of muscle groups. More... | |
| unsigned int | nbMuscleTotal () const |
| Return the total number of muscle. More... | |
| unsigned int | nbMuscles () const |
| Return the total number of muscle. More... | |
Protected Attributes | |
| std::shared_ptr< std::vector< biorbd::muscles::MuscleGroup > > | m_mus |
| Holder for muscle groups. | |
| biorbd::muscles::Muscles::Muscles | ( | const biorbd::muscles::Muscles & | other | ) |
Construct muscles from other muscles.
| other | The other muscles |
Definition at line 21 of file Muscles.cpp.
| biorbd::utils::Vector biorbd::muscles::Muscles::activationDot | ( | const std::vector< std::shared_ptr< biorbd::muscles::State >> & | states, |
| bool | areadyNormalized = true |
||
| ) |
Interface that returns in a vector all the activations dot.
| states | The state of the muscle |
| areadyNormalized | If the states are already normalized |
Definition at line 167 of file Muscles.cpp.
| void biorbd::muscles::Muscles::addMuscleGroup | ( | const biorbd::utils::String & | name, |
| const biorbd::utils::String & | originName, | ||
| const biorbd::utils::String & | insertionName | ||
| ) |
Add a muscle group to the set.
| name | The name of the muscle group |
| originName | The origin segment name where the origin lies |
| insertionName | The insertion segment name where the origin lies |
Definition at line 47 of file Muscles.cpp.
| biorbd::muscles::Muscles biorbd::muscles::Muscles::DeepCopy | ( | ) | const |
| void biorbd::muscles::Muscles::DeepCopy | ( | const biorbd::muscles::Muscles & | other | ) |
Deep copy of muscles into another mucles.
| other | The muscles to copy |
Definition at line 39 of file Muscles.cpp.
| int biorbd::muscles::Muscles::getGroupId | ( | const biorbd::utils::String & | name | ) | const |
Return the group ID.
| name | The name of the muscle group |
Definition at line 58 of file Muscles.cpp.
| const biorbd::muscles::Muscle & biorbd::muscles::Muscles::muscle | ( | unsigned int | idx | ) | const |
Returns a specific muscle sorted by muscles()
| idx | The muscle index |
Definition at line 77 of file Muscles.cpp.
| biorbd::utils::Vector biorbd::muscles::Muscles::muscleForces | ( | const std::vector< std::shared_ptr< biorbd::muscles::State >> & | emg | ) |
Compute and return the muscle forces.
| emg | The dynamic state |
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 185 of file Muscles.cpp.
| biorbd::utils::Vector biorbd::muscles::Muscles::muscleForces | ( | const std::vector< std::shared_ptr< biorbd::muscles::State >> & | emg, |
| const biorbd::rigidbody::GeneralizedCoordinates & | Q, | ||
| const biorbd::rigidbody::GeneralizedVelocity & | QDot | ||
| ) |
Compute and return the muscle forces.
| emg | The dynamic state |
| Q | The generalized coordinates |
| QDot | The generalized velocities |
Definition at line 203 of file Muscles.cpp.
| const biorbd::muscles::MuscleGroup & biorbd::muscles::Muscles::muscleGroup | ( | const biorbd::utils::String & | name | ) | const |
Return the muscle group of specific name.
| name | The name of the muscle group to return |
Definition at line 121 of file Muscles.cpp.
| biorbd::muscles::MuscleGroup & biorbd::muscles::Muscles::muscleGroup | ( | unsigned int | idx | ) |
Return the muscle group of specific index.
| idx | The index of the muscle group to return |
Definition at line 111 of file Muscles.cpp.
| const biorbd::muscles::MuscleGroup & biorbd::muscles::Muscles::muscleGroup | ( | unsigned int | idx | ) | const |
Return the muscle group of specific index.
| idx | The index of the muscle group to return |
Definition at line 117 of file Muscles.cpp.
| std::vector< biorbd::muscles::MuscleGroup > & biorbd::muscles::Muscles::muscleGroups | ( | ) |
| const std::vector< biorbd::muscles::MuscleGroup > & biorbd::muscles::Muscles::muscleGroups | ( | ) | const |
| std::vector< biorbd::utils::String > biorbd::muscles::Muscles::muscleNames | ( | ) | const |
muscleNames Return the names for all the muscle ordered by their respective group name
Definition at line 90 of file Muscles.cpp.
| const std::vector< std::shared_ptr< biorbd::muscles::Muscle > > biorbd::muscles::Muscles::muscles | ( | ) | const |
Returns all the muscles. It sorts the muscles by group.
Definition at line 66 of file Muscles.cpp.
| biorbd::utils::Matrix biorbd::muscles::Muscles::musclesLengthJacobian | ( | ) |
Return the previously computed muscle length jacobian.
Definition at line 218 of file Muscles.cpp.
| biorbd::utils::Matrix biorbd::muscles::Muscles::musclesLengthJacobian | ( | const biorbd::rigidbody::GeneralizedCoordinates & | Q | ) |
Compute and return the muscle length Jacobian.
| Q | The generalized coordinates |
Definition at line 233 of file Muscles.cpp.
| biorbd::rigidbody::GeneralizedTorque biorbd::muscles::Muscles::muscularJointTorque | ( | const biorbd::utils::Vector & | F | ) |
Compute the muscular joint torque.
| F | The force vector of all the muscles |
The computation for the muscular joint torque is done from virtual power:
i.e. ![]()
where
is the muscle lengths jacobian and
is the force vector of all the muscles
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 128 of file Muscles.cpp.
| biorbd::rigidbody::GeneralizedTorque biorbd::muscles::Muscles::muscularJointTorque | ( | const biorbd::utils::Vector & | F, |
| const biorbd::rigidbody::GeneralizedCoordinates & | Q, | ||
| const biorbd::rigidbody::GeneralizedVelocity & | QDot | ||
| ) |
Compute the muscular joint torque.
| F | The force vector of all the muscles |
| Q | The generalized coordinates |
| QDot | The generalized velocities |
This function updates the muscles and then performs the computation for the muscular joint torque is done from virtual power:
i.e. ![]()
where
is the muscle lengths jacobian and
is the force vector of all the muscles
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 139 of file Muscles.cpp.
| biorbd::rigidbody::GeneralizedTorque biorbd::muscles::Muscles::muscularJointTorque | ( | const std::vector< std::shared_ptr< biorbd::muscles::State >> & | emg | ) |
Compute the muscular joint torque.
| emg | The dynamic state to compute the force vector |
This functions converts muscle activations into muscle forces and then performs the computation for the muscular joint torque is done from virtual power:
i.e. ![]()
where
is the muscle lengths jacobian and
is the force vector of all the muscles
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 152 of file Muscles.cpp.
| biorbd::rigidbody::GeneralizedTorque biorbd::muscles::Muscles::muscularJointTorque | ( | const std::vector< std::shared_ptr< biorbd::muscles::State >> & | emg, |
| const biorbd::rigidbody::GeneralizedCoordinates & | Q, | ||
| const biorbd::rigidbody::GeneralizedVelocity & | QDot | ||
| ) |
Compute the muscular joint torque.
| emg | The dynamic state to compute the force vector |
| Q | The generalized coordinates (not needed if updateKin is false) |
| QDot | The generalized velocities (not needed if updateKin is false) |
The computation for the muscular joint torque is done from virtual power:
i.e. ![]()
where
is the muscle lengths jacobian and
is the force vector of all the muscles
Definition at line 159 of file Muscles.cpp.
| unsigned int biorbd::muscles::Muscles::nbMuscleGroups | ( | ) | const |
Return the total number of muscle groups.
Definition at line 214 of file Muscles.cpp.
| unsigned int biorbd::muscles::Muscles::nbMuscles | ( | ) | const |
Return the total number of muscle.
Definition at line 246 of file Muscles.cpp.
| unsigned int biorbd::muscles::Muscles::nbMuscleTotal | ( | ) | const |
Return the total number of muscle.
Definition at line 242 of file Muscles.cpp.
| void biorbd::muscles::Muscles::updateMuscles | ( | const biorbd::rigidbody::GeneralizedCoordinates & | Q, |
| bool | updateKin | ||
| ) |
Update all the muscles (positions, jacobian, etc.)
| Q | The generalized coordinates |
| updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 277 of file Muscles.cpp.
| void biorbd::muscles::Muscles::updateMuscles | ( | const biorbd::rigidbody::GeneralizedCoordinates & | Q, |
| const biorbd::rigidbody::GeneralizedVelocity & | QDot, | ||
| bool | updateKin | ||
| ) |
Update all the muscles (positions, jacobian, etc.)
| 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 254 of file Muscles.cpp.
| void biorbd::muscles::Muscles::updateMuscles | ( | std::vector< std::vector< biorbd::utils::Vector3d >> & | musclePointsInGlobal, |
| std::vector< biorbd::utils::Matrix > & | jacoPointsInGlobal | ||
| ) |
Update by hand all the muscles (positions, jacobian, velocity, etc.)
| musclePointsInGlobal | The muscle points in global reference frame |
| jacoPointsInGlobal | The jacobian points in global reference frame |
Definition at line 312 of file Muscles.cpp.
| void biorbd::muscles::Muscles::updateMuscles | ( | std::vector< std::vector< biorbd::utils::Vector3d >> & | musclePointsInGlobal, |
| std::vector< biorbd::utils::Matrix > & | jacoPointsInGlobal, | ||
| const biorbd::rigidbody::GeneralizedVelocity & | QDot | ||
| ) |
Update by hand all the muscles (positions, jacobian, velocity, etc.)
| musclePointsInGlobal | The muscle points in global reference frame |
| jacoPointsInGlobal | The jacobian points in global reference frame |
| QDot | The generalized velocities |
Definition at line 300 of file Muscles.cpp.
1.8.18