Biorbd
|
Class Geometry of the muscle. More...
#include <Geometry.h>
Public Member Functions | |
Geometry () | |
Construct geometry. | |
Geometry (const biorbd::utils::Vector3d &origin, const biorbd::utils::Vector3d &insertion) | |
Construct geometry. More... | |
biorbd::muscles::Geometry | DeepCopy () const |
Deep copy of a geometry. More... | |
void | DeepCopy (const biorbd::muscles::Geometry &other) |
Deep copy of a geometry from another geometry. More... | |
void | updateKinematics (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates *Q=nullptr, const biorbd::rigidbody::GeneralizedVelocity *Qdot=nullptr, int updateKin=2) |
Updates the position and dynamic elements of the muscles. More... | |
void | updateKinematics (biorbd::rigidbody::Joints &model, const biorbd::muscles::Characteristics &characteristics, biorbd::muscles::PathModifiers &pathModifiers, const biorbd::rigidbody::GeneralizedCoordinates *Q=nullptr, const biorbd::rigidbody::GeneralizedVelocity *Qdot=nullptr, int updateKin=2) |
Updates the position and dynamic elements of the muscles. More... | |
void | updateKinematics (std::vector< biorbd::utils::Vector3d > &musclePointsInGlobal, biorbd::utils::Matrix &jacoPointsInGlobal, const biorbd::rigidbody::GeneralizedVelocity *Qdot=nullptr) |
Updates the position and dynamic elements of the muscles by hand. More... | |
void | updateKinematics (std::vector< biorbd::utils::Vector3d > &musclePointsInGlobal, biorbd::utils::Matrix &jacoPointsInGlobal, const biorbd::muscles::Characteristics &characteristics, const biorbd::rigidbody::GeneralizedVelocity *Qdot=nullptr) |
Updates the position and dynamic elements of the muscles by hand. More... | |
void | setOrigin (const biorbd::utils::Vector3d &position) |
Set the origin position in the local reference frame of the muscle. More... | |
const biorbd::utils::Vector3d & | originInLocal () const |
Return the origin position. More... | |
void | setInsertionInLocal (const biorbd::utils::Vector3d &position) |
Set the insertion position. More... | |
const biorbd::utils::Vector3d & | insertionInLocal () const |
Return the insertion position. More... | |
const biorbd::utils::Vector3d & | originInGlobal () const |
Return the origin position in the global reference. More... | |
const biorbd::utils::Vector3d & | insertionInGlobal () const |
Return the insertion position in the global reference. More... | |
const std::vector< biorbd::utils::Vector3d > & | musclesPointsInGlobal () const |
Return the muscles points in the global reference. More... | |
const biorbd::utils::Scalar & | length () const |
Return the previously computed muscle length. More... | |
const biorbd::utils::Scalar & | musculoTendonLength () const |
Return the previously computed muscle-tendon length. More... | |
const biorbd::utils::Scalar & | velocity () const |
Return the previously computed velocity. More... | |
const biorbd::utils::Matrix & | jacobian () const |
Return the previously computed muscle jacobian. More... | |
biorbd::utils::Matrix | jacobianOrigin () const |
Return the gradient of the jacobian for the origin node. More... | |
biorbd::utils::Matrix | jacobianInsertion () const |
Return the gradient of the jacobian for the insertion node. More... | |
biorbd::utils::Matrix | jacobian (unsigned int idxViaPoint) const |
Return the gradient of the jacobian for the via specified node. More... | |
const biorbd::utils::Matrix & | jacobianLength () const |
Return the jacobian length of the muscle. More... | |
Protected Member Functions | |
void | _updateKinematics (const biorbd::rigidbody::GeneralizedVelocity *Qdot, const biorbd::muscles::Characteristics *characteristics=nullptr, biorbd::muscles::PathModifiers *pathModifiers=nullptr) |
Actual function that implements the update of the kinematics. More... | |
const biorbd::utils::Vector3d & | originInGlobal (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q) |
Updates the kinematics and return the position of the origin node. More... | |
const biorbd::utils::Vector3d & | insertionInGlobal (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q) |
Updates the kinematics and return the position of the insertion node. More... | |
void | setMusclesPointsInGlobal (std::vector< biorbd::utils::Vector3d > &ptsInGlobal) |
Set the muscle points in global. More... | |
void | setMusclesPointsInGlobal (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q, biorbd::muscles::PathModifiers *pathModifiers=nullptr) |
Set the muscle points in global. More... | |
const biorbd::utils::Scalar & | length (const biorbd::muscles::Characteristics *characteristics=nullptr, biorbd::muscles::PathModifiers *pathModifiers=nullptr) |
Update the kinematics, compute and return the muscle length. More... | |
const biorbd::utils::Scalar & | velocity (const biorbd::rigidbody::GeneralizedVelocity &Qdot) |
Update the kinematics, compute and return the muscle velocity assuming not via points nor wrapping objects. More... | |
void | setJacobianDimension (biorbd::rigidbody::Joints &model) |
Set the jacobian dimensions. More... | |
void | jacobian (const biorbd::utils::Matrix &jaco) |
Force a jacobian computed from the user. More... | |
void | jacobian (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q) |
Compute the jacobian. More... | |
void | computeJacobianLength () |
Compute the muscle length jacobian. | |
Protected Attributes | |
std::shared_ptr< biorbd::utils::Vector3d > | m_origin |
Origin node. | |
std::shared_ptr< biorbd::utils::Vector3d > | m_insertion |
Insertion node. | |
std::shared_ptr< biorbd::utils::Vector3d > | m_originInGlobal |
Position of the origin in the global reference. | |
std::shared_ptr< biorbd::utils::Vector3d > | m_insertionInGlobal |
Position of the insertion node in the global reference. | |
std::shared_ptr< std::vector< biorbd::utils::Vector3d > > | m_pointsInGlobal |
Position of all the points in the global reference. | |
std::shared_ptr< std::vector< biorbd::utils::Vector3d > > | m_pointsInLocal |
Position of all the points in local. | |
std::shared_ptr< biorbd::utils::Matrix > | m_jacobian |
The jacobian matrix. | |
std::shared_ptr< biorbd::utils::Matrix > | m_G |
Internal matrix of the jacobian dimension to speed up calculation. | |
std::shared_ptr< biorbd::utils::Matrix > | m_jacobianLength |
The muscle length jacobian. | |
std::shared_ptr< biorbd::utils::Scalar > | m_length |
Muscle length. | |
std::shared_ptr< biorbd::utils::Scalar > | m_muscleTendonLength |
Muscle tendon length. | |
std::shared_ptr< biorbd::utils::Scalar > | m_velocity |
Velocity of the muscular elongation. | |
std::shared_ptr< bool > | m_isGeometryComputed |
To know if the geometry was computed at least once. | |
std::shared_ptr< bool > | m_isVelocityComputed |
To know if the velocity was computed in the last update. | |
std::shared_ptr< bool > | m_posAndJacoWereForced |
To know if the override was used on the muscle position and the Jacobian. | |
Class Geometry of the muscle.
Definition at line 29 of file Geometry.h.
biorbd::muscles::Geometry::Geometry | ( | const biorbd::utils::Vector3d & | origin, |
const biorbd::utils::Vector3d & | insertion | ||
) |
Construct geometry.
origin | The origin node of the muscle |
insertion | The insertion node of the muscle |
Definition at line 38 of file Geometry.cpp.
|
protected |
Actual function that implements the update of the kinematics.
Qdot | The generalized velocities |
characteristics | The muscle characteristics |
pathModifiers | The set of path modifiers |
Definition at line 269 of file Geometry.cpp.
biorbd::muscles::Geometry biorbd::muscles::Geometry::DeepCopy | ( | ) | const |
Deep copy of a geometry.
Definition at line 60 of file Geometry.cpp.
void biorbd::muscles::Geometry::DeepCopy | ( | const biorbd::muscles::Geometry & | other | ) |
Deep copy of a geometry from another geometry.
other | The geometry to copy |
Definition at line 67 of file Geometry.cpp.
const biorbd::utils::Vector3d & biorbd::muscles::Geometry::insertionInGlobal | ( | ) | const |
Return the insertion position in the global reference.
Geometry (updateKin) must be computed at least once before calling
Definition at line 211 of file Geometry.cpp.
|
protected |
Updates the kinematics and return the position of the insertion node.
model | The joint model |
Q | The generalized coordinates of the model |
Definition at line 297 of file Geometry.cpp.
const biorbd::utils::Vector3d & biorbd::muscles::Geometry::insertionInLocal | ( | ) | const |
Return the insertion position.
Definition at line 200 of file Geometry.cpp.
const biorbd::utils::Matrix & biorbd::muscles::Geometry::jacobian | ( | ) | const |
Return the previously computed muscle jacobian.
Definition at line 240 of file Geometry.cpp.
|
protected |
Compute the jacobian.
model | The joint model |
Q | The generalize coordinates |
Definition at line 445 of file Geometry.cpp.
|
protected |
Force a jacobian computed from the user.
jaco | The jacobian |
Definition at line 439 of file Geometry.cpp.
biorbd::utils::Matrix biorbd::muscles::Geometry::jacobian | ( | unsigned int | idxViaPoint | ) | const |
Return the gradient of the jacobian for the via specified node.
idxViaPoint the index of the via point (0 being the the origin)
Definition at line 255 of file Geometry.cpp.
biorbd::utils::Matrix biorbd::muscles::Geometry::jacobianInsertion | ( | ) | const |
Return the gradient of the jacobian for the insertion node.
Definition at line 250 of file Geometry.cpp.
const biorbd::utils::Matrix & biorbd::muscles::Geometry::jacobianLength | ( | ) | const |
Return the jacobian length of the muscle.
Definition at line 261 of file Geometry.cpp.
biorbd::utils::Matrix biorbd::muscles::Geometry::jacobianOrigin | ( | ) | const |
Return the gradient of the jacobian for the origin node.
Definition at line 245 of file Geometry.cpp.
const biorbd::utils::Scalar & biorbd::muscles::Geometry::length | ( | ) | const |
Return the previously computed muscle length.
Definition at line 223 of file Geometry.cpp.
|
protected |
Update the kinematics, compute and return the muscle length.
characteristics | The muscle characteristics |
pathModifiers | The set of path modifiers |
Definition at line 389 of file Geometry.cpp.
const std::vector< biorbd::utils::Vector3d > & biorbd::muscles::Geometry::musclesPointsInGlobal | ( | ) | const |
Return the muscles points in the global reference.
Geometry (updateKin) must be computed at least once before calling. Return already computed via points
Definition at line 216 of file Geometry.cpp.
const biorbd::utils::Scalar & biorbd::muscles::Geometry::musculoTendonLength | ( | ) | const |
Return the previously computed muscle-tendon length.
Definition at line 228 of file Geometry.cpp.
const biorbd::utils::Vector3d & biorbd::muscles::Geometry::originInGlobal | ( | ) | const |
Return the origin position in the global reference.
Geometry (updateKin) must be computed at least once before calling originInLocal()
Definition at line 206 of file Geometry.cpp.
|
protected |
Updates the kinematics and return the position of the origin node.
model | The joint model |
Q | The generalized coordinates of the model |
Definition at line 288 of file Geometry.cpp.
const biorbd::utils::Vector3d & biorbd::muscles::Geometry::originInLocal | ( | ) | const |
void biorbd::muscles::Geometry::setInsertionInLocal | ( | const biorbd::utils::Vector3d & | position | ) |
Set the insertion position.
position | The insertion position value to set |
Definition at line 195 of file Geometry.cpp.
|
protected |
Set the jacobian dimensions.
model | The joint model |
Definition at line 433 of file Geometry.cpp.
|
protected |
Set the muscle points in global.
model | The joint model |
Q | The generalized coordinates of the model |
pathModifiers | The set of path modifiers |
Definition at line 314 of file Geometry.cpp.
|
protected |
Set the muscle points in global.
ptsInGlobal | The new muscle points in global |
Definition at line 306 of file Geometry.cpp.
void biorbd::muscles::Geometry::setOrigin | ( | const biorbd::utils::Vector3d & | position | ) |
Set the origin position in the local reference frame of the muscle.
position | The origin position to set |
Definition at line 185 of file Geometry.cpp.
void biorbd::muscles::Geometry::updateKinematics | ( | biorbd::rigidbody::Joints & | model, |
const biorbd::muscles::Characteristics & | characteristics, | ||
biorbd::muscles::PathModifiers & | pathModifiers, | ||
const biorbd::rigidbody::GeneralizedCoordinates * | Q = nullptr , |
||
const biorbd::rigidbody::GeneralizedVelocity * | Qdot = nullptr , |
||
int | updateKin = 2 |
||
) |
Updates the position and dynamic elements of the muscles.
model | The joint model |
characteristics | The muscle characteristics |
pathModifiers | The path modifiers |
Q | The generalized coordinates of the joints (not needed if updateKin is less than 2) |
Qdot | The generalized velocities of the joints (not needed if updateKin is less than 2) |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
Definition at line 120 of file Geometry.cpp.
void biorbd::muscles::Geometry::updateKinematics | ( | biorbd::rigidbody::Joints & | model, |
const biorbd::rigidbody::GeneralizedCoordinates * | Q = nullptr , |
||
const biorbd::rigidbody::GeneralizedVelocity * | Qdot = nullptr , |
||
int | updateKin = 2 |
||
) |
Updates the position and dynamic elements of the muscles.
model | The joint model |
Q | The generalized coordinates of the joints (not needed if updateKin is less than 2) |
Qdot | The generalized velocities of the joints (not needed if updateKin is less than 2) |
updateKin | Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles]) |
updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
Definition at line 92 of file Geometry.cpp.
void biorbd::muscles::Geometry::updateKinematics | ( | std::vector< biorbd::utils::Vector3d > & | musclePointsInGlobal, |
biorbd::utils::Matrix & | jacoPointsInGlobal, | ||
const biorbd::muscles::Characteristics & | characteristics, | ||
const biorbd::rigidbody::GeneralizedVelocity * | Qdot = nullptr |
||
) |
Updates the position and dynamic elements of the muscles by hand.
musclePointsInGlobal | Position of all the points in global |
jacoPointsInGlobal | Position of all the Jacobian points in global |
characteristics | The muscle characteristics |
Qdot | The generalized velocities of the joints |
updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
Definition at line 166 of file Geometry.cpp.
void biorbd::muscles::Geometry::updateKinematics | ( | std::vector< biorbd::utils::Vector3d > & | musclePointsInGlobal, |
biorbd::utils::Matrix & | jacoPointsInGlobal, | ||
const biorbd::rigidbody::GeneralizedVelocity * | Qdot = nullptr |
||
) |
Updates the position and dynamic elements of the muscles by hand.
musclePointsInGlobal | Position of all the points in global |
jacoPointsInGlobal | Position of all the Jacobian points in global |
Qdot | The generalized velocities of the joints |
updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
Definition at line 149 of file Geometry.cpp.
const biorbd::utils::Scalar & biorbd::muscles::Geometry::velocity | ( | ) | const |
Return the previously computed velocity.
Definition at line 233 of file Geometry.cpp.
|
protected |
Update the kinematics, compute and return the muscle velocity assuming not via points nor wrapping objects.
Qdot | The generalized velocities |
Definition at line 425 of file Geometry.cpp.