GAMS  1.2.2
gams::pose::BasicPose< Derived > Class Template Reference

Underlying template for all Pose types, including PoseVector, Pose, and StampedPose See PositionVector and OrientationVector for representation deatils. More...

#include <Pose.h>

Inheritance diagram for gams::pose::BasicPose< Derived >:
gams::pose::PositionVector gams::pose::OrientationVector gams::pose::BasicVector< PositionVector, units::absolute< units::length > > gams::pose::BasicVector< OrientationVector, units::absolute< units::plane_angle > >

Public Types

using Base = BasicVector< PositionVector, units::absolute< units::length > >
 
using Base = BasicVector< OrientationVector, units::absolute< units::plane_angle > >
 
typedef BasicPose BaseType
 
using derived_type = Derived
 
using units_type = units::absolute< units::plane_angle >
 
using units_type = units::absolute< units::length >
 

Public Member Functions

 BasicPose (double x, double y)
 Constructs a BasicPose from individual position values. More...
 
 BasicPose (double x, double y, double z)
 Constructs a BasicPose from individual position values. More...
 
 BasicPose (double x, double y, double z, double rx, double ry, double rz)
 Constructs a BasicPose from individual position and orientation values. More...
 
 BasicPose (const PositionVector &pos)
 Construct a BasicPose from a PositionVector. More...
 
 BasicPose (const OrientationVector &rot)
 Construct a BasicPose from a OrientationVector. More...
 
 BasicPose (const PositionVector &pos, const OrientationVector &rot)
 Construct from individual PositionVector and OrientationVector. More...
 
 BasicPose ()
 Default constructor. More...
 
 BasicPose (const madara::knowledge::containers::DoubleVector &vec)
 Constructor from MADARA DoubleVector. More...
 
 BasicPose (const madara::knowledge::containers::NativeDoubleVector &vec)
 Constructor from MADARA NativeDoubleVector. More...
 
 BasicPose (const madara::knowledge::containers::DoubleVector &vec_loc, const madara::knowledge::containers::DoubleVector &vec_rot)
 Constructor from two MADARA DoubleVectors, for position and orientation. More...
 
 BasicPose (const madara::knowledge::containers::NativeDoubleVector &vec_loc, const madara::knowledge::containers::NativeDoubleVector &vec_rot)
 Constructor from two MADARA NativeDoubleVector, for position/orientation. More...
 
template<typename Derived2 >
bool approximately_equal (const BasicPose< Derived2 > &other, double epsilon) const
 Tests if this Coordinate is within epsilon in distance (as defined by this Coordinate's reference frame's distance metric). More...
 
PositionVectoras_location_vec ()
 
const PositionVectoras_location_vec () const
 
OrientationVectoras_orientation_vec ()
 Gets a reference to this object's Orientation part. More...
 
const OrientationVectoras_orientation_vec () const
 Gets a const reference to this object's Orientation part. More...
 
PositionVectoras_position_vec ()
 Gets a reference to this object's Position part. More...
 
const PositionVectoras_position_vec () const
 Gets a const reference to this object's Position part. More...
 
BaseTypeas_vec ()
 Gets a reference to this object. More...
 
const BaseTypeas_vec () const
 Gets a const reference to this object. More...
 
OrientationVector cross (const BasicVector< Other, units::absolute< units::plane_angle > > &other) const
 Passthrough to Eigen vector cross method. More...
 
PositionVector cross (const BasicVector< Other, units::absolute< units::length > > &other) const
 Passthrough to Eigen vector cross method. More...
 
template<typename Derived2 >
double distance_to (const BasicPose< Derived2 > &target) const
 
double dot (const BasicVector< Other, units::absolute< units::length > > &other) const
 Passthrough to Eigen vector dot method. More...
 
double dot (const BasicVector< Other, units::absolute< units::plane_angle > > &other) const
 Passthrough to Eigen vector dot method. More...
 
void from_array (const ContainType &in)
 Overwrites this Coordinate's values with those pulled from the referenced array. More...
 
void from_array (const ContainType &in)
 Overwrites this Coordinate's values with those pulled from the referenced array. More...
 
void from_container (const madara::knowledge::containers::NativeDoubleVector &container)
 Imports the pose from a MADARA container. More...
 
void from_container (const std::vector< double > &container)
 Imports the pose from a STL vector container. More...
 
