Biorbd
Release_1.13.0
Toggle main menu visibility
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
9
namespace
BIORBD_NAMESPACE {
10
namespace
utils {
11
class
String
;
12
class
Matrix
;
13
class
Vector
;
14
class
Vector3d
;
15
}
// namespace utils
16
17
namespace
rigidbody {
18
class
GeneralizedCoordinates
;
19
class
GeneralizedVelocity
;
20
class
GeneralizedTorque
;
21
class
Joints
;
22
}
// namespace rigidbody
23
24
namespace
internal_forces {
25
namespace
ligaments {
26
class
Ligament
;
27
31
class
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
111
rigidbody::GeneralizedTorque
ligamentsJointTorque
(
const
utils::Vector
& F);
112
134
rigidbody::GeneralizedTorque
ligamentsJointTorque
(
135
const
utils::Vector
& F,
136
rigidbody::Joints
& updatedModel,
137
const
rigidbody::GeneralizedCoordinates
& Q,
138
const
rigidbody::GeneralizedVelocity
& Qdot,
139
bool
updateLigamentKinematics =
true
);
140
161
rigidbody::GeneralizedTorque
ligamentsJointTorque
(
162
const
utils::Vector
& F,
163
const
rigidbody::GeneralizedCoordinates
& Q,
164
const
rigidbody::GeneralizedVelocity
& Qdot,
165
int
updateKin = 2);
166
187
rigidbody::GeneralizedTorque
ligamentsJointTorque
(
188
rigidbody::Joints
& updatedModel,
189
const
rigidbody::GeneralizedCoordinates
& Q,
190
const
rigidbody::GeneralizedVelocity
& Qdot,
191
bool
updateLigamentKinematics =
true
);
192
212
rigidbody::GeneralizedTorque
ligamentsJointTorque
(
213
const
rigidbody::GeneralizedCoordinates
& Q,
214
const
rigidbody::GeneralizedVelocity
& Qdot,
215
int
updateKin = 2);
216
221
utils::Matrix
ligamentsLengthJacobian
()
const
;
222
231
utils::Matrix
ligamentsLengthJacobian
(
232
rigidbody::Joints
& updatedModel,
233
const
rigidbody::GeneralizedCoordinates
& Q,
234
bool
updateLigamentKinematics =
true
);
235
243
utils::Matrix
ligamentsLengthJacobian
(
244
const
rigidbody::GeneralizedCoordinates
& Q,
245
int
updateKin = 2);
246
255
utils::Vector
ligamentForces
(
256
rigidbody::Joints
& updatedModel,
257
const
rigidbody::GeneralizedCoordinates
& Q,
258
bool
updateLigamentKinematics =
true
);
259
267
utils::Vector
ligamentForces
(
268
const
rigidbody::GeneralizedCoordinates
& Q,
269
int
updateKin = 2);
270
280
utils::Vector
ligamentForces
(
281
rigidbody::Joints
& updatedModel,
282
const
rigidbody::GeneralizedCoordinates
& Q,
283
const
rigidbody::GeneralizedVelocity
& Qdot,
284
bool
updateLigamentKinematics =
true
);
285
294
utils::Vector
ligamentForces
(
295
const
rigidbody::GeneralizedCoordinates
& Q,
296
const
rigidbody::GeneralizedVelocity
& Qdot,
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,
325
const
rigidbody::GeneralizedCoordinates
& Q);
326
332
void
updateLigaments
(
333
const
rigidbody::GeneralizedCoordinates
& Q,
334
bool
updateKin =
true
);
335
342
void
updateLigaments
(
343
rigidbody::Joints
& updatedModel,
344
const
rigidbody::GeneralizedCoordinates
& Q,
345
const
rigidbody::GeneralizedVelocity
& Qdot);
346
353
void
updateLigaments
(
354
const
rigidbody::GeneralizedCoordinates
& Q,
355
const
rigidbody::GeneralizedVelocity
& Qdot,
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,
371
const
rigidbody::GeneralizedVelocity
& Qdot);
372
380
void
updateLigaments
(
381
std::vector<std::vector<utils::Vector3d>>& ligamentPointsInGlobal,
382
std::vector<utils::Matrix>& jacoPointsInGlobal);
383
384
protected
:
390
utils::Matrix
computeLigamentsLengthJacobian
(
391
const
rigidbody::Joints
& model)
const
;
392
393
std::shared_ptr<std::vector<std::shared_ptr<Ligament>>>
394
m_ligaments
;
395
};
396
397
}
// namespace ligaments
398
}
// namespace internal_forces
399
}
// namespace BIORBD_NAMESPACE
400
401
#endif
// BIORBD_LIGAMENTS_LIGAMENTS_H
BIORBD_NAMESPACE::internal_forces::ligaments::Ligament
Base class of all ligament.
Definition
Ligament.h:26
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::updateLigaments
void updateLigaments(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q)
Update all the ligaments (positions, jacobian, etc.).
Definition
Ligaments.cpp:379
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligamentID
int ligamentID(const utils::String &name)
Return the ligament index.
Definition
Ligaments.cpp:345
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::m_ligaments
std::shared_ptr< std::vector< std::shared_ptr< Ligament > > > m_ligaments
Holder for ligament groups.
Definition
Ligaments.h:394
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligamentForces
utils::Vector ligamentForces(rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, bool updateLigamentKinematics=true)
Compute and return the ligament forces.
Definition
Ligaments.cpp:201
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligamentsJointTorque
rigidbody::GeneralizedTorque ligamentsJointTorque(const utils::Vector &F)
Compute the ligament joint torque.
Definition
Ligaments.cpp:117
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::Ligaments
Ligaments()
Construct ligaments.
Definition
Ligaments.cpp:18
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligaments
std::vector< std::shared_ptr< Ligament > > & ligaments()
Returns all the ligaments. It sorts the ligaments by group.
Definition
Ligaments.cpp:336
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligamentsLengthJacobian
utils::Matrix ligamentsLengthJacobian() const
Return the previously computed ligament length jacobian.
Definition
Ligaments.cpp:278
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::addLigament
void addLigament(const Ligament &ligament)
Add a ligament to the set of ligaments.
Definition
Ligaments.cpp:80
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::DeepCopy
Ligaments DeepCopy() const
Deep copy of ligaments.
Definition
Ligaments.cpp:30
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligament
Ligament & ligament(size_t idx)
Returns a specific ligament sorted by ligaments().
Definition
Ligaments.cpp:67
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::ligamentNames
std::vector< utils::String > ligamentNames() const
ligamentNames Return the names for all the ligament ordered by their respective name
Definition
Ligaments.cpp:107
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::computeLigamentsLengthJacobian
utils::Matrix computeLigamentsLengthJacobian(const rigidbody::Joints &model) const
Assemble the ligament length jacobian using the provided model.
Definition
Ligaments.cpp:286
BIORBD_NAMESPACE::internal_forces::ligaments::Ligaments::nbLigaments
size_t nbLigaments() const
Return the total number of ligament.
Definition
Ligaments.cpp:331
BIORBD_NAMESPACE::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition
GeneralizedCoordinates.h:15
BIORBD_NAMESPACE::rigidbody::GeneralizedTorque
Class GeneralizedTorque.
Definition
GeneralizedTorque.h:15
BIORBD_NAMESPACE::rigidbody::GeneralizedVelocity
Class GeneralizedVelocity.
Definition
GeneralizedVelocity.h:15
BIORBD_NAMESPACE::rigidbody::Joints
This is the core of the musculoskeletal model in biorbd.
Definition
Joints.h:48
BIORBD_NAMESPACE::utils::Matrix
A wrapper for the Eigen::MatrixXd.
Definition
Matrix.h:18
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
BIORBD_NAMESPACE::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition
Vector3d.h:27
BIORBD_NAMESPACE::utils::Vector
Wrapper of the Eigen VectorXd.
Definition
Vector.h:21
include
InternalForces
Ligaments
Ligaments.h
Generated by
1.18.0