Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Ligaments.h
1#ifndef BIORBD_LIGAMENTS_LIGAMENTS_H
2#define BIORBD_LIGAMENTS_LIGAMENTS_H
3
4#include "biorbdConfig.h"
5
6#include <memory>
7#include <vector>
8
9namespace BIORBD_NAMESPACE {
10namespace utils {
11class String;
12class Matrix;
13class Vector;
14class Vector3d;
15} // namespace utils
16
17namespace rigidbody {
21class Joints;
22} // namespace rigidbody
23
24namespace internal_forces {
25namespace ligaments {
26class Ligament;
27
31class BIORBD_API Ligaments {
32 public:
36 Ligaments();
37
42 Ligaments(const Ligaments& other);
43
47 virtual ~Ligaments();
48
53 Ligaments DeepCopy() const;
54
59 void DeepCopy(const Ligaments& other);
60
65 std::vector<std::shared_ptr<Ligament>>& ligaments();
66
71 const std::vector<std::shared_ptr<Ligament>>& ligaments() const;
72
79 Ligament& ligament(size_t idx);
80
87 const Ligament& ligament(size_t idx) const;
88
94 std::vector<utils::String> ligamentNames() const;
95
112
135 const utils::Vector& F,
136 rigidbody::Joints& updatedModel,
139 bool updateLigamentKinematics = true);
140
162 const utils::Vector& F,
165 int updateKin = 2);
166
188 rigidbody::Joints& updatedModel,
191 bool updateLigamentKinematics = true);
192
215 int updateKin = 2);
216
222
232 rigidbody::Joints& updatedModel,
234 bool updateLigamentKinematics = true);
235
245 int updateKin = 2);
246
256 rigidbody::Joints& updatedModel,
258 bool updateLigamentKinematics = true);
259
269 int updateKin = 2);
270
281 rigidbody::Joints& updatedModel,
284 bool updateLigamentKinematics = true);
285
297 int updateKin = 2);
298
303 size_t nbLigaments() const;
304
310 int ligamentID(const utils::String& name);
311
316 void addLigament(const Ligament& ligament);
317
323 void updateLigaments(
324 rigidbody::Joints& updatedModel,
326
332 void updateLigaments(
334 bool updateKin = true);
335
342 void updateLigaments(
343 rigidbody::Joints& updatedModel,
346
353 void updateLigaments(
356 bool updateKin = true);
357
367 void updateLigaments(
368 rigidbody::Joints& updatedModel,
369 std::vector<std::vector<utils::Vector3d>>& ligamentPointsInGlobal,
370 std::vector<utils::Matrix>& jacoPointsInGlobal,
372
380 void updateLigaments(
381 std::vector<std::vector<utils::Vector3d>>& ligamentPointsInGlobal,
382 std::vector<utils::Matrix>& jacoPointsInGlobal);
383
384 protected:
391 const rigidbody::Joints& model) const;
392
393 std::shared_ptr<std::vector<std::shared_ptr<Ligament>>>
395};
396
397} // namespace ligaments
398} // namespace internal_forces
399} // namespace BIORBD_NAMESPACE
400
401#endif // BIORBD_LIGAMENTS_LIGAMENTS_H
void updateLigaments(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
Update all the ligaments (positions, jacobian, etc.).
int ligamentID(const utils::String &name)
Return the ligament index.
std::shared_ptr< std::vector< std::shared_ptr< Ligament > > > m_ligaments
Holder for ligament groups.
Definition Ligaments.h:394
utils::Vector ligamentForces(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
Compute and return the ligament forces.
rigidbody::GeneralizedTorque ligamentsJointTorque(const utils::Vector &F)
Compute the ligament joint torque.
std::vector< std::shared_ptr< Ligament > > & ligaments()
Returns all the ligaments. It sorts the ligaments by group.
utils::Matrix ligamentsLengthJacobian() const
Return the previously computed ligament length jacobian.
void addLigament(const Ligament &ligament)
Add a ligament to the set of ligaments.
Definition Ligaments.cpp:80
Ligaments DeepCopy() const
Deep copy of ligaments.
Definition Ligaments.cpp:30
Ligament & ligament(size_t idx)
Returns a specific ligament sorted by ligaments().
Definition Ligaments.cpp:67
std::vector< utils::String > ligamentNames() const
ligamentNames Return the names for all the ligament ordered by their respective name
utils::Matrix computeLigamentsLengthJacobian(const rigidbody::Joints &model) const
Assemble the ligament length jacobian using the provided model.
size_t nbLigaments() const
Return the total number of ligament.
This is the core of the musculoskeletal model in biorbd.
Definition Joints.h:48
A wrapper for the Eigen::MatrixXd.
Definition Matrix.h:18
Wrapper around the std::string class with augmented functionality.
Definition String.h:18
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27
Wrapper of the Eigen VectorXd.
Definition Vector.h:21