Follow this link to skip to the main content

claraty::HTrans< T > Class Template Reference

#include <htrans.h>

Inheritance diagram for claraty::HTrans< T >:

Inheritance graph
[legend]
Collaboration diagram for claraty::HTrans< T >:

Collaboration graph
[legend]
List of all members.

Mutators

void set_x (T x)
void set_y (T y)
void set_z (T z)
void set_xy (T x, T y)
void set_xyz (T x, T y, T z)
void set_translation (const Point< T > &p)
void set_rotation (const RMatrix< T > &r)
void set_rotation (const Quaternion< T > &r)
bool io (FDM_Map map)
static const Base_Trans< T,
Rotation_Type > 
identity

Public Member Functions

void set_heading (double angle)
void set_absolute_heading (double angle)
get_heading () const
Point< T > operator * (const Point< T > &rhs) const
HTrans< T > operator * (const HTrans< T > &rhs) const
Observers
get_roll () const
get_pitch () const
get_yaw () const
void get_rpy_angles (T &r, T &p, T &y) const
Mutators
void set (T x, T y, T z, T rx, T ry=T(), T rz=T())
void set_rpy_angles (T rx, T ry, T rz)
Operators
 operator Point () const
 operator Rotation_Type () const
Trans operator * (const Trans &t) const
Trans rotate_x (T angle) const
Trans rotate_y (T angle) const
Trans rotate_z (T angle) const
Trans rotate (T rx, T ry, T rz) const
Trans rotate (const Rotation_Type &r) const
Trans translate_x (T x) const
Trans translate_y (T y) const
Trans translate_z (T z) const
Trans translate (T x, T y=T(), T z=T()) const
Trans translate (const Point< T > &p) const
Trans transform (const Trans &t)
void set_identity ()
Observers
get_x () const
get_y () const
get_z () const
void get_xyz (T &x, T &y, T &z) const
Rotation_Type get_rotation () const
const Point< T > & get_translation () const
distance_from (const Trans &h) const
Trans relative_to (const Trans &h) const

Public Attributes

Point< T > _p
Rotation_Type _r

Friends

template<class Y>
std::ostream & operator<< (std::ostream &os, const HTrans< Y > &h)
template<class Y>
HTrans< Y > inverse (const HTrans< Y > &q)

Detailed Description

template<class T>
class claraty::HTrans< T >

Definition at line 50 of file htrans.h.


