1#ifndef BIORBD_MUSCLES_H
2#define BIORBD_MUSCLES_H
4#include "biorbdConfig.h"
6#include "InternalForces/Compound.h"
7#include "InternalForces/Muscles/MuscleGeometry.h"
8#include "InternalForces/Muscles/MusclesEnums.h"
9#include "Utils/Scalar.h"
11namespace BIORBD_NAMESPACE {
17namespace internal_forces {
98 Muscle(
const std::shared_ptr<Muscle> other);
121 const utils::Scalar&
length(
124 bool updateMuscleParameters =
true);
137 bool updateMuscleParameters =
true);
152 bool updateMuscleParameters =
true);
182 std::vector<utils::Vector3d>& musclePointsInGlobal,
193 std::vector<utils::Vector3d>& musclePointsInGlobal,
235 bool updateMuscleParameters =
true);
276 bool alreadyNormalized =
false)
const;
300 bool updateMuscleParameters =
true) = 0;
315 bool updateMuscleParameters =
true) = 0;
321 MUSCLE_TYPE
type()
const;
344 std::shared_ptr<internal_forces::muscles::MuscleGeometry>
346 std::shared_ptr<Characteristics>
const utils::String & name() const
Return the name of the muscle.
Compound()
Construct muscle compound.
Holder of all the path modifiers of a muscle.
Class Holds that muscle characteristics.
Class muscle geometry of the muscle.
void setState(const State &emg)
Set the dynamic state.
std::shared_ptr< Characteristics > m_characteristics
The muscle characteristics.
Characteristics & characteristics() const
Return the muscle characteristics.
virtual const utils::Scalar & force(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const State &emg, bool updateMuscleParameters=true)=0
Return the computed force norm from EMG.
Muscle()
Construct a muscle.
std::shared_ptr< State > m_state
The dynamic state.
const utils::Scalar & activationDot(const State &state, bool alreadyNormalized=false) const
Return the activation time derivative.
void setCharacteristics(const Characteristics &characteristics)
Set the muscle characteristics.
virtual void setType()
Set the type of muscle.
virtual void computeForce(const State &emg)
Computer the forces from a specific emg.
std::shared_ptr< internal_forces::muscles::MuscleGeometry > m_position
The geometry (position of the nodes) of the muscle.
const utils::Scalar & musculoTendonLength(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
Return the musculo tendon length.
const utils::Scalar & length(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
Get the length of the muscle.
std::shared_ptr< MUSCLE_TYPE > m_type
The type of the muscle.
const internal_forces::muscles::MuscleGeometry & position() const
Return the position of all the points attached to the muscle (0 being the origin).
virtual const utils::Scalar & force(const State &emg)=0
Computes and returns the forces norm from the EMG.
const State & state() const
Return the dynamic state.
virtual utils::Scalar getForceFromActivation(const State &emg)=0
Function allowing modification of the way the multiplication is done in computeForce(EMG).
void setForceIsoMax(const utils::Scalar &forceMax)
Set the maximal isometric force.
virtual const utils::Scalar & force(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const State &emg, bool updateMuscleParameters=true)=0
Return the computed force norm from EMG.
MUSCLE_TYPE type() const
Return the type of the muscle.
const std::vector< utils::Vector3d > & musclesPointsInGlobal(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateMuscleParameters=true)
Return the muscle points in global reference frame.
const utils::Scalar & velocity(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateMuscleParameters=true)
Return the velocity of the muscle.
std::shared_ptr< utils::Scalar > m_muscleLength
muscle tendon length
void DeepCopy(const Muscle &other)
Deep copy of a muscle in new muscle.
void setPosition(const internal_forces::muscles::MuscleGeometry &positions)
Set the position of all the points attached to the muscle (0 being the origin).
void updateOrientations(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
Update the position of the origin and insertion positions of the muscle.
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.