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

represent SE2 More...

#include <se2.h>

Public Member Functions

 SE2 ()
 
 SE2 (const Isometry2D &iso)
 
 SE2 (const Vector3D &v)
 
 SE2 (double x, double y, double theta)
 
const Vector2Dtranslation () const
 translational component More...
 
void setTranslation (const Vector2D &t_)
 
const Eigen::Rotation2Dd & rotation () const
 rotational component More...
 
void setRotation (const Eigen::Rotation2Dd &R_)
 
SE2 operator* (const SE2 &tr2) const
 concatenate two SE2 elements (motion composition) More...
 
SE2operator*= (const SE2 &tr2)
 motion composition operator More...
 
Vector2D operator* (const Vector2D &v) const
 project a 2D vector More...
 
SE2 inverse () const
 invert :-) More...
 
double operator[] (int i) const
 
void fromVector (const Vector3D &v)
 assign from a 3D vector (x, y, theta) More...
 
Vector3D toVector () const
 convert to a 3D vector (x, y, theta) More...
 
Isometry2D toIsometry () const
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Attributes

Eigen::Rotation2Dd _R
 
Vector2D _t
 

Detailed Description

represent SE2

Definition at line 40 of file se2.h.

Constructor & Destructor Documentation

g2o::SE2::SE2 ( )
inline

Definition at line 43 of file se2.h.

43 :_R(0),_t(0,0){}
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
g2o::SE2::SE2 ( const Isometry2D iso)
inline

Definition at line 45 of file se2.h.

45  : _R(0), _t(iso.translation()){
46  _R.fromRotationMatrix(iso.linear());
47  }
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
g2o::SE2::SE2 ( const Vector3D v)
inline

Definition at line 49 of file se2.h.

49 :_R(v[2]),_t(v[0],v[1]){}
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
g2o::SE2::SE2 ( double  x,
double  y,
double  theta 
)
inline

Definition at line 51 of file se2.h.

51 :_R(theta),_t(x,y){}
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121

Member Function Documentation

void g2o::SE2::fromVector ( const Vector3D v)
inline
SE2 g2o::SE2::inverse ( ) const
inline

invert :-)

Definition at line 82 of file se2.h.

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

Referenced by g2o::addOdometryCalibLinksDifferential(), g2o::OnlineEdgeSE2::chi2(), g2o::EdgeSE2TwoPointsXY::computeError(), g2o::EdgeSE2LotsOfXY::computeError(), g2o::EdgeSE2PointXYBearing::computeError(), g2o::EdgeSE2PointXY::computeError(), g2o::EdgeSE2Line2D::computeError(), g2o::EdgeSE2OdomDifferentialCalib::computeError(), g2o::EdgeSE2::computeError(), g2o::tutorial::EdgeSE2::computeError(), g2o::EdgeSE2Segment2D::computeError(), g2o::EdgeSE2Segment2DLine::computeError(), g2o::EdgeSE2Segment2DPointLine::computeError(), g2o::EdgeSE2PureCalib::computeError(), EdgeCalib::computeError(), g2o::EdgeSE2SensorCalib::initialEstimate(), g2o::EdgeSE2Offset::initialEstimate(), main(), g2o::EdgeSE2WriteGnuplotAction::operator()(), g2o::RobotLaser::read(), g2o::EdgeSE2::read(), g2o::tutorial::EdgeSE2::read(), g2o::EdgeSE2SensorCalib::read(), g2o::EdgeSE2Prior::read(), g2o::Gm2dlIO::readGm2dl(), g2o::EdgeSE2SensorCalib::setMeasurement(), g2o::EdgeSE2::setMeasurement(), g2o::EdgeSE2Offset::setMeasurement(), g2o::EdgeSE2Prior::setMeasurement(), g2o::EdgeSE2Prior::setMeasurementData(), g2o::EdgeSE2TwoPointsXY::setMeasurementFromState(), g2o::EdgeSE2LotsOfXY::setMeasurementFromState(), g2o::EdgeSE2PointXYBearing::setMeasurementFromState(), g2o::EdgeSE2PointXY::setMeasurementFromState(), g2o::EdgeSE2Line2D::setMeasurementFromState(), g2o::EdgeSE2Segment2D::setMeasurementFromState(), g2o::EdgeSE2::setMeasurementFromState(), g2o::EdgeSE2Segment2DLine::setMeasurementFromState(), g2o::EdgeSE2Segment2DPointLine::setMeasurementFromState(), g2o::tutorial::CacheSE2Offset::updateImpl(), and g2o::CacheSE2Offset::updateImpl().

82  {
83  SE2 ret;
84  ret._R=_R.inverse();
85  ret._R.angle()=normalize_theta(ret._R.angle());
86 #ifdef _MSC_VER
87  ret._t=ret._R*(Vector2D(_t*-1.));
88 #else
89  ret._t=ret._R*(_t*-1.);
90 #endif
91  return ret;
92  }
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Definition: eigen_types.h:45
SE2()
Definition: se2.h:43
double normalize_theta(double theta)
Definition: misc.h:94
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
SE2 g2o::SE2::operator* ( const SE2 tr2) const
inline

concatenate two SE2 elements (motion composition)

Definition at line 62 of file se2.h.

62  {
63  SE2 result(*this);
64  result *= tr2;
65  return result;
66  }
SE2()
Definition: se2.h:43
Vector2D g2o::SE2::operator* ( const Vector2D v) const
inline

project a 2D vector

Definition at line 77 of file se2.h.

77  {
78  return _t+_R*v;
79  }
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
SE2& g2o::SE2::operator*= ( const SE2 tr2)
inline

motion composition operator

Definition at line 69 of file se2.h.

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

69  {
70  _t+=_R*tr2._t;
71  _R.angle()+=tr2._R.angle();
72  _R.angle()=normalize_theta(_R.angle());
73  return *this;
74  }
double normalize_theta(double theta)
Definition: misc.h:94
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
double g2o::SE2::operator[] ( int  i) const
inline

Definition at line 94 of file se2.h.

94  {
95  assert (i>=0 && i<3);
96  if (i<2)
97  return _t(i);
98  return _R.angle();
99  }
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
const Eigen::Rotation2Dd& g2o::SE2::rotation ( ) const
inline
void g2o::SE2::setRotation ( const Eigen::Rotation2Dd &  R_)
inline

Definition at line 59 of file se2.h.

Referenced by g2o::EdgeSE2PointXYBearing::initialEstimate(), and main().

59 {_R=R_;}
Eigen::Rotation2Dd _R
Definition: se2.h:120
void g2o::SE2::setTranslation ( const Vector2D t_)
inline

Definition at line 55 of file se2.h.

Referenced by main().

55 {_t=t_;}
Vector2D _t
Definition: se2.h:121
Isometry2D g2o::SE2::toIsometry ( ) const
inline

Definition at line 112 of file se2.h.

112  {
113  Isometry2D iso = Isometry2D::Identity();
114  iso.linear() = _R.toRotationMatrix();
115  iso.translation() = _t;
116  return iso;
117  }
Eigen::Transform< double, 2, Eigen::Isometry, Eigen::ColMajor > Isometry2D
Definition: eigen_types.h:65
Eigen::Rotation2Dd _R
Definition: se2.h:120
Vector2D _t
Definition: se2.h:121
Vector3D g2o::SE2::toVector ( ) const
inline
const Vector2D& g2o::SE2::translation ( ) const
inline

Member Data Documentation

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

Definition at line 120 of file se2.h.

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

Vector2D g2o::SE2::_t
protected

Definition at line 121 of file se2.h.

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

g2o::SE2::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 42 of file se2.h.


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