Constructor & Destructor Documentation

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt,
const RMatrix< T > &  r 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Trans< T, RMatrix< T > > &  t  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( x,
y,
z,
roll,
pitch,
yaw 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt,
r,
p,
y 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const RMatrix< T > &  r  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( x1 = T(),
y1 = T(),
z1 = T() 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Base_Trans< T, RMatrix< T > > &  t  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt,
const RMatrix< T > &  r 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Trans< T, RMatrix< T > > &  t  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( x,
y,
z,
roll,
pitch,
yaw 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt,
r,
p,
y 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const RMatrix< T > &  r  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( x1 = T(),
y1 = T(),
z1 = T() 
) [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Point< T > &  pt  )  [inline]

template<class T>
claraty::HTrans< T >::HTrans ( const Base_Trans< T, RMatrix< T > > &  t  )  [inline]


Member Function Documentation

template<class T>
T claraty::HTrans< T >::get_roll (  )  const [inline]

Definition at line 92 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r.

00092 {T r,p,y; this->_r.get_rpy_angles(r,p,y); return r;}

template<class T>
T claraty::HTrans< T >::get_pitch (  )  const [inline]

Definition at line 93 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r.

00093 {T r,p,y; this->_r.get_rpy_angles(r,p,y); return p;}

template<class T>
T claraty::HTrans< T >::get_yaw (  )  const [inline]

Definition at line 94 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r.

Referenced by claraty::HTrans< T >::get_heading().

00094 {T r,p,y; this->_r.get_rpy_angles(r,p,y); return y;}

template<class T>
void claraty::HTrans< T >::get_rpy_angles ( T &  r,
T &  p,
T &  y 
) const [inline]

Definition at line 96 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r.

00096 {this->_r.get_rpy_angles(r,p,y);}

template<class T>
void claraty::HTrans< T >::set ( x,
y,
z,
rx,
ry = T(),
rz = T() 
) [inline]

Definition at line 104 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r, claraty::RPY, and claraty::Trans< T, Rotation_Type >::set_xyz().

00105     { set_xyz(x,y,z); this->_r = RMatrix<T>(RPY, rx, ry, rz); }

Here is the call graph for this function:

template<class T>
void claraty::HTrans< T >::set_rpy_angles ( rx,
ry,
rz 
) [inline]

Definition at line 107 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RPY.

00107 { this->_r = RMatrix<T>(RPY, rx, ry, rz);}

template<class T>
void claraty::HTrans< T >::set_heading ( double  angle  )  [inline]

Definition at line 112 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RZ.

00112 {this->_r = this->_r * RMatrix<T>(RZ, angle);}

template<class T>
void claraty::HTrans< T >::set_absolute_heading ( double  angle  )  [inline]

Definition at line 113 of file htrans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RZ.

00113 {this->_r = RMatrix<T>(RZ, angle);}

template<class T>
T claraty::HTrans< T >::get_heading (  )  const [inline]

Definition at line 114 of file htrans.h.

References claraty::HTrans< T >::get_yaw().

00114 {return get_yaw();}

Here is the call graph for this function:

template<class T>
Point< T > claraty::HTrans< T >::operator * ( const Point< T > &  rhs  )  const [inline]

Operator to multiply a Trans and a Point

Parameters:
[in] rhs Point to be multiplied
Returns:
Point resulting from operation

Reimplemented from claraty::Trans< T, Rotation_Type >.

Definition at line 183 of file htrans.h.

00184 {
00185   return Trans< T, RMatrix <T> >::operator*(rhs);
00186 }

template<class T>
HTrans< T > claraty::HTrans< T >::operator * ( const HTrans< T > &  rhs  )  const [inline]

Definition at line 190 of file htrans.h.

00191 {
00192   return Trans< T, RMatrix <T> >::operator*(rhs);
00193 }

template<class T, class Rotation_Type>
claraty::Trans< T, Rotation_Type >::operator Point (  )  const [inline, inherited]

Definition at line 96 of file trans.h.

00096 { return get_translation(); }

template<class T, class Rotation_Type>
claraty::Trans< T, Rotation_Type >::operator Rotation_Type (  )  const [inline, inherited]

Definition at line 97 of file trans.h.

References claraty::Trans< T, Rotation_Type >::get_rotation().

00097 { return get_rotation(); }

Here is the call graph for this function:

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::operator * ( const Trans< T, Rotation_Type > &  t  )  const [inline, inherited]

Operator to multiply a Trans and another Trans

Parameters:
[in] t Trans to be multiplied
Returns:
Trans resulting from the operation

Definition at line 271 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, and claraty::Base_Trans< T, Rotation_Type >::_r.

00273 {
00274   Trans<T, Rotation_Type> result;
00275   result._r  = this->_r * t._r;
00276   result._p  = this->_r * t._p;
00277   result._p += this->_p;          
00278   return result;
00279 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::rotate_x ( angle  )  const [inline, inherited]

Operator to rotate the Trans by the specified angle about the X-axis

Parameters:
[in] angle Angle to rotate by
Returns:
Trans resulting from the rotation

Definition at line 291 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RX.

Referenced by claraty::Transform_IO::_extract_rot_x_attributes().

00292 {
00293   Rotation_Type r = this->_r * Rotation_Type(RX, angle);
00294   return Trans<T, Rotation_Type>(this->_p, r);
00295 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::rotate_y ( angle  )  const [inline, inherited]

Operator to rotate the Trans by the specified angle about the Y-axis

Parameters:
[in] angle Angle to rotate by
Returns:
Trans resulting from the rotation

Definition at line 307 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RY.

Referenced by claraty::Transform_IO::_extract_rot_y_attributes().

00308 {
00309   Rotation_Type r = this->_r * Rotation_Type(RY, angle);
00310   return Trans<T, Rotation_Type>(this->_p, r);
00311 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::rotate_z ( angle  )  const [inline, inherited]

Operator to rotate the Trans by the specified angle about the Z-axis

Parameters:
[in] angle Angle to rotate by
Returns:
Trans resulting from the rotation

Definition at line 323 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RZ.

Referenced by claraty::Transform_IO::_extract_rot_z_attributes(), and claraty::ME_Joint::get_transform().

00324 {
00325   Rotation_Type r = this->_r * Rotation_Type(RZ, angle);
00326   return Trans<T, Rotation_Type>(this->_p, r);
00327 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::rotate ( rx,
ry,
rz 
) const [inline, inherited]

Operator to rotate the Trans by the specified RPY angles

Parameters:
[in] rx Roll angle to rotate by
[in] ry Pitch angle to rotate by
[in] rz Yaw angle to rotate by
Returns:
Trans resulting from the rotation

Definition at line 341 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, claraty::Base_Trans< T, Rotation_Type >::_r, and claraty::RPY.

Referenced by claraty::Transform_IO::_extract_three_angle_set_attributes().

00343 {
00344   Rotation_Type r = this->_r * Rotation_Type(RPY, rx, ry, rz);
00345   return Trans<T, Rotation_Type>(this->_p, r);
00346 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::rotate ( const Rotation_Type &  r  )  const [inline, inherited]

Operator to rotate the Trans by the rotation specified in the Rotation_Type

Parameters:
[in] r Rotation_Type to rotate by
Returns:
Trans resulting from the rotation

Definition at line 359 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, and claraty::Base_Trans< T, Rotation_Type >::_r.

00361 {
00362   Rotation_Type rOut = this->_r * r;
00363   return Trans<T, Rotation_Type>(this->_p, rOut);
00364 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::translate_x ( x  )  const [inline, inherited]

Operator to translate by the specified distance along the X-axis

Parameters:
[in] x Distance to translate
Returns:
Trans resulting from the translation

Definition at line 376 of file trans.h.

References claraty::Trans< T, Rotation_Type >::translate().

00377 {
00378   return translate(Point<T>(x, 0.0, 0.0));
00379 }

Here is the call graph for this function:

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::translate_y ( y  )  const [inline, inherited]

Operator to translate by the specified distance along the Y-axis

Parameters:
[in] y Distance to translate
Returns:
Trans resulting from the translation

Definition at line 391 of file trans.h.

References claraty::Trans< T, Rotation_Type >::translate().

00392 {
00393   return translate(Point<T>(0.0, y, 0.0));
00394 }

Here is the call graph for this function:

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::translate_z ( z  )  const [inline, inherited]

Operator to translate by the specified distance along the Z-axis

Parameters:
[in] z Distance to translate
Returns:
Trans resulting from the translation

Definition at line 406 of file trans.h.

References claraty::Trans< T, Rotation_Type >::translate().

Referenced by claraty::Wheel_Model::get_ground_contact(), and claraty::ME_Joint::get_transform().

00407 {
00408   return translate(Point<T>(0.0, 0.0, z));
00409 }

Here is the call graph for this function:

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::translate ( x,
y = T(),
z = T() 
) const [inline, inherited]

Operator to translate by the specified distance along the X, Y, Z axes respectively.

Parameters:
[in] x Distance to translate along the X-axis
[in] y Distance to translate along the Y-axis
[in] z Distance to translate along the Z-axis
Returns:
Trans resulting from the translation

Definition at line 425 of file trans.h.

Referenced by claraty::Trans< T, Rotation_Type >::translate_x(), claraty::Trans< T, Rotation_Type >::translate_y(), and claraty::Trans< T, Rotation_Type >::translate_z().

00427 {
00428   return translate(Point<T>(x, y, z));
00429 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::translate ( const Point< T > &  p  )  const [inline, inherited]

Operator to translate by the distance specified in the Point

Parameters:
[in] p Point to translate
Returns:
Trans resulting from the translation

Definition at line 442 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, and claraty::Base_Trans< T, Rotation_Type >::_r.

00443 {
00444   Trans<T, Rotation_Type> result(*this);
00445   result._p =  this->_r*p + this->_p;
00446   return result;
00447 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::transform ( const Trans< T, Rotation_Type > &  t  )  [inherited]

Transform the current transform by the arg. transform

Parameters:
[in] t Trans to use for transform
Returns:
Trans identity

Definition at line 741 of file trans.h.

00742 {
00743   return *this * t;
00744 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_identity (  )  [inherited]

Convert this Trans to identity

Returns:
Trans identity

Definition at line 726 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, and claraty::Base_Trans< T, Rotation_Type >::_r.

Referenced by claraty::ME_Body_IO::extract_from_parse_tree().

00727 {
00728   this->_p(0) = 0.0; this->_p(1) = 0.0; this->_p(2) = 0.0;
00729   this->_r.set_identity();
00730 }

template<class T, class Rotation_Type>
T claraty::Trans< T, Rotation_Type >::get_x (  )  const [inline, inherited]

Get the translation component along the X-axis

Returns:
Distance along the specified axis

Definition at line 458 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00459 {
00460   return this->_p(0);
00461 }

template<class T, class Rotation_Type>
T claraty::Trans< T, Rotation_Type >::get_y (  )  const [inline, inherited]

Get the translation component along the Y-axis

Returns:
Distance along the specified axis

Definition at line 471 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00472 {
00473   return this->_p(1);
00474 }

template<class T, class Rotation_Type>
T claraty::Trans< T, Rotation_Type >::get_z (  )  const [inline, inherited]

Get the translation component along the Z-axis

Returns:
Distance along the specified axis

Definition at line 486 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00487 {
00488   return this->_p(2);
00489 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::get_xyz ( T &  x,
T &  y,
T &  z 
) const [inline, inherited]

Get the translation components along the X,Y,Z-axes

Parameters:
[out] x Value of the translation along the X-axis
[out] y Value of the translation along the Y-axis
[out] z Value of the translation along the Z-axis

Definition at line 504 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00505 {
00506   x = this->_p(0);
00507   y = this->_p(1);
00508   z = this->_p(2);
00509 }

template<class T, class Rotation_Type>
Rotation_Type claraty::Trans< T, Rotation_Type >::get_rotation (  )  const [inline, inherited]

template<class T, class Rotation_Type>
const Point< T > & claraty::Trans< T, Rotation_Type >::get_translation (  )  const [inline, inherited]

Get the translation component

Returns:
Point containing the translation

Definition at line 538 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::N_2DOF_Planar_Arm::initialize(), and claraty::Trans< T, claraty::RMatrix< T > >::operator Point().

00539 {
00540   return this->_p;
00541 }

template<class T, class Rotation_Type>
T claraty::Trans< T, Rotation_Type >::distance_from ( const Trans< T, Rotation_Type > &  h  )  const [inline, inherited]

Return the T distance of this QTrans from the specified QTrans

Parameters:
[in] h Trans to be measured from
Returns:
Distance

Definition at line 696 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::N_2DOF_Planar_Arm::initialize().

00697 {
00698   return this->_p.distance_from(h._p);
00699 }

template<class T, class Rotation_Type>
Trans< T, Rotation_Type > claraty::Trans< T, Rotation_Type >::relative_to ( const Trans< T, Rotation_Type > &  q  )  const [inline, inherited]

Return the Trans that specifies the relative position & orientation of this Trans from the specified QTrans.

Definition at line 710 of file trans.h.

References claraty::Trans< T, Rotation_Type >::inverse.

Referenced by claraty::Frame::get_relative_transform().

00712 {
00713   return inverse(q) * (*this);
00714 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_x ( x  )  [inline, inherited]

Set the X-axis component of the translation

Parameters:
[in] x X-Axis value to set to

Definition at line 569 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::Wheel_Locomotor_Model::convert_length_heading_direction_to_location().

00570 {
00571   this->_p(0) = x;
00572 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_y ( y  )  [inline, inherited]

Set the Y-axis component of the translation

Parameters:
[in] y Y-axis value to set to

Definition at line 584 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::Wheel_Locomotor_Model::convert_length_heading_direction_to_location().

00585 {
00586   this->_p(1) = y;
00587 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_z ( z  )  [inline, inherited]

Set the Z-axis component of the translation

Parameters:
[in] z Z-axis component to set to

Definition at line 599 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00600 {
00601   this->_p(2) = z;
00602 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_xy ( x,
y 
) [inline, inherited]

Set the X,Y-axis component of the translation

Parameters:
[in] x X-axis value to set to
[in] y Y-axis value to set to

Definition at line 615 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

00616 {
00617   this->_p(0) = x; this->_p(1) = y;
00618 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_xyz ( x,
y,
z 
) [inline, inherited]

Set the X,Y,Z-axis component of the translation

Parameters:
[in] x X-axis value to set to
[in] y Y-axis value to set to
[in] z Z-axis value to set to

Definition at line 632 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::Transform_IO::_extract_position_attributes(), claraty::Transform_IO::convert_DH_to_transform(), and claraty::HTrans< T >::set().

00633 {
00634   this->_p(0) = x; this->_p(1) = y; this->_p(2) = z;
00635 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_translation ( const Point< T > &  p  )  [inline, inherited]

Set the translation

Parameters:
[in] p Point containing the translation to set to

Definition at line 553 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p.

Referenced by claraty::Frame_IO::convert_to_internal_format(), and claraty::ME_Body::rotate_center_of_mass().

00554 {
00555   this->_p = p;
00556 }

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_rotation ( const RMatrix< T > &  r  )  [inline, inherited]

template<class T, class Rotation_Type>
void claraty::Trans< T, Rotation_Type >::set_rotation ( const Quaternion< T > &  r  )  [inline, inherited]

Set the rotation component

Parameters:
[in] r Rotation_Type to set to

Definition at line 662 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_r.

00663 {
00664   this->_r = r;
00665 }

template<class T, class Rotation_Type>
bool claraty::Trans< T, Rotation_Type >::io ( FDM_Map  map  )  [inline, inherited]

Definition at line 675 of file trans.h.

References claraty::Base_Trans< T, Rotation_Type >::_p, and claraty::Base_Trans< T, Rotation_Type >::_r.

00676 {
00677   bool ok;
00678 
00679   ok = this->_p.io(map);
00680   ok &= this->_r.io(map);
00681 
00682   return ok;
00683 }


Friends And Related Function Documentation

template<class T>
template<class Y>
std::ostream& operator<< ( std::ostream &  os,
const HTrans< Y > &  h 
) [friend]

template<class T>
template<class Y>
HTrans<Y> inverse ( const HTrans< Y > &  q  )  [friend]


Member Data Documentation


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