se2ez
se2ez::Joint Class Reference

Container class that stores the underlying joint representation. Can represent basic joints within the plane, such as fixed (rigid attachment), float (free-flying in SE(2)), translate (free translation in R^2), prismatic (extension along the X-axis), and revolute (rotation). More...

#include <joint.h>

Public Types

enum  Type {
  FIXED = 0,
  FLOAT = 1,
  FLYING = 2,
  TRANSLATE = 3,
  PRISMATIC = 4,
  REVOLUTE = 5,
  CONTINUOUS = 6
}
 Type of joint. More...
 

Public Member Functions

Constructors
 Joint (const std::string &name, Type type, const Eigen::VectorXd &lower, const Eigen::VectorXd &upper)
 Constructor. Takes in name of joint (the frame this joint is associated with, normally) and the joint type to create underlying structures. More...
 
 Joint (const Joint &)=delete
 
 Joint (Joint &&)=delete
 
Joint-based Operations
void enforceBounds (Eigen::Ref< Eigen::VectorXd > q) const
 Enforces joint limits on a joint configuration. More...
 
void setRandom (Eigen::Ref< Eigen::VectorXd > q) const
 sets the Joint at a random state respecting the limits. More...
 
bool inBounds (const Eigen::Ref< const Eigen::VectorXd > &q) const
 Checks if joint limits are satisfied for a joint configuration. More...
 
double distance (const Eigen::Ref< const Eigen::VectorXd > &a, const Eigen::Ref< const Eigen::VectorXd > &b) const
 Measures distance between two joint configurations. More...
 
void interpolate (const Eigen::Ref< const Eigen::VectorXd > &from, const Eigen::Ref< const Eigen::VectorXd > &to, double t, Eigen::Ref< Eigen::VectorXd > state) const
 Interpolate between two joint configurations. More...
 
std::pair< Eigen::VectorXd, Eigen::VectorXd > getBounds () const
 Get the bounds for this joint. For continuous joints, [-pi, pi] is returned. More...
 
Informative
std::string printDebug () const
 Print debug information about this frame. More...
 

Static Public Member Functions

static Type stringToType (const std::string &joint)
 Try to convert a string into a joint type. Not case-sensitive. More...
 
static const std::stringtypeToString (const Type &type)
 Converts a joint type into its string representation. More...
 

Public Attributes

const Type type
 Type of joint. More...
 
const std::vector< KDL::Joint > joints
 Underlying KDL joints. More...
 
const bool continuous
 Is this a continuous type joint? More...
 
const bool fixed
 Is this joint fixed? More...
 
const unsigned int n
 Number of joints. More...
 
const Eigen::VectorXd lower
 Lower limits of this frame's joint value (closed). More...
 
const Eigen::VectorXd upper
 Upper limits of this frame's joint value (closed). More...
 

Static Public Attributes

static const unsigned int TYPE_MAX = CONTINUOUS
 Maximum value a joint type can have. More...
 
static const std::string TYPE_STRINGS []
 String representation of joint type. More...
 

Private Attributes

const unsigned int top_
 Top index for internal computations. More...
 

Detailed Description

Container class that stores the underlying joint representation. Can represent basic joints within the plane, such as fixed (rigid attachment), float (free-flying in SE(2)), translate (free translation in R^2), prismatic (extension along the X-axis), and revolute (rotation).

Definition at line 31 of file joint.h.

Member Enumeration Documentation

◆ Type

Type of joint.

Enumerator
FIXED 

Fixed joint, just a rigid transformation.

FLOAT 

Floating joint, free movement in SE(2). Uses Euclidean metric.

FLYING 

Floating joint, free movement in SE(2). Continuous rotation, uses SE(2) metric.

TRANSLATE 

Translating joint, free X- and Y-axis movement.

PRISMATIC 

Prismatic joint, extends along X-axis.

REVOLUTE 

Revolute joint, rotates. Uses Euclidean metric.

CONTINUOUS 

Revolute joint, rotates. Continuous rotation, uses SO(2) metric.

Definition at line 38 of file joint.h.

Constructor & Destructor Documentation

◆ Joint() [1/3]

Joint::Joint ( const std::string name,
Type  type,
const Eigen::VectorXd &  lower,
const Eigen::VectorXd &  upper 
)

Constructor. Takes in name of joint (the frame this joint is associated with, normally) and the joint type to create underlying structures.

Parameters
[in]nameName of the joint.
[in]typeType of the joint.
[in]lowerLower limits of frame joint.
[in]upperUpper limits of frame joint.

Definition at line 31 of file joint.cpp.

