kinematics-dynamics
Enumerations | Functions
roboticslab::KinRepresentation Namespace Reference

Collection of static methods to perform geometric transformations.

Enumerations

enum class  coordinate_system { CARTESIAN , CYLINDRICAL , SPHERICAL , NONE }
 Lists available translational representations. More...
 
enum class  orientation_system {
  AXIS_ANGLE , AXIS_ANGLE_SCALED , RPY , EULER_YZ ,
  EULER_ZYZ , POLAR_AZIMUTH , NONE
}
 Lists available rotational representations. More...
 
enum class  angular_units { DEGREES , RADIANS }
 Lists recognized angular units. More...
 

Functions

bool encodePose (const std::vector< double > &x_in, std::vector< double > &x_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific pose to coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems. More...
 
bool decodePose (const std::vector< double > &x_in, std::vector< double > &x_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific pose to the chosen representation systems. More...
 
bool encodeVelocity (const std::vector< double > &x_in, const std::vector< double > &xdot_in, std::vector< double > &xdot_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific velocity to coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems. More...
 
bool decodeVelocity (const std::vector< double > &x_in, const std::vector< double > &xdot_in, std::vector< double > &xdot_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific velocity to the chosen representation systems. More...
 
bool encodeAcceleration (const std::vector< double > &x_in, const std::vector< double > &xdot_in, const std::vector< double > &xdotdot_in, std::vector< double > &xdotdot_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific acceleration to coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems. More...
 
bool decodeAcceleration (const std::vector< double > &x_in, const std::vector< double > &xdot_in, const std::vector< double > &xdotdot_in, std::vector< double > &xdotdot_out, coordinate_system coord, orientation_system orient, angular_units angle=angular_units::RADIANS)
 Converts the translation and rotation values of a specific acceleration to the chosen representation systems. More...
 
double degToRad (double deg)
 Converts degrees to radians. More...
 
double radToDeg (double rad)
 Converts radians to degrees. More...
 
bool parseEnumerator (const std::string &str, coordinate_system *coord, coordinate_system fallback=coordinate_system::CARTESIAN)
 Parses input string, returns matching enumerator value. More...
 
bool parseEnumerator (const std::string &str, orientation_system *orient, orientation_system fallback=orientation_system::AXIS_ANGLE_SCALED)
 Parses input string, returns matching enumerator value. More...
 
bool parseEnumerator (const std::string &str, angular_units *units, angular_units fallback=angular_units::RADIANS)
 Parses input string, returns matching enumerator value. More...
 

Enumeration Type Documentation

◆ angular_units

Enumerator
DEGREES 

degrees (deg)

RADIANS 

radians (rad)

◆ coordinate_system

Enumerator
CARTESIAN 

(x distance, y distance, z distance)

CYLINDRICAL 

(radial distance, azimuthal angle, height)

SPHERICAL 

(radial distance, polar angle, azimuthal angle)

NONE 

omit coordinate system in resulting combined coord+orient representation

◆ orientation_system

Enumerator
AXIS_ANGLE 

(axis_x, axis_y, axis_z, rotation angle) [axis needs not to be normalized]

AXIS_ANGLE_SCALED 

(axis_x, axis_y, axis_z) [axis' norm is the rotation angle]

RPY 

fixed axes, roll is axis_x

EULER_YZ 

as EULER_ZYZ, preceded by rotation about the azimuthal angle got from x-y coordinates

EULER_ZYZ 

mobile axes

POLAR_AZIMUTH 

(polar angle, azimuthal angle)

NONE 

omit orientation system in resulting combined coord+orient representation

Function Documentation

◆ decodeAcceleration()

bool roboticslab::KinRepresentation::decodeAcceleration ( const std::vector< double > &  x_in,
const std::vector< double > &  xdot_in,
const std::vector< double > &  xdotdot_in,
std::vector< double > &  xdotdot_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
xdot_inInput vector describing a three-dimensional velocity in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
xdotdot_inInput vector describing a three-dimensional acceleration in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
xdotdot_outOutput vector describing the same acceleration in the chosen representation system.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ decodePose()

bool roboticslab::KinRepresentation::decodePose ( const std::vector< double > &  x_in,
std::vector< double > &  x_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
x_outOutput vector describing the same pose in the chosen representation system.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ decodeVelocity()

bool roboticslab::KinRepresentation::decodeVelocity ( const std::vector< double > &  x_in,
const std::vector< double > &  xdot_in,
std::vector< double > &  xdot_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
xdot_inInput vector describing a three-dimensional velocity in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
xdot_outOutput vector describing the same velocity in the chosen representation system.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ degToRad()

double roboticslab::KinRepresentation::degToRad ( double  deg)
Parameters
degAngle value expressed in degrees.
Returns
Same value expressed in radians.

◆ encodeAcceleration()

bool roboticslab::KinRepresentation::encodeAcceleration ( const std::vector< double > &  x_in,
const std::vector< double > &  xdot_in,
const std::vector< double > &  xdotdot_in,
std::vector< double > &  xdotdot_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose (translation + rotation).
xdot_inInput vector describing a three-dimensional velocity (translation + rotation).
xdotdot_inInput vector describing a three-dimensional acceleration (translation + rotation).
xdotdot_outOutput vector describing the same acceleration in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ encodePose()

bool roboticslab::KinRepresentation::encodePose ( const std::vector< double > &  x_in,
std::vector< double > &  x_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose (translation + rotation).
x_outOutput vector describing the same pose in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED notation.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ encodeVelocity()

bool roboticslab::KinRepresentation::encodeVelocity ( const std::vector< double > &  x_in,
const std::vector< double > &  xdot_in,
std::vector< double > &  xdot_out,
coordinate_system  coord,
orientation_system  orient,
angular_units  angle = angular_units::RADIANS 
)

Supports in-place transformation.

Parameters
x_inInput vector describing a three-dimensional pose (translation + rotation).
xdot_inInput vector describing a three-dimensional velocity (translation + rotation).
xdot_outOutput vector describing the same velocity in coordinate_system::CARTESIAN and orientation_system::AXIS_ANGLE_SCALED systems.
coordCoordinate system for the translational part.
orientOrientation system for the rotational part.
angleUnits in which angular values are expressed.
Returns
true on success, false otherwise.

◆ parseEnumerator() [1/3]

bool roboticslab::KinRepresentation::parseEnumerator ( const std::string &  str,
angular_units units,
angular_units  fallback = angular_units::RADIANS 
)
Input string Enum value
degrees angular_units::DEGREES
radians angular_units::RADIANS
Parameters
strInput string.
unitsSee angular_units.
fallbackDefault value if no match found.
Returns
true if match found, false otherwise

◆ parseEnumerator() [2/3]

bool roboticslab::KinRepresentation::parseEnumerator ( const std::string &  str,
coordinate_system coord,
coordinate_system  fallback = coordinate_system::CARTESIAN 
)
Input string Enum value
cartesian coordinate_system::CARTESIAN
cylindrical coordinate_system::CYLINDRICAL
spherical coordinate_system::SPHERICAL
none coordinate_system::NONE
Parameters
strInput string.
coordSee coordinate_system.
fallbackDefault value if no match found.
Returns
true if match found, false otherwise

◆ parseEnumerator() [3/3]

bool roboticslab::KinRepresentation::parseEnumerator ( const std::string &  str,
orientation_system orient,
orientation_system  fallback = orientation_system::AXIS_ANGLE_SCALED 
)
Input string Enum value
axisAngle orientation_system::AXIS_ANGLE
axisAngleScaled orientation_system::AXIS_ANGLE_SCALED
RPY orientation_system::RPY
eulerYZ orientation_system::EULER_YZ
eulerZYZ orientation_system::EULER_ZYZ
polarAzimuth orientation_system::POLAR_AZIMUTH
none orientation_system::NONE
Parameters
strInput string.
orientSee orientation_system.
fallbackDefault value if no match found.
Returns
true if match found, false otherwise

◆ radToDeg()

double roboticslab::KinRepresentation::radToDeg ( double  rad)
Parameters
radAngle value expressed in radians.
Returns
Same value expressed in degrees.