double get (int i) const
 Retrives i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz. More...
 
double get (size_t i) const
 Get i'th value in this Coordinate. More...
 
double get (size_t i) const
 Get i'th value in this Coordinate. More...
 
bool is_location_set () const
 
bool is_location_zero () const
 
bool is_orientation_set () const
 Tests if the orientation/orientation has been set. More...
 
bool is_orientation_zero () const
 Tests if all orientation information is zero. More...
 
bool is_position_set () const
 Tests if the position is set (valid). More...
 
bool is_position_zero () const
 Tests if all position information is zero. More...
 
bool is_set () const
 Tests if this Pose is invalid; i.e., any values are INVAL_COORD. More...
 
bool is_zero () const
 Tests if all pose information is zero. More...
 
double norm () const
 Passthrough to Eigen vector norm method. More...
 
double norm () const
 Passthrough to Eigen vector norm method. More...
 
PositionVector normalized () const
 Passthrough to Eigen vector normalized method. More...
 
OrientationVector normalized () const
 Passthrough to Eigen vector normalized method. More...
 
template<typename Derived2 >
 operator BasicVector< Derived2, units::absolute< units::length >> () const
 
template<typename Derived2 >
 operator BasicVector< Derived2, units::absolute< units::plane_angle >> () const
 
bool operator== (const BasicPose &rhs) const
 Tests for exact equality. More...
 
Derived & self ()
 
const Derived & self () const
 
double set (int i, double val)
 Sets i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz. More...
 
double set (size_t i, double v)
 Set i'th value in this Coordinate. More...
 
double set (size_t i, double v)
 Set i'th value in this Coordinate. More...
 
int size () const
 Get the number of values this coordinate type uses. More...
 
double squaredNorm () const
 Passthrough to Eigen vector squaredNorm method. More...
 
double squaredNorm () const
 Passthrough to Eigen vector squaredNorm method. More...
 
void to_array (ContainType &out) const
 Outputs this Coordinates values to the referenced container. More...
 
void to_array (ContainType &out) const
 Outputs this Coordinates values to the referenced container. More...
 
void to_container (madara::knowledge::containers::NativeDoubleVector &container) const
 Saves the pose to a MADARA container. More...
 
std::string to_string (const std::string &delimiter=", ", const std::string &unset_identifier="<unset>") const
 Returns a string of the values x, y, z, rx, ry, rz. More...
 

Static Public Member Functions

static constexpr bool fixed ()
 Is this coordinate a fixed vector? More...
 
static constexpr bool fixed ()
 Is this coordinate a fixed vector? More...
 
static constexpr bool free ()
 Is this coordinate a free vector? More...
 
static constexpr bool free ()
 Is this coordinate a free vector? More...
 
static std::string name ()
 Get the name of this coordinate type. More...
 
static constexpr bool positional ()
 Is this coordinate a positional one? More...
 
static constexpr bool positional ()
 Is this coordinate a positional one? More...
 
static constexpr bool rotational ()
 Is this coordinate a rotational one? More...
 
static constexpr bool rotational ()
 Is this coordinate a rotational one? More...
 

Static Public Attributes

static constexpr const char * type_name = "Position" "Vector"
 
static constexpr const char * type_name = "Orientation" "Vector"
 

Detailed Description

template<typename Derived>
class gams::pose::BasicPose< Derived >

Underlying template for all Pose types, including PoseVector, Pose, and StampedPose See PositionVector and OrientationVector for representation deatils.

Definition at line 73 of file Pose.h.

Member Typedef Documentation

template<typename Derived>
typedef BasicPose gams::pose::BasicPose< Derived >::BaseType

Definition at line 276 of file Pose.h.

template<typename Derived>
using gams::pose::BasicPose< Derived >::derived_type = Derived

Definition at line 76 of file Pose.h.

Constructor & Destructor Documentation

template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( double  x,
double  y 
)
inline

Constructs a BasicPose from individual position values.

Parameters
xposition along x-axis
yposition along y-axis

Definition at line 84 of file Pose.h.

template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( double  x,
double  y,
double  z 
)
inline

Constructs a BasicPose from individual position values.

Parameters
xposition along x-axis
yposition along y-axis
zposition along z-axis

Definition at line 94 of file Pose.h.

template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( double  x,
double  y,
double  z,
double  rx,
double  ry,
double  rz 
)

