Information about a joint that controls the relationship between two links. More...
#include <kinbody.h>
Public Types | |
typedef Mimic MIMIC | RAVE_DEPRECATED |
typedef KinBody::JointType JointType | RAVE_DEPRECATED |
Public Member Functions | |
Joint (KinBodyPtr parent, KinBody::JointType type=KinBody::JointNone) | |
virtual | ~Joint () |
const std::string & | GetName () const |
The unique name of the joint. | |
dReal | GetMaxVel (int iaxis=0) const |
dReal | GetMaxAccel (int iaxis=0) const |
dReal | GetMaxTorque (int iaxis=0) const |
int | GetDOFIndex () const |
Get the degree of freedom index in the body's DOF array. | |
int | GetJointIndex () const |
Get the joint index into KinBody::GetJoints. | |
KinBodyPtr | GetParent () const |
LinkPtr | GetFirstAttached () const |
LinkPtr | GetSecondAttached () const |
KinBody::JointType | GetType () const |
virtual void | GetResolutions (std::vector< dReal > &resolutions, bool bAppend=false) const |
gets all resolutions for the joint axes | |
virtual dReal | GetResolution (int iaxis=0) const |
The discretization of the joint used when line-collision checking. | |
virtual void | SetResolution (dReal resolution, int iaxis=0) |
virtual int | GetDOF () const |
The degrees of freedom of the joint. Each joint supports a max of 3 degrees of freedom. | |
virtual bool | IsCircular (int iaxis) const |
Return true if joint axis has an identification at some of its lower and upper limits. | |
virtual bool | IsRevolute (int iaxis) const |
returns true if the axis describes a rotation around an axis. | |
virtual bool | IsPrismatic (int iaxis) const |
returns true if the axis describes a translation around an axis. | |
virtual bool | IsStatic () const |
Return true if joint can be treated as a static binding (ie all limits are 0) | |
virtual void | GetValues (std::vector< dReal > &values, bool bAppend=false) const |
Return all the joint values with the correct offsets applied. | |
virtual dReal | GetValue (int axis) const |
Return the value of the specified joint axis only. | |
virtual void | GetVelocities (std::vector< dReal > &values, bool bAppend=false) const |
Gets the joint velocities. | |
virtual dReal | GetVelocity (int axis) const |
Return the velocity of the specified joint axis only. | |
virtual void | AddTorque (const std::vector< dReal > &torques) |
Add effort (force or torque) to the joint. | |
virtual Vector | GetAnchor () const |
The anchor of the joint in global coordinates. | |
virtual Vector | GetAxis (int axis=0) const |
The axis of the joint in global coordinates. | |
virtual void | GetLimits (std::vector< dReal > &vLowerLimit, std::vector< dReal > &vUpperLimit, bool bAppend=false) const |
Get the limits of the joint. | |
virtual std::pair< dReal, dReal > | GetLimit (int iaxis=0) const |
returns the lower and upper limit of one axis of the joint | |
virtual void | SetLimits (const std::vector< dReal > &lower, const std::vector< dReal > &upper) |
virtual void | GetVelocityLimits (std::vector< dReal > &vmax, bool bAppend=false) const |
Returns the max velocities of the joint. | |
virtual void | GetVelocityLimits (std::vector< dReal > &vlower, std::vector< dReal > &vupper, bool bAppend=false) const |
virtual std::pair< dReal, dReal > | GetVelocityLimit (int iaxis=0) const |
returns the lower and upper velocity limit of one axis of the joint | |
virtual void | SetVelocityLimits (const std::vector< dReal > &vmax) |
virtual void | GetAccelerationLimits (std::vector< dReal > &vmax, bool bAppend=false) const |
Returns the max accelerations of the joint. | |
virtual dReal | GetAccelerationLimit (int iaxis=0) const |
virtual void | SetAccelerationLimits (const std::vector< dReal > &vmax) |
virtual void | GetTorqueLimits (std::vector< dReal > &vmax, bool bAppend=false) const |
Returns the max torques of the joint. | |
virtual void | SetTorqueLimits (const std::vector< dReal > &vmax) |
virtual void | GetWeights (std::vector< dReal > &weights, bool bAppend=false) const |
gets all weights for the joint axes | |
virtual dReal | GetWeight (int axis=0) const |
The weight associated with a joint's axis for computing a distance in the robot configuration space. | |
virtual void | SetWeights (const std::vector< dReal > &weights) |
virtual void | SubtractValues (std::vector< dReal > &values1, const std::vector< dReal > &values2) const |
Computes the configuration difference values1-values2 and stores it in values1. | |
virtual dReal | SubtractValue (dReal value1, dReal value2, int iaxis) const |
Returns the configuration difference value1-value2 for axis i. | |
dReal | GetWrapOffset (int iaxis=0) const |
Return internal offset parameter that determines the branch the angle centers on. | |
dReal | GetOffset (int iaxis=0) const RAVE_DEPRECATED |
virtual void | SetWrapOffset (dReal offset, int iaxis=0) |
virtual void | serialize (std::ostream &o, int options) const |
const std::map< std::string, std::vector< dReal > > & | GetFloatParameters () const |
return a map of custom float parameters | |
virtual void | SetFloatParameters (const std::string &key, const std::vector< dReal > ¶meters) |
set custom float parameters | |
const std::map< std::string, std::vector< int > > & | GetIntParameters () const |
return a map of custom integer parameters | |
virtual void | SetIntParameters (const std::string &key, const std::vector< int > ¶meters) |
set custom int parameters | |
virtual void | UpdateInfo () |
Updates several fields in _info depending on the current state of the joint. | |
const KinBody::JointInfo & | GetInfo () const |
returns the JointInfo structure containing all information. | |
const KinBody::JointInfo & | UpdateAndGetInfo () |
Calls UpdateInfo and returns the joint structure. | |
Internal Hierarchy Methods | |
virtual LinkPtr | GetHierarchyParentLink () const |
Return the parent link which the joint measures its angle off from (either GetFirstAttached() or GetSecondAttached()) | |
virtual LinkPtr | GetHierarchyChildLink () const |
Return the child link whose transformation is computed by this joint's values (either GetFirstAttached() or GetSecondAttached()) | |
virtual Vector | GetInternalHierarchyAxis (int axis=0) const |
The axis of the joint in local coordinates. | |
virtual Transform | GetInternalHierarchyLeftTransform () const |
Left multiply transform given the base body. | |
virtual Transform | GetInternalHierarchyRightTransform () const |
Right multiply transform given the base body. | |
Mimic Joint Properties | |
A mimic joint's angles are automatically determined from other joints based on a general purpose formula. A user does not have control of the the mimic joint values, even if they appear in the DOF list. | |
virtual int | GetMimicJointIndex () const RAVE_DEPRECATED |
virtual const std::vector< dReal > | GetMimicCoeffs () const RAVE_DEPRECATED |
virtual bool | IsMimic (int axis=-1) const |
Returns true if a particular axis of the joint is mimiced. | |
virtual std::string | GetMimicEquation (int axis=0, int type=0, const std::string &format="") const |
If the joint is mimic, returns the equation to compute its value. | |
virtual void | GetMimicDOFIndices (std::vector< int > &vmimicdofs, int axis=0) const |
Returns the set of DOF indices that the computation of a joint axis depends on. Order is arbitrary. | |
virtual void | SetMimicEquations (int axis, const std::string &poseq, const std::string &veleq, const std::string &acceleq="") |
Sets the mimic properties of the joint. | |
Protected Member Functions | |
virtual void | _ComputePartialVelocities (std::vector< std::pair< int, dReal > > &vpartials, int iaxis, std::map< std::pair< Mimic::DOFFormat, int >, dReal > &mapcachedpartials) const |
computes the partial velocities with respect to all dependent DOFs specified by Mimic::_vmimicdofs. | |
virtual void | _ComputeInternalInformation (LinkPtr plink0, LinkPtr plink1, const Vector &vanchor, const std::vector< Vector > &vaxes, const std::vector< dReal > &vcurrentvalues) |
Compute internal transformations and specify the attached links of the joint. | |
virtual int | _Eval (int axis, uint32_t timederiv, const std::vector< dReal > &vdependentvalues, std::vector< dReal > &voutput) |
evaluates the mimic joint equation using vdependentvalues | |
virtual void | _GetVelocities (std::vector< dReal > &values, bool bAppend, const std::pair< Vector, Vector > &linkparentvelocity, const std::pair< Vector, Vector > &linkchildvelocity) const |
compute joint velocities given the parent and child link transformations/velocities | |
virtual dReal | _GetVelocity (int axis, const std::pair< Vector, Vector > &linkparentvelocity, const std::pair< Vector, Vector > &linkchildvelocity) const |
Return the velocity of the specified joint axis only. | |
Protected Attributes | |
JointInfo | _info |
boost::array< MimicPtr, 3 > | _vmimic |
the mimic properties of each of the joint axes. It is theoretically possible for a multi-dof joint to have one axes mimiced and the others free. When cloning, is it ok to copy this and assume it is constant? | |
boost::array< int, 3 > | _dofbranches |
the branch that identified joints are on. +1 means one loop around the identification. For revolute joints, the actual joint value incremented by 2*pi*branch. Branches are important for maintaining joint ranges greater than 2*pi. For circular joints, the branches can be ignored or not. | |
Information about a joint that controls the relationship between two links.
typedef Mimic MIMIC OpenRAVE::KinBody::Joint::RAVE_DEPRECATED |
OpenRAVE::KinBody::Joint::Joint | ( | KinBodyPtr | parent, |
KinBody::JointType | type = KinBody::JointNone |
||
) |
Definition at line 106 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 121 of file kinbodyjoint.cpp.
|
protectedvirtual |
Compute internal transformations and specify the attached links of the joint.
Called after the joint protected parameters {vAxes, vanchor, and _voffsets} have been initialized. vAxes and vanchor should be in the frame of plink0. Compute the left and right multiplications of the joint transformation and cleans up the attached bodies. After function completes, the following parameters are initialized: _tRight, _tLeft, _tinvRight, _tinvLeft, _attachedbodies. _attachedbodies does not necessarily contain the links in the same order as they were input.
plink0 | the first attaching link, all axes and anchors are defined in its coordinate system |
plink1 | the second attaching link |
vanchor | the anchor of the rotation axes |
vaxes | the axes in plink0's coordinate system of the joints |
vinitialvalues | the current values of the robot used to set the 0 offset of the robot |
Definition at line 566 of file kinbodyjoint.cpp.
|
protectedvirtual |
computes the partial velocities with respect to all dependent DOFs specified by Mimic::_vmimicdofs.
If the joint is not mimic, then just returns its own index
[out] | vpartials | A list of dofindex/velocity_partial pairs. The final velocity is computed by taking the dot product. The dofindices do not repeat. |
[in] | iaxis | the axis |
[in,out] | vcachedpartials | set of cached partials for each degree of freedom |
Definition at line 1225 of file kinbodyjoint.cpp.
|
protectedvirtual |
evaluates the mimic joint equation using vdependentvalues
[in] | axis | the joint axis |
[in] | timederiv | the time derivative to evaluate. 0 is position, 1 is velocity, 2 is acceleration, etc |
[in] | vdependentvalues | input values ordered with respect to _vdofformat[iaxis] |
[out] | voutput | the output values |
Definition at line 1294 of file kinbodyjoint.cpp.
|
protectedvirtual |
compute joint velocities given the parent and child link transformations/velocities
Definition at line 467 of file kinbodyjoint.cpp.
|
protectedvirtual |
Return the velocity of the specified joint axis only.
Definition at line 509 of file kinbodyjoint.cpp.
|
virtual |
Add effort (force or torque) to the joint.
Definition at line 988 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 860 of file kinbodyjoint.cpp.
|
virtual |
Returns the max accelerations of the joint.
[out] | the | max acceleration |
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 850 of file kinbodyjoint.cpp.
|
virtual |
The anchor of the joint in global coordinates.
Definition at line 556 of file kinbodyjoint.cpp.
|
virtual |
The axis of the joint in global coordinates.
[in] | axis | the axis to get |
Definition at line 561 of file kinbodyjoint.cpp.
|
virtual |
The degrees of freedom of the joint. Each joint supports a max of 3 degrees of freedom.
Definition at line 125 of file kinbodyjoint.cpp.
|
inline |
Get the degree of freedom index in the body's DOF array.
This does not index in KinBody::GetJoints() directly! In other words, KinBody::GetDOFValues()[GetDOFIndex()] == GetValues()[0]
|
inline |
|
inline |
|
virtual |
Return the child link whose transformation is computed by this joint's values (either GetFirstAttached() or GetSecondAttached())
Definition at line 752 of file kinbodyjoint.cpp.
|
virtual |
Return the parent link which the joint measures its angle off from (either GetFirstAttached() or GetSecondAttached())
Definition at line 747 of file kinbodyjoint.cpp.
|
inline |
returns the JointInfo structure containing all information.
Some values in this structure like _vcurrentvalues need to be updated, so make sure to call UpdateInfo() right before this function is called.
|
virtual |
The axis of the joint in local coordinates.
Definition at line 757 of file kinbodyjoint.cpp.
|
virtual |
Left multiply transform given the base body.
Definition at line 762 of file kinbodyjoint.cpp.
|
virtual |
Right multiply transform given the base body.
Definition at line 768 of file kinbodyjoint.cpp.
|
inline |
|
inline |
Get the joint index into KinBody::GetJoints.
returns the lower and upper limit of one axis of the joint
Definition at line 786 of file kinbodyjoint.cpp.
|
virtual |
Get the limits of the joint.
[out] | vLowerLimit | the lower limits |
[out] | vUpperLimit | the upper limits |
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 774 of file kinbodyjoint.cpp.
|
inline |
|
inline |
|
inline |
|
virtual |
Definition at line 1003 of file kinbodyjoint.cpp.
|
virtual |
Returns the set of DOF indices that the computation of a joint axis depends on. Order is arbitrary.
If the mimic joint uses the values of other mimic joints, then the dependent DOFs of that joint are also copied over. Therefore, the dof indices returned can be more than the actual variables used in the equation.
openrave_exception | Throws an exception if the axis is not mimic. |
Definition at line 1072 of file kinbodyjoint.cpp.
|
virtual |
If the joint is mimic, returns the equation to compute its value.
[in] | axis | the axis index |
[in] | type | 0 for position, 1 for velocity, 2 for acceleration. |
[in] | format | the format the equations are returned in. If empty or "fparser", equation in fparser format. Also supports: "mathml". |
MathML:
Set 'format' to "mathml". The joint variables are specified with <csymbol>. If a targetted joint has more than one degree of freedom, then axis is suffixed with _%d. If 'type' is 1 or 2, the partial derivatives are outputted as consecutive <math></math> tags in the same order as Mimic::_vdofformat
Definition at line 1023 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 993 of file kinbodyjoint.cpp.
|
inline |
|
inline |
|
inline |
|
virtual |
The discretization of the joint used when line-collision checking.
The resolutions are set as large as possible such that the joint will not go through obstacles of determined size.
Definition at line 931 of file kinbodyjoint.cpp.
|
virtual |
gets all resolutions for the joint axes
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 921 of file kinbodyjoint.cpp.
|
inline |
|
virtual |
Returns the max torques of the joint.
[out] | the | max torque |
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 873 of file kinbodyjoint.cpp.
|
inline |
|
virtual |
Return the value of the specified joint axis only.
Definition at line 292 of file kinbodyjoint.cpp.
|
virtual |
Return all the joint values with the correct offsets applied.
bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 194 of file kinbodyjoint.cpp.
|
virtual |
Gets the joint velocities.
bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 448 of file kinbodyjoint.cpp.
|
virtual |
Return the velocity of the specified joint axis only.
Definition at line 461 of file kinbodyjoint.cpp.
returns the lower and upper velocity limit of one axis of the joint
Definition at line 837 of file kinbodyjoint.cpp.
|
virtual |
Returns the max velocities of the joint.
[out] | the | max velocity |
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 827 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 815 of file kinbodyjoint.cpp.
|
virtual |
The weight associated with a joint's axis for computing a distance in the robot configuration space.
Definition at line 952 of file kinbodyjoint.cpp.
|
virtual |
gets all weights for the joint axes
[in] | bAppend | if true will append to the end of the vector instead of erasing it |
Definition at line 942 of file kinbodyjoint.cpp.
|
inline |
Return internal offset parameter that determines the branch the angle centers on.
Wrap offsets are needed for rotation joints since the range is limited to 2*pi. This allows the wrap offset to be set so the joint can function in [-pi+offset,pi+offset]..
iaxis | the axis to get the offset from |
|
virtual |
Return true if joint axis has an identification at some of its lower and upper limits.
An identification of the lower and upper limits means that once the joint reaches its upper limits, it is also at its lower limit. The most common identification on revolute joints at -pi and pi. 'circularity' means the joint does not stop at limits. Although currently not developed, it could be possible to support identification for joints that are not revolute.
Definition at line 140 of file kinbodyjoint.cpp.
|
virtual |
Returns true if a particular axis of the joint is mimiced.
axis | the axis to query. When -1 returns true if any of the axes have mimic joints |
Definition at line 1010 of file kinbodyjoint.cpp.
|
virtual |
returns true if the axis describes a translation around an axis.
iaxis | the axis of the joint to return the results for |
Definition at line 153 of file kinbodyjoint.cpp.
|
virtual |
returns true if the axis describes a rotation around an axis.
iaxis | the axis of the joint to return the results for |
Definition at line 145 of file kinbodyjoint.cpp.
|
virtual |
Return true if joint can be treated as a static binding (ie all limits are 0)
Definition at line 161 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 1376 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 865 of file kinbodyjoint.cpp.
|
virtual |
set custom float parameters
parameters | if empty, then removes the parameter |
Definition at line 1348 of file kinbodyjoint.cpp.
|
virtual |
set custom int parameters
parameters | if empty, then removes the parameter |
Definition at line 1359 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 791 of file kinbodyjoint.cpp.
|
virtual |
Sets the mimic properties of the joint.
The equations can use the joint names directly in the equation, which represent the position of the joint. Any non-mimic joint part of KinBody::GetJoints() can be used in the computation of the values. If a joint has more than one degree of freedom, then suffix it '_' and the axis index. For example universaljoint_0 * 10 + sin(universaljoint_1).
See http://warp.povusers.org/FunctionParser/fparser.html for a full description of the equation formats.
The velocity and acceleration equations are specified in terms of partial derivatives, which means one expression needs to be specified per degree of freedom of used. In order to separate the expressions use "|name ...". The name should immediately follow '|'. For example:
|universaljoint_0 10 |universaljoint_1 10*cos(universaljoint_1)
If there is only one variable used in the position equation, then the equation can be specified directly without using "{}".
[in] | axis | the axis to set the properties for. |
[in] | poseq | Equation for joint's position. If it is empty, the mimic properties are turned off for this joint. |
[in] | veleq | First-order partial derivatives of poseq with respect to all used DOFs. Only the variables used in poseq are allowed to be used. If poseq is not empty, this is required. |
[in] | acceleq | Second-order partial derivatives of poseq with respect to all used DOFs. Only the variables used in poseq are allowed to be used. Optional. |
openrave_exception | Throws an exception if the mimic equation is invalid in any way. |
Definition at line 1084 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 936 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 883 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 842 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 957 of file kinbodyjoint.cpp.
|
virtual |
Definition at line 891 of file kinbodyjoint.cpp.
|
virtual |
Returns the configuration difference value1-value2 for axis i.
Takes into account joint limits and wrapping of circular joints.
Definition at line 978 of file kinbodyjoint.cpp.
|
virtual |
Computes the configuration difference values1-values2 and stores it in values1.
Takes into account joint limits and wrapping of circular joints.
Definition at line 966 of file kinbodyjoint.cpp.
|
inline |
Calls UpdateInfo and returns the joint structure.
|
virtual |
Updates several fields in _info depending on the current state of the joint.
Definition at line 1370 of file kinbodyjoint.cpp.
|
protected |
the branch that identified joints are on. +1 means one loop around the identification. For revolute joints, the actual joint value incremented by 2*pi*branch. Branches are important for maintaining joint ranges greater than 2*pi. For circular joints, the branches can be ignored or not.
|
protected |