g2o
Loading...
Searching...
No Matches
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
SE2 & operator*= (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

◆ SE2() [1/2]

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:108
Eigen::Rotation2Dd _R
Definition se2.h:107

References _R, and _t.

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

◆ SE2() [2/2]

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) {}

References _R, and _t.

Member Function Documentation

◆ fromVector()

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

Definition at line 96 of file se2.h.

96{ *this = SE2(v[0], v[1], v[2]); }

References SE2().

◆ inverse()

SE2 g2o::tutorial::SE2::inverse ( ) const
inline

Definition at line 76 of file se2.h.

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:103

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

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

◆ operator*() [1/2]

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 }

References _R, and _t.

◆ operator*() [2/2]

SE2 g2o::tutorial::SE2::operator* ( const SE2 & tr2) const
inline

Definition at line 57 of file se2.h.

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 }

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

◆ operator*=()

SE2 & g2o::tutorial::SE2::operator*= ( const SE2 & tr2)
inline

Definition at line 65 of file se2.h.

65 {
66 _t += _R * tr2._t;
67 _R.angle() += tr2._R.angle();
68 _R.angle() = normalize_theta(_R.angle());
69 return *this;
70 }

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

◆ operator[]() [1/2]

double & g2o::tutorial::SE2::operator[] ( int i)
inline

Definition at line 90 of file se2.h.

90 {
91 assert(i >= 0 && i < 3);
92 if (i < 2) return _t(i);
93 return _R.angle();
94 }

References _R, and _t.

◆ operator[]() [2/2]

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) return _t(i);
87 return _R.angle();
88 }

References _R, and _t.

◆ rotation() [1/2]

Eigen::Rotation2Dd & g2o::tutorial::SE2::rotation ( )
inline

Definition at line 55 of file se2.h.

55{ return _R; }

References _R.

◆ rotation() [2/2]

const Eigen::Rotation2Dd & g2o::tutorial::SE2::rotation ( ) const
inline

Definition at line 53 of file se2.h.

53{ return _R; }

References _R.

◆ toVector()

Eigen::Vector3d g2o::tutorial::SE2::toVector ( ) const
inline

Definition at line 98 of file se2.h.

98 {
99 Eigen::Vector3d ret;
100 for (int i = 0; i < 3; i++) {
101 ret(i) = (*this)[i];
102 }
103 return ret;
104 }

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

◆ translation() [1/2]

Eigen::Vector2d & g2o::tutorial::SE2::translation ( )
inline

Definition at line 51 of file se2.h.

51{ return _t; }

References _t.

◆ translation() [2/2]

const Eigen::Vector2d & g2o::tutorial::SE2::translation ( ) const
inline

Definition at line 49 of file se2.h.

49{ return _t; }

References _t.

Referenced by g2o::tutorial::Simulator::simulate().

Member Data Documentation

◆ _R

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

◆ _t

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

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

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: