RobWorkProject
Public Member Functions | Friends | Related Functions | List of all members
RPY< T > Class Template Reference

A class for representing Roll-Pitch-Yaw Euler angle rotations. More...

#include <RPY.hpp>

Inherits Rotation3DVector< T >.

Public Member Functions

 RPY ()
 Constructs rotation in which all elements are initialized to 0.
 
 RPY (T roll, T pitch, T yaw)
 Constructs an initialized roll-pitch-yaw euler angle vector. More...
 
 RPY (const Rotation3D< T > &R, T epsilon=1e-5)
 Constructs an RPY object initialized according to the specified Rotation3D. More...
 
const Rotation3D< T > toRotation3D () const
 Returns the corresponding $ 3\times 3 $ Rotation matrix. More...
 
T & operator() (size_t index)
 Returns reference to the element. More...
 
const T & operator() (size_t index) const
 Returns a const reference the an element. More...
 
const T & operator[] (size_t i) const
 Returns a const reference the an element. More...
 
T & operator[] (size_t i)
 Returns reference to the element. More...
 
bool operator== (const RPY< T > &rhs) const
 Comparison operator. More...
 
bool operator!= (const RPY< T > &rhs) const
 Comparison operator. More...
 
size_t size () const
 size of this RPY. More...
 
- Public Member Functions inherited from Rotation3DVector< T >
virtual ~Rotation3DVector ()
 Virtual destructor.
 

Friends

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

Related Functions

(Note that these are not member functions.)

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

Additional Inherited Members

- Protected Member Functions inherited from Rotation3DVector< T >
 Rotation3DVector (const Rotation3DVector &)
 Copy Constructor. More...
 
Rotation3DVectoroperator= (const Rotation3DVector &)
 Assignment operator is protected to force subclasses to implement it by themself.
 
 Rotation3DVector ()
 Default Constructor.
 

Detailed Description

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

A class for representing Roll-Pitch-Yaw Euler angle rotations.

Constructor & Destructor Documentation

◆ RPY() [1/2]

RPY ( roll,
pitch,
yaw 
)
inline

Constructs an initialized roll-pitch-yaw euler angle vector.

Parameters
rollRotation around z
pitchRotation around y
yawRotation around x

◆ RPY() [2/2]

RPY ( const Rotation3D< T > &  R,
epsilon = 1e-5 
)
explicit

Constructs an RPY object initialized according to the specified Rotation3D.

$ \beta = arctan2(-r_{31},\sqrt{r_{11}^2+r_{21}^2}) $ $ \alpha = arctan2(r_{21}/cos(\beta), r_{11}/cos(\beta)) $ $ \beta = arctan2(r_{32}/cos(\beta), r_{33}/cos(\beta))) $

Parameters
R[in] A 3x3 rotation matrix $ \mathbf{R} $
epsilon[in] Value specifying the value for which $ cos(\beta)$ is assumed 0 and the special case solution assuming $\alpha=0, \beta=\pi/2 and \gamma = arctan2(r_{21}, r_{22})$ is to be used.

Member Function Documentation

◆ operator!=()

bool operator!= ( const RPY< T > &  rhs) const
inline

Comparison operator.

The comparison operator makes a element wise comparison. Returns true if any of the elements are different.

Parameters
rhs[in] RPY to compare with
Returns
True if not equal.

◆ operator()() [1/2]

T& operator() ( size_t  index)
inline

Returns reference to the element.

Parameters
index[in] index of element
Returns
reference to the element

◆ operator()() [2/2]

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

Returns a const reference the an element.

Parameters
index[in] index of element
Returns
const reference to the element

◆ operator==()

bool operator== ( const RPY< T > &  rhs) const
inline

Comparison operator.

The comparison operator makes a element wise comparison. Returns true only if all elements are equal.

Parameters
rhs[in] RPY to compare with
Returns
True if equal.

◆ operator[]() [1/2]

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

Returns a const reference the an element.

Parameters
i[in] index of element
Returns
const reference to the element

◆ operator[]() [2/2]

T& operator[] ( size_t  i)
inline

Returns reference to the element.

Parameters
i[in] index of element
Returns
reference to the element

◆ size()

size_t size ( ) const
inline

size of this RPY.

Returns
the value 3

◆ toRotation3D()

const Rotation3D<T> toRotation3D ( ) const
virtual

Returns the corresponding $ 3\times 3 $ Rotation matrix.

Returns
The rotation matrix

Implements Rotation3DVector< T >.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RPY< T > &  rpy 
)
friend

Ouputs RPY to stream.

Parameters
os[in/out] stream to use
rpy[in] rpy rotation
Returns
the resulting stream

◆ read() [1/2]

void read ( rw::math::RPY< 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::RPY< 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::RPY< 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::RPY< 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 file: