1#ifndef BIORBD_MUSCLES_MUSCLES_H
2#define BIORBD_MUSCLES_MUSCLES_H
4#include "biorbdConfig.h"
9#include "InternalForces/Geometry.h"
11namespace BIORBD_NAMESPACE {
25namespace internal_forces {
86 std::vector<std::shared_ptr<Muscle>>
muscles()
const;
151 bool updateKin =
true);
173 bool updateKin =
true);
182 std::vector<std::vector<utils::Vector3d>>& musclePointsInGlobal,
183 std::vector<utils::Matrix>& jacoPointsInGlobal);
193 std::vector<std::vector<utils::Vector3d>>& musclePointsInGlobal,
194 std::vector<utils::Matrix>& jacoPointsInGlobal,
204 std::vector<std::shared_ptr<State>>
stateSet();
246 bool updateMuscleParameters =
true);
289 const std::vector<std::shared_ptr<State>>& emg);
312 const std::vector<std::shared_ptr<State>>& emg,
315 bool updateMuscleParameters =
true);
334 const std::vector<std::shared_ptr<State>>& emg,
346 const std::vector<std::shared_ptr<State>>& states,
347 bool areadyNormalized =
true);
366 bool updateMuscleParameters =
true);
401 const std::vector<std::shared_ptr<State>>& emg,
404 bool updateMuscleParameters =
true);
416 const std::vector<std::shared_ptr<State>>& emg,
447 std::shared_ptr<std::vector<MuscleGroup>>
A muscle group is muscle that share parents for both origin and insertion.
Base class of all muscle.
std::vector< std::shared_ptr< Muscle > > muscles() const
Returns all the muscles. It sorts the muscles by group.
size_t nbMuscles() const
Return the total number of muscle.
void addMuscleGroup(const utils::String &name, const utils::String &originName, const utils::String &insertionName)
Add a muscle group to the set.
std::vector< utils::String > muscleNames() const
muscleNames Return the names for all the muscle ordered by their respective group name
size_t nbMuscleTotal() const
Return the total number of muscle.
size_t nbMuscleGroups() const
Return the total number of muscle groups.
std::shared_ptr< std::vector< MuscleGroup > > m_mus
Holder for muscle groups.
Muscle & muscle(size_t idx) const
Returns a specific muscle sorted by muscles().
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.
std::vector< MuscleGroup > & muscleGroups()
Return the muscle groups.
Muscles DeepCopy() const
Deep copy of muscles.
void updateMuscles(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
Update all the muscles (positions, jacobian, etc.).
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.
MuscleGroup & muscleGroup(size_t idx)
Return the muscle group of specific index.
int getMuscleGroupId(const utils::String &name) const
Return the group ID.
utils::Vector muscleForces(const std::vector< std::shared_ptr< State > > &emg)
Compute and return the muscle forces.
utils::Matrix computeMusclesLengthJacobian(const rigidbody::Joints &model)
Assemble the muscle length jacobian using the provided model.
Muscles()
Construct muscles.
EMG holder to interact with the muscle.
Class GeneralizedCoordinates.
Class GeneralizedVelocity.
This is the core of the musculoskeletal model in biorbd.
A wrapper for the Eigen::MatrixXd.
Wrapper around the std::string class with augmented functionality.
Wrapper around Eigen Vector3d and attach it to a parent.
Wrapper of the Eigen VectorXd.