◆ Joint() [2/3]

se2ez::Joint::Joint ( const Joint )
delete

◆ Joint() [3/3]

se2ez::Joint::Joint ( Joint &&  )
delete

Member Function Documentation

◆ distance()

double Joint::distance ( const Eigen::Ref< const Eigen::VectorXd > &  a,
const Eigen::Ref< const Eigen::VectorXd > &  b 
) const

Measures distance between two joint configurations.

Parameters
[in]aFirst configuration.
[in]bFirst configuration.
Returns
Distance between a and b

Definition at line 115 of file joint.cpp.

◆ enforceBounds()

void Joint::enforceBounds ( Eigen::Ref< Eigen::VectorXd >  q) const

Enforces joint limits on a joint configuration.

Parameters
[in]qConfiguration for the joint.

Definition at line 82 of file joint.cpp.

◆ getBounds()

std::pair< Eigen::VectorXd, Eigen::VectorXd > Joint::getBounds ( ) const

Get the bounds for this joint. For continuous joints, [-pi, pi] is returned.

Returns
A pair of lower and upper bounds for the joint.

Definition at line 149 of file joint.cpp.

◆ inBounds()

bool Joint::inBounds ( const Eigen::Ref< const Eigen::VectorXd > &  q) const

Checks if joint limits are satisfied for a joint configuration.

Parameters
[in]qConfiguration for the joint.
Returns
True if configuration is within bounds.

Definition at line 103 of file joint.cpp.

◆ interpolate()

void Joint::interpolate ( const Eigen::Ref< const Eigen::VectorXd > &  from,
const Eigen::Ref< const Eigen::VectorXd > &  to,
double  t,
Eigen::Ref< Eigen::VectorXd >  state 
) const

Interpolate between two joint configurations.

Parameters
[in]fromInitial configuration.
[in]toDestination configuration.
[in]tInterpolation parameter.
[out]stateOutput configuration.
Returns
Fills state with interpolated parameters.

Definition at line 125 of file joint.cpp.

◆ printDebug()

std::string Joint::printDebug ( ) const

Print debug information about this frame.

Returns
A string of information about the frame.

Definition at line 168 of file joint.cpp.

◆ setRandom()

void Joint::setRandom ( Eigen::Ref< Eigen::VectorXd >  q) const

sets the Joint at a random state respecting the limits.

Parameters
[in]qConfiguration for the joint.

Definition at line 96 of file joint.cpp.

◆ stringToType()

Joint::Type Joint::stringToType ( const std::string joint)
static

Try to convert a string into a joint type. Not case-sensitive.

Parameters
[in]jointString of joint type. See TYPE_STRINGS.
Returns
The type of joint specified by the string, or an exception on failure.

Definition at line 14 of file joint.cpp.

◆ typeToString()

const std::string & Joint::typeToString ( const Type type)
static

Converts a joint type into its string representation.

Parameters
[in]typeThe type to convert.
Returns
The joint type as a string.

Definition at line 23 of file joint.cpp.

Member Data Documentation

◆ continuous

const bool se2ez::Joint::continuous

Is this a continuous type joint?

Definition at line 140 of file joint.h.

◆ fixed

const bool se2ez::Joint::fixed

Is this joint fixed?

Definition at line 141 of file joint.h.

◆ joints

const std::vector<KDL::Joint> se2ez::Joint::joints

Underlying KDL joints.

Definition at line 139 of file joint.h.

◆ lower

const Eigen::VectorXd se2ez::Joint::lower

Lower limits of this frame's joint value (closed).

Definition at line 144 of file joint.h.

◆ n

const unsigned int se2ez::Joint::n

Number of joints.

Definition at line 142 of file joint.h.

◆ top_

const unsigned int se2ez::Joint::top_
private

Top index for internal computations.

Definition at line 148 of file joint.h.

◆ type

const Type se2ez::Joint::type

Type of joint.

Definition at line 138 of file joint.h.

◆ TYPE_MAX

const unsigned int se2ez::Joint::TYPE_MAX = CONTINUOUS
static

Maximum value a joint type can have.

Definition at line 49 of file joint.h.

◆ TYPE_STRINGS

const std::string Joint::TYPE_STRINGS
static
Initial value:
= {"fixed", "float", "flying", "translate",
"prismatic", "revolute", "continuous"}

String representation of joint type.

Definition at line 51 of file joint.h.

◆ upper

const Eigen::VectorXd se2ez::Joint::upper

Upper limits of this frame's joint value (closed).

Definition at line 145 of file joint.h.


The documentation for this class was generated from the following files: