Ravelin
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
POSE2 Class Reference

A 2D rigid body pose. More...

#include <Pose2.h>

Inheritance diagram for POSE2:

Public Member Functions

 POSE2 ()
 Default constructor. More...
 
 POSE2 (const POSE2 &source)
 
 POSE2 (const ROT2 &r, const ORIGIN2 &x, boost::shared_ptr< const POSE2 > relative_pose=boost::shared_ptr< const POSE2 >())
 Constructs a 2D pose from a rotation and translation vector.
 
 POSE2 (const ORIGIN2 &x, boost::shared_ptr< const POSE2 > relative_pose=boost::shared_ptr< const POSE2 >())
 Constructs a 2D pose using identity orientation and a translation vector.
 
 POSE2 (const ROT2 &r, boost::shared_ptr< const POSE2 > relative_pose=boost::shared_ptr< const POSE2 >())
 Constructs a 2D pose from a rotation and zero translation.
 
VECTOR2 transform_point (const VECTOR2 &v) const
 Transforms a point from one pose to another.
 
VECTOR2 transform_vector (const VECTOR2 &v) const
 Transforms a vector from one pose to another.
 
VECTOR2 inverse_transform_point (const VECTOR2 &v) const
 Transforms a point from one pose to another.
 
VECTOR2 inverse_transform_vector (const VECTOR2 &v) const
 Transforms a vector from one pose to another.
 
POSE2set_identity ()
 Sets this matrix to identity.
 
POSE2invert ()
 Special method for inverting a 2D pose in place.
 
POSE2 inverse () const
 
POSE2set (const ROT2 &r, const ORIGIN2 &v)
 Sets the pose from a rotation and translation vector.
 
POSE2set (const ROT2 &r)
 Sets this pose from a rotation only (translation will be zero'd)
 
POSE2operator= (const POSE2 &source)
 
POSE2 operator* (const POSE2 &m) const
 Transforms this pose by another.
 

Static Public Member Functions

static POSE2 identity ()
 
static REAL wrap (REAL theta)
 Wraps an angle to [-pi, pi].
 
static bool rel_equal (const POSE2 &p1, const POSE2 &p2, REAL tol=EPS)
 Determines whether two poses in 2D are relatively equivalent.
 
static VECTOR2 transform_point (boost::shared_ptr< const POSE2 > target, const VECTOR2 &v)
 Transforms a point from one pose to another.
 
static VECTOR2 transform_vector (boost::shared_ptr< const POSE2 > target, const VECTOR2 &v)
 Applies this pose to a vector.
 
static POSE2 invert (const POSE2 &m)
 Special method for inverting a 2D pose.
 
static VECTOR2 interpolate_transform_vector (const POSE2 &P1, const POSE2 &P2, REAL t, const ORIGIN2 &o)
 Tranforms a vector with an interpolated pose (between poses P1 and P2) More...
 
static VECTOR2 interpolate_transform_point (const POSE2 &P1, const POSE2 &P2, REAL t, const ORIGIN2 &o)
 Tranforms a point with an interpolated pose (between poses P1 and P2) More...
 

Public Attributes

ROT2 r
 the orientation of the pose frame
 
ORIGIN2 x
 the position of the pose frame
 
boost::shared_ptr< const POSE2rpose
 the pose that this pose is relative to (if any)
 

Detailed Description

A 2D rigid body pose.

Constructor & Destructor Documentation

POSE2::POSE2 ( )

Default constructor.

Sets matrix to the identity matrix

References set_identity().

Referenced by invert(), and operator*().

Member Function Documentation

VECTOR2 POSE2::interpolate_transform_point ( const POSE2 P1,
const POSE2 P2,
REAL  t,
const ORIGIN2 o 
)
static

Tranforms a point with an interpolated pose (between poses P1 and P2)

Parameters
P1the pose to use when t=0
P2the pose to use when t=1
tinterpolation value
othe point to transform
Returns
the transformed point

References r, rpose, ROT2::theta, wrap(), and x.

VECTOR2 POSE2::interpolate_transform_vector ( const POSE2 P1,
const POSE2 P2,
REAL  t,
const ORIGIN2 o 
)
static

Tranforms a vector with an interpolated pose (between poses P1 and P2)

Parameters
P1the pose to use when t=0
P2the pose to use when t=1
tinterpolation value
othe vector to transform
Returns
the transformed vector

References r, rpose, ROT2::theta, and wrap().


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