Constructs a BasicPose from individual position and orientation values.

Parameters
xposition along x-axis
yposition along y-axis
zposition along z-axis
rxlength of orientation vector along x-axis
rylength of orientation vector along y-axis
rzlength of orientation vector along z-axis
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const PositionVector pos)

Construct a BasicPose from a PositionVector.

Orientation info will be all zeros (is_orientation_zero () == true)

Parameters
locthe PositionVector to get position info from.
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const OrientationVector rot)

Construct a BasicPose from a OrientationVector.

Position info will be all zeros (is_position () == true)

Parameters
rotthe OrientationVector to get position info from.
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const PositionVector pos,
const OrientationVector rot 
)

Construct from individual PositionVector and OrientationVector.

Parameters
locthe PositionVector
rotthe OrientationVector
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( )

Default constructor.

All values will be INVAL_COORD

template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const madara::knowledge::containers::DoubleVector &  vec)
explicit

Constructor from MADARA DoubleVector.

Parameters
vecthe vector to get values from (index 0, 1, 2, 3, 4, 5 go to x, y, z, rx, ry, rz)
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const madara::knowledge::containers::NativeDoubleVector &  vec)
explicit

Constructor from MADARA NativeDoubleVector.

Parameters
vecthe vector to get values from (index 0, 1, 2, 3, 4, 5 go to x, y, z, rx, ry, rz)
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const madara::knowledge::containers::DoubleVector &  vec_loc,
const madara::knowledge::containers::DoubleVector &  vec_rot 
)
explicit

Constructor from two MADARA DoubleVectors, for position and orientation.

Parameters
vec_locposition values from (0, 1, 2 into x, y, z)
vec_rotorientation values from (0, 1, 2 into rx, ry, rz)
template<typename Derived>
gams::pose::BasicPose< Derived >::BasicPose ( const madara::knowledge::containers::NativeDoubleVector &  vec_loc,
const madara::knowledge::containers::NativeDoubleVector &  vec_rot 
)
explicit

Constructor from two MADARA NativeDoubleVector, for position/orientation.

Parameters
vec_locposition values from (0, 1, 2 into x, y, z)
vec_rotorientation values from (0, 1, 2 into rx, ry, rz)

Member Function Documentation

template<typename Derived>
template<typename Derived2 >
bool gams::pose::BasicPose< Derived >::approximately_equal ( const BasicPose< Derived2 > &  other,
double  epsilon 
) const
inline

Tests if this Coordinate is within epsilon in distance (as defined by this Coordinate's reference frame's distance metric).

If the other Coordinate is in a different reference frame, it is first copied, and converted to this Coordinate's reference frame.

Parameters
otherthe other Coordinate to test against
epsilonthe maximum distance permitted to return true
Returns
true if the distance is less than or equal to epsilon

Definition at line 333 of file Pose.h.

template<typename Derived>
PositionVector& gams::pose::BasicPose< Derived >::as_location_vec ( )
template<typename Derived>
const PositionVector& gams::pose::BasicPose< Derived >::as_location_vec ( ) const
template<typename Derived>
OrientationVector& gams::pose::BasicPose< Derived >::as_orientation_vec ( )

Gets a reference to this object's Orientation part.

Returns
reference to the OrientationVector
template<typename Derived>
const OrientationVector& gams::pose::BasicPose< Derived >::as_orientation_vec ( ) const

Gets a const reference to this object's Orientation part.

Returns
const reference to the OrientationVector
template<typename Derived>
PositionVector& gams::pose::BasicPose< Derived >::as_position_vec ( )

Gets a reference to this object's Position part.

Returns
reference to the PositionVector
template<typename Derived>
const PositionVector& gams::pose::BasicPose< Derived >::as_position_vec ( ) const

Gets a const reference to this object's Position part.

Returns
const reference to the PositionVector
template<typename Derived>
BaseType& gams::pose::BasicPose< Derived >::as_vec ( )

Gets a reference to this object.

Useful for derived types.

Returns
reference to this object.
template<typename Derived>
const BaseType& gams::pose::BasicPose< Derived >::as_vec ( ) const

Gets a const reference to this object.

Useful for derived types.

Returns
const reference to this object.

Passthrough to Eigen vector cross method.

Definition at line 704 of file Coordinate.h.

Passthrough to Eigen vector cross method.

Definition at line 704 of file Coordinate.h.

