|
Biorbd
|
Description of a segment. More...
#include <Segment.h>
Public Member Functions | |
| Segment () | |
| Construct a Segment. | |
| Segment (biorbd::rigidbody::Joints &model, const biorbd::utils::String &name, const biorbd::utils::String &parentName, const biorbd::utils::String &seqT, const biorbd::utils::String &seqR, const std::vector< biorbd::utils::Range > &QRanges, const std::vector< biorbd::utils::Range > &QDotRanges, const std::vector< biorbd::utils::Range > &QDDotRanges, const biorbd::rigidbody::SegmentCharacteristics &characteristics, const RigidBodyDynamics::Math::SpatialTransform &cor, int PF=-1) | |
| Construct a Segment. More... | |
| Segment (biorbd::rigidbody::Joints &model, const biorbd::utils::String &name, const biorbd::utils::String &parentName, const biorbd::utils::String &seqR, const std::vector< biorbd::utils::Range > &QRanges, const std::vector< biorbd::utils::Range > &QDotRanges, const std::vector< biorbd::utils::Range > &QDDotRanges, const biorbd::rigidbody::SegmentCharacteristics &characteristics, const RigidBodyDynamics::Math::SpatialTransform &cor, int PF=-1) | |
| Construct a Segment. More... | |
| biorbd::rigidbody::Segment | DeepCopy () const |
| Create a deep copy of Segment. More... | |
| void | DeepCopy (const biorbd::rigidbody::Segment &other) |
| Deep copy of Segment. More... | |
| virtual | ~Segment () |
| Destroy the class properly. | |
| unsigned int | id () const |
| Return the Segment index. More... | |
| int | platformIdx () const |
| Return the platform index. More... | |
| const biorbd::utils::String & | seqT () const |
| Return the translation sequence in text. More... | |
| const biorbd::utils::String & | seqR () const |
| Return the angle sequence in text. More... | |
| const std::vector< biorbd::utils::Range > & | QRanges () const |
| Return the ranges for all the dof, translations and rotations respectively. More... | |
| const std::vector< biorbd::utils::Range > & | QDotRanges () const |
| Return the ranges for all the dof velocity, translations and rotations respectively. More... | |
| const std::vector< biorbd::utils::Range > & | QDDotRanges () const |
| Return the ranges for all the dof acceleration, translations and rotations respectively. More... | |
| unsigned int | nbDof () const |
| Return the number of DoF of the segment. More... | |
| unsigned int | nbDofTrans () const |
| Return the number of translation DoF of the segment. More... | |
| unsigned int | nbDofRot () const |
| Return the number of rotation DoF of the segment. More... | |
| unsigned int | nbQ () const |
| Return the number of generalized coordinates. More... | |
| unsigned int | nbQdot () const |
| Return the number of generalized velocities. More... | |
| unsigned int | nbQddot () const |
| Return the number of generalized accelerations. More... | |
| unsigned int | nbGeneralizedTorque () const |
| Return the number of generalized torque. More... | |
| unsigned int | getDofIdx (const biorbd::utils::String &dofName) const |
| Return the index of a specified DoF. More... | |
| const biorbd::utils::String & | nameDof (const unsigned int i) const |
| Return the name of the specified DoF. More... | |
| biorbd::utils::RotoTrans | localJCS () const |
| Return the joint coordinate system (JCS) in the parent reference frame. More... | |
| const biorbd::rigidbody::SegmentCharacteristics & | characteristics () const |
| Return the segment characteristics. More... | |
| bool | isRotationAQuaternion () const |
| Return if the rotation DoF of this segment is a quaternion. More... | |
Public Member Functions inherited from biorbd::utils::Node | |
| Node () | |
| Construct Node. | |
| Node (const biorbd::utils::Node &other) | |
| Construct Node from another node. More... | |
| Node (const biorbd::utils::String &name) | |
| Construct Node. More... | |
| Node (const biorbd::utils::String &name, const biorbd::utils::String &parentName) | |
| Construct Node. More... | |
| virtual | ~Node () |
| Destroy class properly. | |
| void | DeepCopy (const biorbd::utils::Node &other) |
| Deep copy of the node in another node. More... | |
| void | setName (const biorbd::utils::String &name) |
| Set the name of the node. More... | |
| const biorbd::utils::String & | name () const |
| Return the name of the node. | |
| const biorbd::utils::String & | parent () const |
| Return the parent name of the node. | |
| void | setParent (const biorbd::utils::String &name) |
| Set the parent name of the node. More... | |
| biorbd::utils::NODE_TYPE | typeOfNode () const |
| Return the type of node. | |
Protected Member Functions | |
| void | setType () |
| Set the type of the segment. | |
| void | setPF (int idx) |
| Set the platform index. | |
| void | setDofs (biorbd::rigidbody::Joints &model, const biorbd::utils::String &seqT, const biorbd::utils::String &seqR, const std::vector< biorbd::utils::Range > &QRanges, const std::vector< biorbd::utils::Range > &QDotRanges, const std::vector< biorbd::utils::Range > &QDDotRanges) |
| Set the DoF. More... | |
| void | setNumberOfDof (unsigned int nbTrans, unsigned int nbRot) |
| Set the total number of DoF. More... | |
| void | determineIfRotIsQuaternion (const biorbd::utils::String &seqR) |
| Determines if DoF in rotation is a Quaternion. More... | |
| void | setSequence (const biorbd::utils::String &seqT, const biorbd::utils::String &seqR) |
| Set angle and translation sequences, adjust angle sequence and redeclare if is necessary. More... | |
| void | fillSequence () |
| Fill the transation and rotation sequences. More... | |
| void | str2numSequence (std::vector< unsigned int > &sequenceInteger, const biorbd::utils::String &sequenceText) |
| Convert a text sequence to its number counterpart (x = 0, y = 1, z = 2, q = 3) More... | |
| void | str2numSequence (const biorbd::utils::String &seqT, const biorbd::utils::String &seqR) |
| Store the sequences. More... | |
| virtual void | setJoints (biorbd::rigidbody::Joints &model) |
| Function that adds the segment to the RBDL body set. More... | |
| virtual void | setJointAxis () |
| Determine the rotation axis in relation to the requested sequence. | |
| void | setDofCharacteristicsOnLastBody () |
| Set the DoF segment characteristics on the last body. More... | |
Protected Attributes | |
| std::shared_ptr< int > | m_idxPF |
| Platform index which acts on the segment. | |
| std::shared_ptr< RigidBodyDynamics::Math::SpatialTransform > | m_cor |
| Attitude of the segment in parent reference frame. | |
| std::shared_ptr< biorbd::utils::String > | m_seqT |
| Translation sequence. | |
| std::shared_ptr< biorbd::utils::String > | m_seqR |
| Euler rotation sequence. | |
| std::shared_ptr< std::vector< biorbd::utils::Range > > | m_QRanges |
| Minimum and maximum coordinate values that each dof should hold. This is only prescriptive and can be ignored when setting the GeneralizedCoordinates. | |
| std::shared_ptr< std::vector< biorbd::utils::Range > > | m_QDotRanges |
| Minimum and maximum velocity values that each dof should hold. This is only prescriptive and can be ignored when setting the GeneralizedVelocities. | |
| std::shared_ptr< std::vector< biorbd::utils::Range > > | m_QDDotRanges |
| Minimum and maximum acceleration values that each dof should hold. This is only prescriptive and can be ignored when setting the GeneralizedAccelerations. | |
| std::shared_ptr< unsigned int > | m_nbDof |
| Number of degrees of freedom. | |
| std::shared_ptr< unsigned int > | m_nbQdot |
| Number of generalized velocities. | |
| std::shared_ptr< unsigned int > | m_nbQddot |
| Number of generalized accelerations. | |
| std::shared_ptr< unsigned int > | m_nbDofTrue |
| Number of degrees of freedom including the extra DoF when there is a quaternion. | |
| std::shared_ptr< unsigned int > | m_nbDofTrueOutside |
| Number of degree of freedom read from the outside (Same as nDof except if Quaternion) | |
| std::shared_ptr< unsigned int > | m_nbDofTrans |
| Number of degrees of freedom in translation. | |
| std::shared_ptr< unsigned int > | m_nbDofRot |
| Number of degrees of freedom in rotation. | |
| std::shared_ptr< unsigned int > | m_nbDofQuat |
| Number of degrees of freedom in rotation if expressed in quaternion. | |
| std::shared_ptr< bool > | m_isQuaternion |
| If DoF in rotation is a Quaternion. | |
| std::shared_ptr< std::vector< RigidBodyDynamics::Joint > > | m_dof |
| Actual DoF: t1, t2, t3, r1, r2, r3; where the order depends on seqT and seqR. | |
| std::shared_ptr< std::vector< unsigned int > > | m_idxDof |
| Index of the parent segment. | |
| std::shared_ptr< std::vector< unsigned int > > | m_sequenceTrans |
| Translation sequence. | |
| std::shared_ptr< std::vector< unsigned int > > | m_sequenceRot |
| Euler rotation sequence. | |
| std::shared_ptr< std::vector< biorbd::utils::String > > | m_nameDof |
| To store the DoF names. | |
| std::shared_ptr< std::vector< unsigned int > > | m_dofPosition |
| Position in the x, y, and z sequence. | |
| std::shared_ptr< biorbd::rigidbody::SegmentCharacteristics > | m_characteristics |
| Non-used virtual segment; it allows to "save" the data and to avoid the use of multiple intermediate variables. | |
| std::shared_ptr< std::vector< biorbd::rigidbody::SegmentCharacteristics > > | m_dofCharacteristics |
| Variable containing the inertial data and other from each segment (on a 6DoF segment, 0 to 4 should be empty and 5 filled) | |
Protected Attributes inherited from biorbd::utils::Node | |
| std::shared_ptr< biorbd::utils::String > | m_name |
| The name of the node. | |
| std::shared_ptr< biorbd::utils::String > | m_parentName |
| The parent name of the node. | |
| std::shared_ptr< biorbd::utils::NODE_TYPE > | m_typeOfNode |
| The type of the node. | |
| biorbd::rigidbody::Segment::Segment | ( | biorbd::rigidbody::Joints & | model, |
| const biorbd::utils::String & | name, | ||
| const biorbd::utils::String & | parentName, | ||
| const biorbd::utils::String & | seqT, | ||
| const biorbd::utils::String & | seqR, | ||
| const std::vector< biorbd::utils::Range > & | QRanges, | ||
| const std::vector< biorbd::utils::Range > & | QDotRanges, | ||
| const std::vector< biorbd::utils::Range > & | QDDotRanges, | ||
| const biorbd::rigidbody::SegmentCharacteristics & | characteristics, | ||
| const RigidBodyDynamics::Math::SpatialTransform & | cor, | ||
| int | PF = -1 |
||
| ) |
Construct a Segment.
| model | The joint model |
| name | The name of the segment |
| parentName | The name of the parent segment |
| seqT | Sequence of the translations |
| seqR | Angle sequence of the Euler rotations |
| QRanges | Ranges of the translations and rotations dof. The length of QRanges must be equal to length of translations and rotations |
| QDotRanges | Ranges of the translations and rotations dof velocity. The length of QDotRanges must be equal to length of translations and rotations |
| QDDotRanges | Ranges of the translations and rotations dof acceleration. The length of QDDotRanges must be equal to length of translations and rotations |
| characteristics | of the segment (mass, center of mass, inertia, etc.) |
| cor | Transformation in parent reference frame |
| PF | Platform index attached to the body (-1 means no force platform acts on the body) |
Definition at line 44 of file Segment.cpp.
| biorbd::rigidbody::Segment::Segment | ( | biorbd::rigidbody::Joints & | model, |
| const biorbd::utils::String & | name, | ||
| const biorbd::utils::String & | parentName, | ||
| const biorbd::utils::String & | seqR, | ||
| const std::vector< biorbd::utils::Range > & | QRanges, | ||
| const std::vector< biorbd::utils::Range > & | QDotRanges, | ||
| const std::vector< biorbd::utils::Range > & | QDDotRanges, | ||
| const biorbd::rigidbody::SegmentCharacteristics & | characteristics, | ||
| const RigidBodyDynamics::Math::SpatialTransform & | cor, | ||
| int | PF = -1 |
||
| ) |
Construct a Segment.
| model | The joint model |
| name | The name of the segment |
| parentName | The name of the parent segment |
| seqR | Angle sequence of the Euler rotations |
| QRanges | Ranges of the translations and rotations dof. The length of QRanges must be equal to length of translations and rotations |
| QDotRanges | Ranges of the translations and rotations dof velocity. The length of QDotRanges must be equal to length of translations and rotations |
| QDDotRanges | Ranges of the translations and rotations dof acceleration. The length of QDDotRanges must be equal to length of translations and rotations |
| characteristics | of the segment (mass, center of mass, inertia, etc.) |
| cor | Transformation in parent reference frame |
| PF | Platform index attached to the body (-1 means no force platform acts on the body) |
Definition at line 89 of file Segment.cpp.
| const biorbd::rigidbody::SegmentCharacteristics & biorbd::rigidbody::Segment::characteristics | ( | ) | const |
Return the segment characteristics.
Definition at line 264 of file Segment.cpp.
| biorbd::rigidbody::Segment biorbd::rigidbody::Segment::DeepCopy | ( | ) | const |
| void biorbd::rigidbody::Segment::DeepCopy | ( | const biorbd::rigidbody::Segment & | other | ) |
Deep copy of Segment.
| other | The Segment to copy |
Definition at line 142 of file Segment.cpp.
|
protected |
Determines if DoF in rotation is a Quaternion.
| seqR | Cardan sequence to classify the DoF in rotation |
If seqR is equal to "q" then it is a quaternion
Definition at line 304 of file Segment.cpp.
|
protected |
Fill the transation and rotation sequences.
Places the translations first, followed by the rotations in the asked order.
Definition at line 382 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::getDofIdx | ( | const biorbd::utils::String & | dofName | ) | const |
Return the index of a specified DoF.
Definition at line 489 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::id | ( | ) | const |
| bool biorbd::rigidbody::Segment::isRotationAQuaternion | ( | ) | const |
Return if the rotation DoF of this segment is a quaternion.
Definition at line 181 of file Segment.cpp.
| biorbd::utils::RotoTrans biorbd::rigidbody::Segment::localJCS | ( | ) | const |
Return the joint coordinate system (JCS) in the parent reference frame.
Definition at line 261 of file Segment.cpp.
| const biorbd::utils::String & biorbd::rigidbody::Segment::nameDof | ( | const unsigned int | i | ) | const |
Return the name of the specified DoF.
Definition at line 227 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbDof | ( | ) | const |
Return the number of DoF of the segment.
Definition at line 203 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbDofRot | ( | ) | const |
Return the number of rotation DoF of the segment.
Definition at line 209 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbDofTrans | ( | ) | const |
Return the number of translation DoF of the segment.
Definition at line 206 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbGeneralizedTorque | ( | ) | const |
Return the number of generalized torque.
This value is equal to nbQddot
Definition at line 200 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbQ | ( | ) | const |
Return the number of generalized coordinates.
Definition at line 212 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbQddot | ( | ) | const |
Return the number of generalized accelerations.
Definition at line 218 of file Segment.cpp.
| unsigned int biorbd::rigidbody::Segment::nbQdot | ( | ) | const |
Return the number of generalized velocities.
Definition at line 215 of file Segment.cpp.
| int biorbd::rigidbody::Segment::platformIdx | ( | ) | const |
| const std::vector< biorbd::utils::Range > & biorbd::rigidbody::Segment::QDDotRanges | ( | ) | const |
Return the ranges for all the dof acceleration, translations and rotations respectively.
Definition at line 256 of file Segment.cpp.
| const std::vector< biorbd::utils::Range > & biorbd::rigidbody::Segment::QDotRanges | ( | ) | const |
Return the ranges for all the dof velocity, translations and rotations respectively.
Definition at line 250 of file Segment.cpp.
| const std::vector< biorbd::utils::Range > & biorbd::rigidbody::Segment::QRanges | ( | ) | const |
Return the ranges for all the dof, translations and rotations respectively.
Definition at line 244 of file Segment.cpp.
| const biorbd::utils::String & biorbd::rigidbody::Segment::seqR | ( | ) | const |
Return the angle sequence in text.
Definition at line 238 of file Segment.cpp.
| const biorbd::utils::String & biorbd::rigidbody::Segment::seqT | ( | ) | const |
Return the translation sequence in text.
Definition at line 233 of file Segment.cpp.
|
protected |
Set the DoF segment characteristics on the last body.
The idea is that since a segment is described by all of its DoF, the inertia and masses must be put on the last body
Definition at line 395 of file Segment.cpp.
|
protected |
Set the DoF.
| model | The joint model |
| seqT | Sequence of the translations |
| seqR | Angle sequence of the Euler rotations |
| QRanges | Ranges of the translations and rotations dof. The length of QRanges must be equal to length of translations and rotations |
| QDotRanges | Ranges of the translations and rotations dof velocity. The length of QDotRanges must be equal to length of translations and rotations |
| QDDotRanges | Ranges of the translations and rotations dof acceleration. The length of QDDotRanges must be equal to length of translations and rotations |
Definition at line 268 of file Segment.cpp.
|
protectedvirtual |
Function that adds the segment to the RBDL body set.
| model | The joint model |
Definition at line 444 of file Segment.cpp.
|
protected |
Set the total number of DoF.
| nbTrans | Number of translation DoF |
| nbRot | Number of rotation DoF |
Definition at line 355 of file Segment.cpp.
|
protected |
Set angle and translation sequences, adjust angle sequence and redeclare if is necessary.
| seqT | Sequence of the translations |
| seqR | Angle sequence of the Euler rotations |
Definition at line 377 of file Segment.cpp.
|
protected |
Store the sequences.
| seqT | Sequence of the translations |
| seqR | Angle sequence of the Euler rotations |
Definition at line 311 of file Segment.cpp.
|
protected |
Convert a text sequence to its number counterpart (x = 0, y = 1, z = 2, q = 3)
| sequenceInteger | Initialized vector into which the results should be placed in |
| sequenceText | The sequence to convert |
Definition at line 337 of file Segment.cpp.
1.8.18