class
#include <iDynTree/FixedJoint.h>
FixedJoint Class representing a fixed joint, i.e.
a joint that rigidly attaches two links.
Base classes
- class IJoint
- Interface (i.e.
Constructors, destructors, conversion operators
- FixedJoint() explicit
- Default constructor.
- FixedJoint(const LinkIndex link1, const LinkIndex link2, const Transform& link1_X_link2)
- Constructor.
- FixedJoint(const Transform& link1_X_link2)
- Constructor in which the LinkIndex to which the joint is attached are not specified.
- FixedJoint(const FixedJoint& other)
- Copy constructor.
- ~FixedJoint() virtual
- Destructor.
Public functions
- auto clone() const -> IJoint* virtual
- Clone the joint object.
- auto getNrOfPosCoords() const -> unsigned int virtual
- Get the number of coordinates used to represent the position of the joint.
- auto getNrOfDOFs() const -> unsigned int virtual
- Get the number of degrees of freedom of the joint.
- void setAttachedLinks(const LinkIndex link1, const LinkIndex link2) virtual
- Set the two links at which the joint is attached.
- void setRestTransform(const Transform& link1_X_link2) virtual
- Set the transform between the link2 frame and link1 frame at joint position 0 (or at the identity configuration element for complex joints).
- auto getFirstAttachedLink() const -> LinkIndex virtual
- Get the first link attached to the joint.
- auto getSecondAttachedLink() const -> LinkIndex virtual
- Get the second link attached to the joint.
- auto getRestTransform(const LinkIndex child, const LinkIndex parent) const -> Transform virtual
- Get the transform between the link parent and the link child at joint position 0 (or at the identity configuration element for complex joints).
- auto getTransform(const VectorDynSize& jntPos, const LinkIndex child, const LinkIndex parent) const -> const Transform& virtual
- Get the transform between the parent and the child, such that: p_child = child_H_parent*p_parent, where p_child is a quantity expressed in the child frame, and p_parent is a quantity expressed in the parent frame.
- auto getTransformDerivative(const VectorDynSize& jntPos, const LinkIndex child, const LinkIndex parent, const int posCoord_i) const -> TransformDerivative virtual
- Get the derivative of the transform with respect to a position coordinate.
- auto getMotionSubspaceVector(int dof_i, const LinkIndex child, const LinkIndex parent) const -> SpatialMotionVector virtual
- Get the motion subspace vector corresponding to the i-th dof of the joint, i.e.
- void computeChildPosVelAcc(const VectorDynSize& jntPos, const VectorDynSize& jntVel, const VectorDynSize& jntAcc, LinkPositions& linkPositions, LinkVelArray& linkVels, LinkAccArray& linkAccs, const LinkIndex child, const LinkIndex parent) const virtual
- Compute the position, velocity and acceleration of link child, given the position, velocty and acceleration of link parent and the joint position, velocity and acceleration.
- void computeChildVelAcc(const VectorDynSize& jntPos, const VectorDynSize& jntVel, const VectorDynSize& jntAcc, LinkVelArray& linkVels, LinkAccArray& linkAccs, const LinkIndex child, const LinkIndex parent) const virtual
- Compute the velocity and acceleration of child, given the velocity and acceleration of parent and the joint position, velocity and acceleration.
- void computeChildVel(const VectorDynSize& jntPos, const VectorDynSize& jntVel, LinkVelArray& linkVels, const LinkIndex child, const LinkIndex parent) const virtual
- Compute the velocity of child, given the velocity of parent and the joint position, velocity.
- void computeChildAcc(const VectorDynSize& jntPos, const VectorDynSize& jntVel, const LinkVelArray& linkVels, const VectorDynSize& jntAcc, LinkAccArray& linkAccs, const LinkIndex child, const LinkIndex parent) const virtual
- Compute the (body-fixed) acceleration of a child link given the (body-fixed) acceleration of the parent.
- void computeChildBiasAcc(const VectorDynSize& jntPos, const VectorDynSize& jntVel, const LinkVelArray& linkVels, LinkAccArray& linkBiasAccs, const LinkIndex child, const LinkIndex parent) const virtual
- Compute the (body-fixed) bias acceleration of a child link given the (body-fixed) bias acceleration of the parent.
- void computeJointTorque(const VectorDynSize& jntPos, const Wrench& internalWrench, const LinkIndex linkThatAppliesWrench, const LinkIndex linkOnWhichWrenchIsApplied, VectorDynSize& jntTorques) const virtual
- Compute the internal torque of joint, given the internal wrench that the linkThatAppliesWrench applies on the linkOnWhichWrenchIsApplied, expressed in the link frame of the linkOnWhichWrenchIsApplied.
- void setIndex(JointIndex& _index) virtual
- Set the index of the joint in the Model Joint serialization.
- auto getIndex() const -> JointIndex virtual
- Get the index of the joint in the model Joint serialization.
- void setPosCoordsOffset(const size_t _index) virtual
- Set the offset of the position coordinates of this joint in the position coordiantes serialization of the model.
- auto getPosCoordsOffset() const -> size_t virtual
- Get the offset of the position coordinates of this joint in the position coordiantes serialization of the model.
- void setDOFsOffset(const size_t _index) virtual
- Set the offset of the coordinates of this joint in the velocity/acceleration coordiantes serialization of the model.
- auto getDOFsOffset() const -> size_t virtual
- Get the offset of the position coordinates of joint in the velocity/acceleration coordiantes serialization of the model.
- auto hasPosLimits() const -> bool virtual
- Method to check if the joint has limits.
- auto enablePosLimits(const bool enable) -> bool virtual
- Method to set if the joint has limits.
- auto getPosLimits(const size_t _index, double& min, double& max) const -> bool virtual
- Get min and max position limits of the joint, for the _index dof.
- auto getMinPosLimit(const size_t _index) const -> double virtual
- Get the min position limit of the joint, bindings-friendly version.
- auto getMaxPosLimit(const size_t _index) const -> double virtual
- Get the max position limit of the joint, bindings-friendly version.
- auto setPosLimits(const size_t _index, double min, double max) -> bool virtual
- Set the position limits for a dof the joint.
- auto getJointDynamicsType() const -> JointDynamicsType virtual
- Method to get the specific joint dynamics type used for the joint.
- auto setJointDynamicsType(const JointDynamicsType enable) -> bool virtual
- Method to get the specific joint dynamics type used for the joint.
- auto getDamping(const size_t _index) const -> double virtual
- Get the damping coefficient of the joint.
- auto getStaticFriction(const size_t _index) const -> double virtual
- Get the static friction coefficient of the joint.
- auto setDamping(const size_t _index, double damping) -> bool virtual
- Set damping parameter of the joint, for the _index dof.
- auto setStaticFriction(const size_t _index, double staticFriction) -> bool virtual
- Set static friction parameter of the joint, for the _index dof.
Function documentation
iDynTree:: FixedJoint:: FixedJoint() explicit
Default constructor.
The joint is initialized with an Identity rest transform. You can call setRestTransform to set the rest transform at a second stage.
iDynTree:: FixedJoint:: FixedJoint(const Transform& link1_X_link2)
Constructor in which the LinkIndex to which the joint is attached are not specified.
This constructor is tipically used together with the Model::
unsigned int iDynTree:: FixedJoint:: getNrOfPosCoords() const virtual
Get the number of coordinates used to represent the position of the joint.
Returns | the number of position coordinates. |
---|
For joints whose configuration is in R^n, the number of position coordinates should match the number of degrees of freedom of the joint.
unsigned int iDynTree:: FixedJoint:: getNrOfDOFs() const virtual
Get the number of degrees of freedom of the joint.
Returns | the number of degrees of freedom of the joint. |
---|
This should be a number between 0 (fixed joint) and 6 (free joint).
void iDynTree:: FixedJoint:: setAttachedLinks(const LinkIndex link1,
const LinkIndex link2) virtual
Set the two links at which the joint is attached.
Parameters | |
---|---|
link1 | is the first link |
link2 | is the second link |
void iDynTree:: FixedJoint:: setRestTransform(const Transform& link1_X_link2) virtual
Set the transform between the link2 frame and link1 frame at joint position 0 (or at the identity configuration element for complex joints).
The link1_T_link2 is transform that transforms a quantity expressed in link2 frame in a quantity expressed in the link1 frame, when the joint is in the 0 position : p_link1 = link1_T_link2*p_link2 .
Transform iDynTree:: FixedJoint:: getRestTransform(const LinkIndex child,
const LinkIndex parent) const virtual
Get the transform between the link parent and the link child at joint position 0 (or at the identity configuration element for complex joints).
Such that: p_child = child_H_parent*p_parent where p_child is a quantity expressed in the child frame, and p_parent is a quantity expressed in the child frame.
TransformDerivative iDynTree:: FixedJoint:: getTransformDerivative(const VectorDynSize& jntPos,
const LinkIndex child,
const LinkIndex parent,
const int posCoord_i) const virtual
Get the derivative of the transform with respect to a position coordinate.
In particular, if the selected position coordinate is , return the derivative:
If posCoord_i is not >= 0 and < getNrOfPosCoords(), the returned value is undefined.
SpatialMotionVector iDynTree:: FixedJoint:: getMotionSubspaceVector(int dof_i,
const LinkIndex child,
const LinkIndex parent) const virtual
Get the motion subspace vector corresponding to the i-th dof of the joint, i.e.
Returns | the motion subspace vector. |
---|
the i-th column of the motion subspace matrix. The motion subspace matrix is the matrix that maps the joint velocity to the relative twist between the two links.
In particular the motion subspace vector of the i-th dof is the S vector such that v_child = S_{child,parent}*dq_i + child_X_parent*v_parent if the velocities associated to all other DOFs of the joint are considered zero, where v_child and v_parent are the left-trivialized (body) velocities of the link child and parent.
See "Modelling, Estimation and Identification of Humanoid Robots Dynamics" Silvio Traversaro - Section 3.2 https:/
If dof_i is not >= 0 and < getNrOfDOFs(), the returned value is undefined.
void iDynTree:: FixedJoint:: computeChildPosVelAcc(const VectorDynSize& jntPos,
const VectorDynSize& jntVel,
const VectorDynSize& jntAcc,
LinkPositions& linkPositions,
LinkVelArray& linkVels,
LinkAccArray& linkAccs,
const LinkIndex child,
const LinkIndex parent) const virtual
Compute the position, velocity and acceleration of link child, given the position, velocty and acceleration of link parent and the joint position, velocity and acceleration.
The position, velocity and acceleration of link child are directly saved in the linkPositions, linkVels and linkAccs arguments.
void iDynTree:: FixedJoint:: computeJointTorque(const VectorDynSize& jntPos,
const Wrench& internalWrench,
const LinkIndex linkThatAppliesWrench,
const LinkIndex linkOnWhichWrenchIsApplied,
VectorDynSize& jntTorques) const virtual
Compute the internal torque of joint, given the internal wrench that the linkThatAppliesWrench applies on the linkOnWhichWrenchIsApplied, expressed in the link frame of the linkOnWhichWrenchIsApplied.
Parameters | |
---|---|
jntPos in | vector of joint positions. |
internalWrench in | internal wrench that the linkThatAppliesWrench applies on the linkOnWhichWrenchIsApplied, expressed in the link frame of the linkOnWhichWrenchIsApplied |
linkThatAppliesWrench in | link index of the link that applies the considered internal wrench. |
linkOnWhichWrenchIsApplied in | link index of the link on which the considered internal wrench is applied. |
jntTorques out | vector of joint torques. |
bool iDynTree:: FixedJoint:: hasPosLimits() const virtual
Method to check if the joint has limits.
Returns | true if the joints has limits |
---|
bool iDynTree:: FixedJoint:: enablePosLimits(const bool enable) virtual
Method to set if the joint has limits.
Returns | true if everything went correctly, false otherwise (for example if the joint does not support joint position limits) |
---|
bool iDynTree:: FixedJoint:: getPosLimits(const size_t _index,
double& min,
double& max) const virtual
Get min and max position limits of the joint, for the _index dof.
Parameters | |
---|---|
_index in | index of the dof for which the limit are obtained. |
min | |
max | |
Returns | true if everything is correct, false otherwise. |
bool iDynTree:: FixedJoint:: setPosLimits(const size_t _index,
double min,
double max) virtual
Set the position limits for a dof the joint.
JointDynamicsType iDynTree:: FixedJoint:: getJointDynamicsType() const virtual
Method to get the specific joint dynamics type used for the joint.
Returns | the specific joint dynamics type used for the joint. |
---|
bool iDynTree:: FixedJoint:: setJointDynamicsType(const JointDynamicsType enable) virtual
Method to get the specific joint dynamics type used for the joint.
Returns | true if everything went correctly, false otherwise |
---|
double iDynTree:: FixedJoint:: getDamping(const size_t _index) const virtual
Get the damping coefficient of the joint.
The unit is N∙s/m for a prismatic joint, N∙m∙s/rad for a revolute joint.
This parameter is considered in the following joint dynamics types:
URDFJointDynamics
double iDynTree:: FixedJoint:: getStaticFriction(const size_t _index) const virtual
Get the static friction coefficient of the joint.
The unit is N for a prismatic joint, N∙m for a revolute joint.
This parameter is considered in the following joint dynamics types:
URDFJointDynamics
bool iDynTree:: FixedJoint:: setDamping(const size_t _index,
double damping) virtual
Set damping parameter of the joint, for the _index dof.
Parameters | |
---|---|
_index in | index of the dof for which the dynamic parameters are obtained. |
damping | |
Returns | true if everything is correct, false otherwise. |
The damping coefficient is expressed in N∙s/m for a prismatic joint, N∙m∙s/rad for a revolute joint.
This parameter is considered in the following joint dynamics types:
URDFJointDynamics
bool iDynTree:: FixedJoint:: setStaticFriction(const size_t _index,
double staticFriction) virtual
Set static friction parameter of the joint, for the _index dof.
Parameters | |
---|---|
_index in | index of the dof for which the dynamic parameters are obtained. |
staticFriction | |
Returns | true if everything is correct, false otherwise. |
The static friction coefficient is expressed in N for a prismatic joint, N∙m for a revolute joint.
This parameter is considered in the following joint dynamics types:
URDFJointDynamics