class
#include <iDynTree/RevoluteJoint.h>
RevoluteJoint Class representing a revolute joint, i.e.
a joint that constraint two links to move only around a common axis.
Base classes
-
template<unsigned int nrOfPosCoords, unsigned int nrOfDOFs>class MovableJointImpl<1, 1>
- Base template for implementation of non-fixed joints.
Constructors, destructors, conversion operators
- RevoluteJoint()
- Constructor.
- RevoluteJoint(const LinkIndex link1, const LinkIndex link2, const Transform& link1_X_link2, const Axis& _rotation_axis_wrt_link1)
- RevoluteJoint(const Transform& link1_X_link2, const Axis& _rotation_axis_wrt_link1)
- Constructor in which the LinkIndex to which the joint is attached are not specified.
- RevoluteJoint(const RevoluteJoint& other)
- Copy constructor.
- ~RevoluteJoint() virtual
- Destructor.
Public functions
- auto clone() const -> IJoint* virtual
- Clone the joint object.
- 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).
- void setAxis(const Axis& revoluteAxis, const LinkIndex child, const LinkIndex parent = LINK_INVALID_INDEX) virtual
- Set the revolute axis of the joint, expressed in specified link frame, that is considered the "child" frame regarding the sign of the axis.
- void setAxis(const Axis& revoluteAxis_wrt_link1) virtual
- 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 getAxis(const LinkIndex child, const LinkIndex parent = LINK_INVALID_INDEX) const -> Axis virtual
- Get the revolute axis of the robot, expressed in child frame.
- 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 = LINK_INVALID_INDEX) 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 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 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 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.
- 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:: RevoluteJoint:: RevoluteJoint(const Transform& link1_X_link2,
const Axis& _rotation_axis_wrt_link1)
Constructor in which the LinkIndex to which the joint is attached are not specified.
This constructor is tipically used together with the Model::
void iDynTree:: RevoluteJoint:: 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:: RevoluteJoint:: 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 .
void iDynTree:: RevoluteJoint:: setAxis(const Axis& revoluteAxis,
const LinkIndex child,
const LinkIndex parent = LINK_INVALID_INDEX) virtual
Set the revolute axis of the joint, expressed in specified link frame, that is considered the "child" frame regarding the sign of the axis.
See getAxis method for more information.
Axis iDynTree:: RevoluteJoint:: getAxis(const LinkIndex child,
const LinkIndex parent = LINK_INVALID_INDEX) const virtual
Get the revolute axis of the robot, expressed in child frame.
Parameters | |
---|---|
child | the link frame (one of the two at which the link is attached) in which the returned axis is expressed. Furthermore, the axis direction depends on the assumption that this frame is considered the "child" in the relationship. |
parent |
See
Seth, A., Sherman, M., Eastman, P., & Delp, S. (2010). Minimal formulation of joint motion for biomechanisms. Nonlinear Dynamics, 62(1), 291-303. https:/
and
"Modelling, Estimation and Identification of Humanoid Robots Dynamics" Traversaro - Section 3.2 https:/
for more details.
Transform iDynTree:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: getMotionSubspaceVector(int dof_i,
const LinkIndex child,
const LinkIndex parent = LINK_INVALID_INDEX) 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:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: hasPosLimits() const virtual
Method to check if the joint has limits.
Returns | true if the joints has limits |
---|
bool iDynTree:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: setPosLimits(const size_t _index,
double min,
double max) virtual
Set the position limits for a dof the joint.
JointDynamicsType iDynTree:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: 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:: RevoluteJoint:: 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