template<typename Derived>
template<typename Derived2 >
double gams::pose::BasicPose< Derived >::distance_to ( const BasicPose< Derived2 > &  target) const
inline

Definition at line 343 of file Pose.h.

double gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::dot ( const BasicVector< Other, units::absolute< units::length > > &  other) const
inlineinherited

Passthrough to Eigen vector dot method.

Definition at line 695 of file Coordinate.h.

double gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::dot ( const BasicVector< Other, units::absolute< units::plane_angle > > &  other) const
inlineinherited

Passthrough to Eigen vector dot method.

Definition at line 695 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::fixed ( )
inlinestaticinherited

Is this coordinate a fixed vector?

Definition at line 552 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::fixed ( )
inlinestaticinherited

Is this coordinate a fixed vector?

Definition at line 552 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::free ( )
inlinestaticinherited

Is this coordinate a free vector?

Definition at line 549 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::free ( )
inlinestaticinherited

Is this coordinate a free vector?

Definition at line 549 of file Coordinate.h.

void gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::from_array ( const ContainType &  in)
inlineinherited

Overwrites this Coordinate's values with those pulled from the referenced array.

These values will be within this object's current reference frame. The container must support operator[],

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are ignored.

Template Parameters
ContainTypethe type of the container; must support operator[]
Parameters
inthe container to pull new values from.

Definition at line 627 of file Coordinate.h.

void gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::from_array ( const ContainType &  in)
inlineinherited

Overwrites this Coordinate's values with those pulled from the referenced array.

These values will be within this object's current reference frame. The container must support operator[],

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are ignored.

Template Parameters
ContainTypethe type of the container; must support operator[]
Parameters
inthe container to pull new values from.

Definition at line 627 of file Coordinate.h.

template<typename Derived>
void gams::pose::BasicPose< Derived >::from_container ( const madara::knowledge::containers::NativeDoubleVector &  container)

Imports the pose from a MADARA container.

Parameters
containerthe container to import from
template<typename Derived>
void gams::pose::BasicPose< Derived >::from_container ( const std::vector< double > &  container)

Imports the pose from a STL vector container.

Parameters
containerthe container to import from
template<typename Derived>
double gams::pose::BasicPose< Derived >::get ( int  i) const

Retrives i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz.

Parameters
ithe index
Returns
the i'th coordinate value
Exceptions
std::range_errorif index is less than 0, or greater than 6
double gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::get ( size_t  i) const
inlineinherited

Get i'th value in this Coordinate.

No range checking!

Definition at line 560 of file Coordinate.h.

double gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::get ( size_t  i) const
inlineinherited

Get i'th value in this Coordinate.

No range checking!

Definition at line 560 of file Coordinate.h.

template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_location_set ( ) const
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_location_zero ( ) const
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_orientation_set ( ) const

Tests if the orientation/orientation has been set.

Returns
true if orientation has been set to something valid
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_orientation_zero ( ) const

Tests if all orientation information is zero.

Returns
true if all orientation information is zero
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_position_set ( ) const

Tests if the position is set (valid).

Returns
true if position has been set to something valid
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_position_zero ( ) const

Tests if all position information is zero.

Returns
true if all position information is zero
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_set ( ) const

Tests if this Pose is invalid; i.e., any values are INVAL_COORD.

Returns
true if at least one value is INVAL_COORD
template<typename Derived>
bool gams::pose::BasicPose< Derived >::is_zero ( ) const

Tests if all pose information is zero.

If true, is_position_zero and is_orientation_zero are also true

Returns
true if all pose information is zero
template<typename Derived>
static std::string gams::pose::BasicPose< Derived >::name ( )
static

Get the name of this coordinate type.

Returns
"Pose"
double gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::norm ( ) const
inlineinherited

Passthrough to Eigen vector norm method.

Definition at line 714 of file Coordinate.h.

double gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::norm ( ) const
inlineinherited

Passthrough to Eigen vector norm method.

Definition at line 714 of file Coordinate.h.

Passthrough to Eigen vector normalized method.

Definition at line 730 of file Coordinate.h.

Passthrough to Eigen vector normalized method.

Definition at line 730 of file Coordinate.h.

template<typename Derived>
template<typename Derived2 >
gams::pose::BasicPose< Derived >::operator BasicVector< Derived2, units::absolute< units::length >> ( ) const
inline

