1#ifndef BIORBD_LIGAMENTS_LIGAMENT_H
2#define BIORBD_LIGAMENTS_LIGAMENT_H
4#include "biorbdConfig.h"
6#include "InternalForces/Compound.h"
7#include "InternalForces/Geometry.h"
8#include "InternalForces/Ligaments/LigamentsEnums.h"
9#include "Utils/Scalar.h"
11namespace BIORBD_NAMESPACE {
17namespace internal_forces {
69 Ligament(
const std::shared_ptr<Ligament> other);
92 const utils::Scalar&
length(
95 bool updateLigamentKinematics =
true);
110 bool updateLigamentKinematics =
true);
141 std::vector<utils::Vector3d>& ligamentPointsInGlobal,
152 std::vector<utils::Vector3d>& ligamentPointsInGlobal,
193 bool updateLigamentKinematics =
true);
211 virtual const utils::Scalar&
force(
215 bool updateLigamentKinematics =
true);
225 virtual const utils::Scalar&
force(
228 bool updateLigamentKinematics =
true);
235 virtual const utils::Scalar&
force();
241 LIGAMENT_TYPE
type()
const;
247 const utils::Scalar&
Fl();
253 const utils::Scalar&
damping();
271 std::shared_ptr<internal_forces::Geometry>
275 std::shared_ptr<LigamentCharacteristics>
292 std::shared_ptr<utils::Scalar>
m_Fl;
Class compound is a very generic definition of what a muscle is. It should be the base class of every...
const utils::String & name() const
Return the name of the muscle.
Compound()
Construct muscle compound.
Class Geometry of the muscle.
Holder of all the path modifiers of a muscle.
Class Holds that ligament characteristics.
void setCharacteristics(const LigamentCharacteristics &characteristics)
Set the ligament characteristics.
const utils::Scalar & velocity(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateLigamentKinematics=true)
Return the velocity of the ligament.
const std::vector< utils::Vector3d > & ligamentsPointsInGlobal(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
Return the ligament points in global reference frame.
std::shared_ptr< internal_forces::Geometry > m_position
const internal_forces::Geometry & position() const
Return the position of all the points attached to the ligament (0 being the origin).
virtual void computeFl()=0
Compute the Force-length.
std::shared_ptr< utils::Scalar > m_damping
The ligament damping term.
const utils::Scalar & length(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
Get the length of the ligament.
void computeDamping()
Compute the ligament damping.
const utils::Scalar & Fl()
Return the Force-Length of the passive element.
void DeepCopy(const Ligament &other)
Deep copy of a ligament in new ligament.
virtual utils::Scalar getForce()
Function allowing modification of the way the force is computed in computeForce().
const LigamentCharacteristics & characteristics() const
Return the ligament characteristics.
std::shared_ptr< utils::Scalar > m_Fl
Force-Length.
void updateOrientations(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
Update the position of the origin and insertion positions of the ligament.
LIGAMENT_TYPE type() const
Return the type of the ligament.
virtual void computeForce()
Compute the force of the ligament.
void setPosition(const internal_forces::Geometry &positions)
Set the position of all the points attached to the ligament (0 being the origin).
const utils::Scalar & damping()
Return the ligament damping (spring force).
std::shared_ptr< LigamentCharacteristics > m_characteristics
The ligament characteristics.
virtual const utils::Scalar & force(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateLigamentKinematics=true)
Return the computed force norm.
Ligament()
Construct a ligament.
std::shared_ptr< LIGAMENT_TYPE > m_type
The type of the ligament.
virtual void setType()
Set the type of ligament.
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.