g2o
Public Member Functions | Public Attributes | Protected Attributes | List of all members
g2o::tutorial::SE2 Class Reference

#include <se2.h>

Public Member Functions

 SE2 ()
 
 SE2 (double x, double y, double theta)
 
const Eigen::Vector2d & translation () const
 
Eigen::Vector2d & translation ()
 
const Eigen::Rotation2Dd & rotation () const
 
Eigen::Rotation2Dd & rotation ()
 
SE2 operator* (const SE2 &tr2) const
 
SE2operator*= (const SE2 &tr2)
 
Eigen::Vector2d operator* (const Eigen::Vector2d &v) const
 
SE2 inverse () const
 
double operator[] (int i) const
 
double & operator[] (int i)
 
void fromVector (const Eigen::Vector3d &v)
 
Eigen::Vector3d toVector () const
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Attributes

Eigen::Rotation2Dd _R
 
Eigen::Vector2d _t
 

Detailed Description

Definition at line 42 of file se2.h.

Constructor & Destructor Documentation

g2o::tutorial::SE2::SE2 ( )
inline

Definition at line 45 of file se2.h.

45 :_R(0),_t(0,0){}
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
g2o::tutorial::SE2::SE2 ( double  x,
double  y,
double  theta 
)
inline

Definition at line 47 of file se2.h.

47 :_R(theta),_t(x,y){}
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111

Member Function Documentation

void g2o::tutorial::SE2::fromVector ( const Eigen::Vector3d &  v)
inline

Definition at line 98 of file se2.h.

98  {
99  *this=SE2(v[0], v[1], v[2]);
100  }
SE2 g2o::tutorial::SE2::inverse ( ) const
inline

Definition at line 76 of file se2.h.

References _R, _t, and g2o::normalize_theta().

Referenced by g2o::tutorial::EdgeSE2::setMeasurement(), g2o::tutorial::ParameterSE2Offset::setOffset(), and g2o::tutorial::Simulator::simulate().

76  {
77  SE2 ret;
78  ret._R=_R.inverse();
79  ret._R.angle()=normalize_theta(ret._R.angle());
80  ret._t=ret._R*(Eigen::Vector2d(-1 * _t));
81  return ret;
82  }
double normalize_theta(double theta)
Definition: misc.h:94
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
SE2 g2o::tutorial::SE2::operator* ( const SE2 tr2) const
inline

Definition at line 57 of file se2.h.

References _R, _t, and g2o::normalize_theta().

57  {
58  SE2 result(*this);
59  result._t += _R*tr2._t;
60  result._R.angle()+= tr2._R.angle();
61  result._R.angle()=normalize_theta(result._R.angle());
62  return result;
63  }
double normalize_theta(double theta)
Definition: misc.h:94
Eigen::Rotation2Dd _R
Definition: se2.h:111
Eigen::Vector2d g2o::tutorial::SE2::operator* ( const Eigen::Vector2d &  v) const
inline

Definition at line 72 of file se2.h.

72  {
73  return _t+_R*v;
74  }
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
SE2& g2o::tutorial::SE2::operator*= ( const SE2 tr2)
inline

Definition at line 65 of file se2.h.

References _R, _t, and g2o::normalize_theta().

65  {
66  _t+=_R*tr2._t;
67  _R.angle()+=tr2._R.angle();
68  _R.angle()=normalize_theta(_R.angle());
69  return *this;
70  }
double normalize_theta(double theta)
Definition: misc.h:94
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
double g2o::tutorial::SE2::operator[] ( int  i) const
inline

Definition at line 84 of file se2.h.

84  {
85  assert (i>=0 && i<3);
86  if (i<2)
87  return _t(i);
88  return _R.angle();
89  }
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
double& g2o::tutorial::SE2::operator[] ( int  i)
inline

Definition at line 91 of file se2.h.

91  {
92  assert (i>=0 && i<3);
93  if (i<2)
94  return _t(i);
95  return _R.angle();
96  }
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Rotation2Dd _R
Definition: se2.h:111
const Eigen::Rotation2Dd& g2o::tutorial::SE2::rotation ( ) const
inline

Definition at line 53 of file se2.h.

Referenced by g2o::tutorial::ParameterSE2Offset::write().

53 {return _R;}
Eigen::Rotation2Dd _R
Definition: se2.h:111
Eigen::Rotation2Dd& g2o::tutorial::SE2::rotation ( )
inline

Definition at line 55 of file se2.h.

55 {return _R;}
Eigen::Rotation2Dd _R
Definition: se2.h:111
Eigen::Vector3d g2o::tutorial::SE2::toVector ( ) const
inline

Definition at line 102 of file se2.h.

Referenced by g2o::tutorial::EdgeSE2::computeError(), and g2o::tutorial::Simulator::sampleTransformation().

102  {
103  Eigen::Vector3d ret;
104  for (int i=0; i<3; i++){
105  ret(i)=(*this)[i];
106  }
107  return ret;
108  }
const Eigen::Vector2d& g2o::tutorial::SE2::translation ( ) const
inline

Definition at line 49 of file se2.h.

Referenced by g2o::tutorial::Simulator::simulate(), and g2o::tutorial::ParameterSE2Offset::write().

49 {return _t;}
Eigen::Vector2d _t
Definition: se2.h:112
Eigen::Vector2d& g2o::tutorial::SE2::translation ( )
inline

Definition at line 51 of file se2.h.

51 {return _t;}
Eigen::Vector2d _t
Definition: se2.h:112

Member Data Documentation

Eigen::Rotation2Dd g2o::tutorial::SE2::_R
protected

Definition at line 111 of file se2.h.

Referenced by inverse(), operator*(), and operator*=().

Eigen::Vector2d g2o::tutorial::SE2::_t
protected

Definition at line 112 of file se2.h.

Referenced by inverse(), operator*(), and operator*=().

g2o::tutorial::SE2::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 44 of file se2.h.


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