RobWorkProject  23.9.11-
Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
Pose2D< T > Class Template Reference

A Pose3D \( \mathbf{x}\in \mathbb{R}^6 \) describes a position and orientation in 3-dimensions. More...

#include <Pose2D.hpp>

Public Member Functions

 Pose2D ()
 Zero-initialized Pose2D.
 
 Pose2D (rw::math::Vector2D< T > pos, T theta)
 Constructor. More...
 
 Pose2D (T x, T y, T theta)
 Constructor. More...
 
 Pose2D (const rw::math::Transform2D< T > &transform)
 Constructor. More...
 
T & x ()
 Get the first dimension of the position vector. More...
 
T & y ()
 Get the second dimension of the position vector. More...
 
T & theta ()
 Get the angle. More...
 
rw::math::Vector2D< T > & getPos ()
 Get the position vector. More...
 
x () const
 Get the first dimension of the position vector. More...
 
y () const
 Get the second dimension of the position vector. More...
 
theta () const
 Get the angle. More...
 
const rw::math::Vector2D< T > & getPos () const
 Get the position vector. More...
 
const T & operator() (size_t i) const
 Returns reference to vector element (x,y,theta) More...
 
T & operator() (size_t i)
 Returns reference to vector element. More...
 
const T & operator[] (size_t i) const
 Returns reference to vector element. More...
 
T & operator[] (size_t i)
 Returns reference to vector element. More...
 
Eigen::Matrix< T, 3, 1 > e () const
 return a Eigen vector of (x, y, theta). More...
 

Static Public Member Functions

static rw::math::Transform2D< T > transform (const Pose2D< T > &pose)
 The transform corresponding to the pose. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Pose2D< T > &pose)
 Ouputs Pose2D to stream. More...
 

Related Functions

(Note that these are not member functions.)

template<>
void write (const rw::math::Pose2D< double > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)
 
template<>
void write (const rw::math::Pose2D< float > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)
 
template<>
void read (rw::math::Pose2D< double > &sobject, rw::common::InputArchive &iarchive, const std::string &id)
 
template<>
void read (rw::math::Pose2D< float > &sobject, rw::common::InputArchive &iarchive, const std::string &id)
 

Detailed Description

template<class T = double>
class rw::math::Pose2D< T >

A Pose3D \( \mathbf{x}\in \mathbb{R}^6 \) describes a position and orientation in 3-dimensions.

\( {\mathbf{x}} = \left[ \begin{array}{c} x \\ y \\ z \\ \theta k_x \\ \theta k_y \\ \theta k_z \end{array} \right] \)

where \( (x,y,z)\) is the 3d position and \( (\theta k_x, \theta k_y, \theta k_z)\) describes the orientation in equal angle axis (EAA) format.

Constructor & Destructor Documentation

◆ Pose2D() [1/3]

Pose2D ( rw::math::Vector2D< T >  pos,
theta 
)
inline

Constructor.

Parameters
pos[in] the position.
theta[in] the angle.

◆ Pose2D() [2/3]

Pose2D ( x,
y,
theta 
)
inline

Constructor.

Parameters
x[in] the value of the first position dimension.
y[in] the value of the second position dimension.
theta[in] the angle.

◆ Pose2D() [3/3]

Pose2D ( const rw::math::Transform2D< T > &  transform)
inline

Constructor.

Parameters
transform[in] a 2D transform giving the pose.

Member Function Documentation

◆ e()

Eigen::Matrix<T, 3, 1> e ( ) const
inline

return a Eigen vector of (x, y, theta).

Returns
Eigen vector.

◆ getPos() [1/2]

rw::math::Vector2D<T>& getPos ( )
inline

Get the position vector.

Returns
the position.

◆ getPos() [2/2]

const rw::math::Vector2D<T>& getPos ( ) const
inline

Get the position vector.

Returns
the position.

◆ operator()() [1/2]

T& operator() ( size_t  i)
inline

Returns reference to vector element.

Parameters
i[in] index in the vector \(i\in \{0,1\} \)
Returns
reference to element

◆ operator()() [2/2]

const T& operator() ( size_t  i) const
inline

Returns reference to vector element (x,y,theta)

Parameters
i[in] index in the vector \(i\in \{0,1,2\} \)
Returns
const reference to element

◆ operator[]() [1/2]

T& operator[] ( size_t  i)
inline

Returns reference to vector element.

Parameters
i[in] index in the vector \(i\in \{0,1,2\} \)
Returns
reference to element

◆ operator[]() [2/2]

const T& operator[] ( size_t  i) const
inline

Returns reference to vector element.

Parameters
i[in] index in the vector \(i\in \{0,1,2\} \)
Returns
const reference to element

◆ theta() [1/2]

T& theta ( )
inline

Get the angle.

Returns
the angle.

◆ theta() [2/2]

T theta ( ) const
inline

Get the angle.

Returns
the angle.

◆ transform()

static rw::math::Transform2D<T> transform ( const Pose2D< T > &  pose)
inlinestatic

The transform corresponding to the pose.

Parameters
pose[in] the pose.
Returns
equivalent 2D transform.

◆ x() [1/2]

T& x ( )
inline

Get the first dimension of the position vector.

Returns
the position in the first dimension.

◆ x() [2/2]

T x ( ) const
inline

Get the first dimension of the position vector.

Returns
the position in the first dimension.

◆ y() [1/2]

T& y ( )
inline

Get the second dimension of the position vector.

Returns
the position in the second dimension.

◆ y() [2/2]

T y ( ) const
inline

Get the second dimension of the position vector.

Returns
the position in the second dimension.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Pose2D< T > &  pose 
)
friend

Ouputs Pose2D to stream.

Parameters
os[in/out] stream to use
pose[in] pose to output.
Returns
the resulting stream

◆ read() [1/2]

void read ( rw::math::Pose2D< double > &  sobject,
rw::common::InputArchive iarchive,
const std::string &  id 
)
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
sobject[out] the object in which the data should be streamed into
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ read() [2/2]

void read ( rw::math::Pose2D< float > &  sobject,
rw::common::InputArchive iarchive,
const std::string &  id 
)
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
sobject[out] the object in which the data should be streamed into
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ write() [1/2]

void write ( const rw::math::Pose2D< double > &  sobject,
rw::common::OutputArchive oarchive,
const std::string &  id 
)
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
sobject[in] the object from which the data should be streamed.
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ write() [2/2]

void write ( const rw::math::Pose2D< float > &  sobject,
rw::common::OutputArchive oarchive,
const std::string &  id 
)
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
sobject[in] the object from which the data should be streamed.
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

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