Libbarrett  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines
Classes
barrett::units Namespace Reference

Classes

struct  JointTorques
struct  JointPositions
struct  JointVelocities
struct  JointAccelerations
struct  CartesianForce
 Template metafunction yielding the 3-element math::Vector used to represent a Cartesian force. Result available in the nested type typedef. More...
struct  CartesianTorque
 Template metafunction yielding the 3-element math::Vector used to represent a Cartesian torque. Result available in the nested type typedef. More...
struct  CartesianPosition
 Template metafunction yielding the 3-element math::Vector used to represent a Cartesian position. Result available in the nested type typedef. More...
struct  CartesianVelocity
 Template metafunction yielding the 3-element math::Vector used to represent a Cartesian velocity. Result available in the nested type typedef. More...
struct  CartesianAcceleration
 Template metafunction yielding the 3-element math::Vector used to represent a Cartesian acceleration. Result available in the nested type typedef. More...

Detailed Description

Defines "unit types" that are actually specializations of math::Vector or math::Matrix.

These classes use type information to give meaning to what would otherwise be an anonymous math::Vector of doubles.

For instance, a systems::Wam has two outputs: one for joint positions and one for joint velocities. Though both of these might be (depending on the particular WAM) 7-element arrays of doubles, they represent two different quantities. They are not interchangeable. They have different units. A user might want to design a joint-space position controller and a joint-space velocity controller for the WAM. If the joint position output of the systems::Wam were to be connected to the velocity controller's feedback input, it would almost certainly result in a programmer-caused error. If such a program were run, the robot would not behave as intended and finding the bug could be difficult and time-consuming.

Adding a notion of units to our vectors (units::JointPositions::type, units::JointVelocities::type, etc.) allows us to:

This comes without incurring a runtime performance penalty.

Users can easily create their own barrett::units classes by passing any C++ type name (such as the name of a class or struct) as the Units template parameter to math::Vector or math::Matrix. The type void is the default and lifts all compile-time restrictions regarding units.

See also:
math::Vector
math::Matrix
BARRETT_UNITS_TYPEDEFS
BARRETT_UNITS_FIXED_SIZE_TYPEDEFS
BARRETT_UNITS_TEMPLATE_TYPEDEFS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines