|
Biorbd Release_1.13.0
|
#include <Muscles.h>
Public Member Functions | |
| Muscles () | |
| Construct muscles. | |
| Muscles (const Muscles &other) | |
| Construct muscles from other muscles. | |
| virtual | ~Muscles () |
| Destroy class properly. | |
| Muscles | DeepCopy () const |
| Deep copy of muscles. | |
| void | DeepCopy (const Muscles &other) |
| Deep copy of muscles into another mucles. | |
| void | addMuscleGroup (const utils::String &name, const utils::String &originName, const utils::String &insertionName) |
| Add a muscle group to the set. | |
| int | getMuscleGroupId (const utils::String &name) const |
| Return the group ID. | |
| std::vector< std::shared_ptr< Muscle > > | muscles () const |
| Returns all the muscles. It sorts the muscles by group. | |
| Muscle & | muscle (size_t idx) const |
| Returns a specific muscle sorted by muscles(). | |
| std::vector< utils::String > | muscleNames () const |
| muscleNames Return the names for all the muscle ordered by their respective group name | |
| std::vector< MuscleGroup > & | muscleGroups () |
| Return the muscle groups. | |
| const std::vector< MuscleGroup > & | muscleGroups () const |
| Return the muscle groups. | |
| MuscleGroup & | muscleGroup (size_t idx) |
| Return the muscle group of specific index. | |
| const MuscleGroup & | muscleGroup (size_t idx) const |
| Return the muscle group of specific index. | |
| const MuscleGroup & | muscleGroup (const utils::String &name) const |
| Return the muscle group of specific name. | |
| void | updateMuscles (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q) |
| Update all the muscles (positions, jacobian, etc.). | |
| void | updateMuscles (const rigidbody::GeneralizedCoordinates &Q, bool updateKin=true) |
| Update all the muscles (positions, jacobian, etc.). | |
| void | updateMuscles (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot) |
| Update all the muscles (positions, jacobian, etc.). | |
| void | updateMuscles (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateKin=true) |
| Update all the muscles (positions, jacobian, etc.). | |
| void | updateMuscles (std::vector< std::vector< utils::Vector3d > > &musclePointsInGlobal, std::vector< utils::Matrix > &jacoPointsInGlobal) |
| Update by hand all the muscles (positions, jacobian, velocity, etc.). | |
| void | updateMuscles (std::vector< std::vector< utils::Vector3d > > &musclePointsInGlobal, std::vector< utils::Matrix > &jacoPointsInGlobal, const rigidbody::GeneralizedVelocity &Qdot) |
| Update by hand all the muscles (positions, jacobian, velocity, etc.). | |
| std::vector< std::shared_ptr< State > > | stateSet () |
| Get the vector of state that must be used to update states. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (const utils::Vector &F) |
| Compute the muscular joint torque. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (const utils::Vector &F, rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateMuscleParameters=true) |
| Compute the muscular joint torque. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (const utils::Vector &F, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2) |
| Compute the muscular joint torque. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (const std::vector< std::shared_ptr< State > > &emg) |
| Compute the muscular joint torque. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (rigidbody::Joints &updatedModel, const std::vector< std::shared_ptr< State > > &emg, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateMuscleParameters=true) |
| Compute the muscular joint torque. | |
| rigidbody::GeneralizedTorque | muscularJointTorque (const std::vector< std::shared_ptr< State > > &emg, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2) |
| Compute the muscular joint torque. | |
| utils::Vector | activationDot (const std::vector< std::shared_ptr< State > > &states, bool areadyNormalized=true) |
| Interface that returns in a vector all the activations dot. | |
| utils::Matrix | musclesLengthJacobian () |
| Return the previously computed muscle length jacobian. | |
| utils::Matrix | musclesLengthJacobian (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true) |
| Compute and return the muscle length Jacobian. | |
| utils::Matrix | musclesLengthJacobian (const rigidbody::GeneralizedCoordinates &Q, int updateKin=2) |
| Compute and return the muscle length Jacobian. | |
| utils::Vector | muscleForces (const std::vector< std::shared_ptr< State > > &emg) |
| Compute and return the muscle forces. | |
| utils::Vector | muscleForces (rigidbody::Joints &updatedModel, const std::vector< std::shared_ptr< State > > &emg, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateMuscleParameters=true) |
| Compute and return the muscle forces. | |
| utils::Vector | muscleForces (const std::vector< std::shared_ptr< State > > &emg, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, int updateKin=2) |
| Compute and return the muscle forces. | |
| size_t | nbMuscleGroups () const |
| Return the total number of muscle groups. | |
| size_t | nbMuscleTotal () const |
| Return the total number of muscle. | |
| size_t | nbMuscles () const |
| Return the total number of muscle. | |
Protected Member Functions | |
| utils::Matrix | computeMusclesLengthJacobian (const rigidbody::Joints &model) |
| Assemble the muscle length jacobian using the provided model. | |
Protected Attributes | |
| std::shared_ptr< std::vector< MuscleGroup > > | m_mus |
| Holder for muscle groups. | |
| internal_forces::muscles::Muscles::Muscles | ( | ) |
Construct muscles.
Definition at line 16 of file Muscles.cpp.
| internal_forces::muscles::Muscles::Muscles | ( | const Muscles & | other | ) |
Construct muscles from other muscles.
| other | The other muscles |
Definition at line 21 of file Muscles.cpp.
|
virtual |
Destroy class properly.
Definition at line 25 of file Muscles.cpp.
| utils::Vector internal_forces::muscles::Muscles::activationDot | ( | const std::vector< std::shared_ptr< 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 195 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::addMuscleGroup | ( | const utils::String & | name, |
| const utils::String & | originName, | ||
| const 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 42 of file Muscles.cpp.
|
protected |
Assemble the muscle length jacobian using the provided model.
| model | The joint model updated to the proper kinematics level |
Definition at line 260 of file Muscles.cpp.
| internal_forces::muscles::Muscles internal_forces::muscles::Muscles::DeepCopy | ( | ) | const |
| void internal_forces::muscles::Muscles::DeepCopy | ( | const Muscles & | other | ) |
Deep copy of muscles into another mucles.
| other | The muscles to copy |
Definition at line 34 of file Muscles.cpp.
| int internal_forces::muscles::Muscles::getMuscleGroupId | ( | const utils::String & | name | ) | const |
Return the group ID.
| name | The name of the muscle group |
Definition at line 55 of file Muscles.cpp.
| internal_forces::muscles::Muscle & internal_forces::muscles::Muscles::muscle | ( | size_t | idx | ) | const |
Returns a specific muscle sorted by muscles().
| idx | The muscle index |
Definition at line 75 of file Muscles.cpp.
| utils::Vector internal_forces::muscles::Muscles::muscleForces | ( | const std::vector< std::shared_ptr< 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 212 of file Muscles.cpp.
| utils::Vector internal_forces::muscles::Muscles::muscleForces | ( | const std::vector< std::shared_ptr< State > > & | emg, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| int | updateKin = 2 ) |
Compute and return the muscle forces.
| emg | The dynamic state |
| 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 241 of file Muscles.cpp.
| utils::Vector internal_forces::muscles::Muscles::muscleForces | ( | rigidbody::Joints & | updatedModel, |
| const std::vector< std::shared_ptr< State > > & | emg, | ||
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| bool | updateMuscleParameters = true ) |
Compute and return the muscle forces.
| updatedModel | The model previously updated to proper kinematic level |
| emg | The dynamic state |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| updateMuscleParameters | Update the kinematic related parameters of the muscles |
Definition at line 230 of file Muscles.cpp.
| const internal_forces::muscles::MuscleGroup & internal_forces::muscles::Muscles::muscleGroup | ( | const utils::String & | name | ) | const |
Return the muscle group of specific name.
| name | The name of the muscle group to return |
Definition at line 124 of file Muscles.cpp.
| internal_forces::muscles::MuscleGroup & internal_forces::muscles::Muscles::muscleGroup | ( | size_t | idx | ) |
Return the muscle group of specific index.
| idx | The index of the muscle group to return |
Definition at line 109 of file Muscles.cpp.
| const internal_forces::muscles::MuscleGroup & internal_forces::muscles::Muscles::muscleGroup | ( | size_t | 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< internal_forces::muscles::MuscleGroup > & internal_forces::muscles::Muscles::muscleGroups | ( | ) |
| const std::vector< internal_forces::muscles::MuscleGroup > & internal_forces::muscles::Muscles::muscleGroups | ( | ) | const |
| std::vector< utils::String > internal_forces::muscles::Muscles::muscleNames | ( | ) | const |
muscleNames Return the names for all the muscle ordered by their respective group name
Definition at line 87 of file Muscles.cpp.
| std::vector< std::shared_ptr< internal_forces::muscles::Muscle > > internal_forces::muscles::Muscles::muscles | ( | ) | const |
Returns all the muscles. It sorts the muscles by group.
Definition at line 65 of file Muscles.cpp.
| utils::Matrix internal_forces::muscles::Muscles::musclesLengthJacobian | ( | ) |
Return the previously computed muscle length jacobian.
Definition at line 255 of file Muscles.cpp.
| utils::Matrix internal_forces::muscles::Muscles::musclesLengthJacobian | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| int | updateKin = 2 ) |
Compute and return the muscle length Jacobian.
| Q | The generalized coordinates |
| updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
Definition at line 286 of file Muscles.cpp.
| utils::Matrix internal_forces::muscles::Muscles::musclesLengthJacobian | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| bool | updateMuscleParameters = true ) |
Compute and return the muscle length Jacobian.
| updatedModel | The model previously updated to proper kinematic level |
| Q | The generalized coordinates |
| updateMuscleParameters | Update the kinematic related parameters of the muscles |
Definition at line 277 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | const std::vector< std::shared_ptr< 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. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 168 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | const std::vector< std::shared_ptr< State > > & | emg, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| int | updateKin = 2 ) |
Compute the muscular joint torque.
| emg | The dynamic state to compute the force vector |
| Q | The generalized coordinates (not needed if updateKin is 0) |
| Qdot | The generalized velocities (not needed if updateKin is 0) |
| updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
The computation for the muscular joint torque is done from virtual power:
i.e. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Definition at line 187 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | const 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. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Warning: This function assumes that muscles are already updated (via updateMuscles)
Definition at line 133 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | const utils::Vector & | F, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| int | updateKin = 2 ) |
Compute the muscular joint torque.
| F | The force vector of all the muscles |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
This function updates the muscles and then performs the computation for the muscular joint torque is done from virtual power:
i.e. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Definition at line 156 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | const utils::Vector & | F, |
| rigidbody::Joints & | updatedModel, | ||
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| bool | updateMuscleParameters = true ) |
Compute the muscular joint torque.
| F | The force vector of all the muscles |
| updatedModel | The model previously updated to proper kinematic level |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| updateMuscleParameters | Update the kinematic related parameters of the muscles |
This function updates the muscles and then performs the computation for the muscular joint torque is done from virtual power:
i.e. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Definition at line 143 of file Muscles.cpp.
| rigidbody::GeneralizedTorque internal_forces::muscles::Muscles::muscularJointTorque | ( | rigidbody::Joints & | updatedModel, |
| const std::vector< std::shared_ptr< State > > & | emg, | ||
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| bool | updateMuscleParameters = true ) |
Compute the muscular joint torque.
| updatedModel | The model previously updated to proper kinematic level |
| emg | The dynamic state to compute the force vector |
| Q | The generalized coordinates (not needed if updateMuscleParameters is false) |
| Qdot | The generalized velocities (not needed if updateMuscleParameters is false) |
| updateMuscleParameters | Update the kinematic related parameters of the muscles |
The computation for the muscular joint torque is done from virtual power:
i.e. \(-J \times F\)
where \(J\) is the muscle lengths jacobian and \(F\) is the force vector of all the muscles
Definition at line 175 of file Muscles.cpp.
| size_t internal_forces::muscles::Muscles::nbMuscleGroups | ( | ) | const |
Return the total number of muscle groups.
Definition at line 251 of file Muscles.cpp.
| size_t internal_forces::muscles::Muscles::nbMuscles | ( | ) | const |
Return the total number of muscle.
Definition at line 314 of file Muscles.cpp.
| size_t internal_forces::muscles::Muscles::nbMuscleTotal | ( | ) | const |
Return the total number of muscle.
Definition at line 310 of file Muscles.cpp.
| std::vector< std::shared_ptr< internal_forces::muscles::State > > internal_forces::muscles::Muscles::stateSet | ( | ) |
Get the vector of state that must be used to update states.
Note: creating your own vector of state is possible. However, it will override the state type that is associated with the muscle
Definition at line 403 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| bool | updateKin = true ) |
Update all the muscles (positions, jacobian, etc.).
| Q | The generalized coordinates |
| updateKin | If the joint model should be updated |
Definition at line 333 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| bool | updateKin = true ) |
Update all the muscles (positions, jacobian, etc.).
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| updateKin | If the joint model should be updated |
Definition at line 366 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q ) |
Update all the muscles (positions, jacobian, etc.).
| updatedModel | The model previously updated to proper kinematic level |
| Q | The generalized coordinates |
Definition at line 322 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot ) |
Update all the muscles (positions, jacobian, etc.).
| updatedModel | The model previously updated to proper kinematic level |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
Definition at line 354 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | std::vector< std::vector< utils::Vector3d > > & | musclePointsInGlobal, |
| std::vector< 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 411 of file Muscles.cpp.
| void internal_forces::muscles::Muscles::updateMuscles | ( | std::vector< std::vector< utils::Vector3d > > & | musclePointsInGlobal, |
| std::vector< utils::Matrix > & | jacoPointsInGlobal, | ||
| const 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 389 of file Muscles.cpp.
|
protected |