Definition at line 145 of file Pose.h.

template<typename Derived>
template<typename Derived2 >
gams::pose::BasicPose< Derived >::operator BasicVector< Derived2, units::absolute< units::plane_angle >> ( ) const
inline

Definition at line 151 of file Pose.h.

template<typename Derived>
bool gams::pose::BasicPose< Derived >::operator== ( const BasicPose< Derived > &  rhs) const

Tests for exact equality.

Parameters
rhsthe other pose to test against
Returns
true if all values equal corresponding values in other pose
static constexpr bool gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::positional ( )
inlinestaticinherited

Is this coordinate a positional one?

Definition at line 543 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::positional ( )
inlinestaticinherited

Is this coordinate a positional one?

Definition at line 543 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::rotational ( )
inlinestaticinherited

Is this coordinate a rotational one?

Definition at line 546 of file Coordinate.h.

static constexpr bool gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::rotational ( )
inlinestaticinherited

Is this coordinate a rotational one?

Definition at line 546 of file Coordinate.h.

template<typename Derived>
Derived& gams::pose::BasicPose< Derived >::self ( )
inline

Definition at line 141 of file Pose.h.

template<typename Derived>
const Derived& gams::pose::BasicPose< Derived >::self ( ) const
inline

Definition at line 142 of file Pose.h.

template<typename Derived>
double gams::pose::BasicPose< Derived >::set ( int  i,
double  val 
)

Sets i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz.

Parameters
ithe index
valthe new value
Returns
the new i'th coordinate value
Exceptions
std::range_errorif index is less than 0, or greater than 6
double gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::set ( size_t  i,
double  v 
)
inlineinherited

Set i'th value in this Coordinate.

No range checking!

Parameters
vthe value to set to
Returns
the new value

Definition at line 568 of file Coordinate.h.

double gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::set ( size_t  i,
double  v 
)
inlineinherited

Set i'th value in this Coordinate.

No range checking!

Parameters
vthe value to set to
Returns
the new value

Definition at line 568 of file Coordinate.h.

template<typename Derived>
int gams::pose::BasicPose< Derived >::size ( ) const

Get the number of values this coordinate type uses.

Returns
6
double gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::squaredNorm ( ) const
inlineinherited

Passthrough to Eigen vector squaredNorm method.

Definition at line 722 of file Coordinate.h.

double gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::squaredNorm ( ) const
inlineinherited

Passthrough to Eigen vector squaredNorm method.

Definition at line 722 of file Coordinate.h.

void gams::pose::BasicVector< PositionVector , units::absolute< units::length > >::to_array ( ContainType &  out) const
inlineinherited

Outputs this Coordinates values to the referenced container.

This container type must support operator[] for setting by index.

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are not changed.

The MADARA DoubleVector and NativeDoubleVector types are supported.

Template Parameters
ContainTypethe type of the container; must support "set"
Parameters
outthe container to put this Coordinate's values into.

Definition at line 606 of file Coordinate.h.

void gams::pose::BasicVector< OrientationVector , units::absolute< units::plane_angle > >::to_array ( ContainType &  out) const
inlineinherited

Outputs this Coordinates values to the referenced container.

This container type must support operator[] for setting by index.

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are not changed.

The MADARA DoubleVector and NativeDoubleVector types are supported.

Template Parameters
ContainTypethe type of the container; must support "set"
Parameters
outthe container to put this Coordinate's values into.

Definition at line 606 of file Coordinate.h.

template<typename Derived>
void gams::pose::BasicPose< Derived >::to_container ( madara::knowledge::containers::NativeDoubleVector &  container) const

Saves the pose to a MADARA container.

Parameters
containerthe container to save to
template<typename Derived>
std::string gams::pose::BasicPose< Derived >::to_string ( const std::string &  delimiter = ", ",
const std::string &  unset_identifier = "<unset>" 
) const

Returns a string of the values x, y, z, rx, ry, rz.

Parameters
delimiterdelimiter between values
unset_identifierif true, include unset values
Returns
stringified version of the Pose

Member Data Documentation

constexpr const char* gams::pose::PositionVector::type_name = "Position" "Vector"
staticinherited

Definition at line 1053 of file Coordinate.h.

constexpr const char* gams::pose::OrientationVector::type_name = "Orientation" "Vector"
staticinherited

Definition at line 1058 of file Coordinate.h.


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