g2o
Loading...
Searching...
No Matches
g2o::SE2 Class Reference

represent SE2 More...

#include <se2.h>

Public Member Functions

 SE2 ()
 SE2 (const Isometry2 &iso)
 SE2 (const Vector3 &v)
 SE2 (double x, double y, double theta)
const Vector2 & translation () const
 translational component
void setTranslation (const Vector2 &t_)
const Rotation2D & rotation () const
 rotational component
void setRotation (const Rotation2D &R_)
SE2 operator* (const SE2 &tr2) const
 concatenate two SE2 elements (motion composition)
SE2 & operator*= (const SE2 &tr2)
 motion composition operator
Vector2 operator* (const Vector2 &v) const
 project a 2D vector
SE2 inverse () const
 invert :-)
double operator[] (int i) const
void fromVector (const Vector3 &v)
 assign from a 3D vector (x, y, theta)
Vector3 toVector () const
 convert to a 3D vector (x, y, theta)
Isometry2 toIsometry () const

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Protected Attributes

Rotation2D _R
Vector2 _t

Detailed Description

represent SE2

Definition at line 43 of file se2.h.

Constructor & Destructor Documentation

◆ SE2() [1/4]

g2o::SE2::SE2 ( )
inline

Definition at line 46 of file se2.h.

46: _R(0), _t(0, 0) {}
Rotation2D _R
Definition se2.h:117
Vector2 _t
Definition se2.h:118

References _R, and _t.

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

◆ SE2() [2/4]

g2o::SE2::SE2 ( const Isometry2 & iso)
inline

Definition at line 48 of file se2.h.

48 : _R(0), _t(iso.translation()) {
49 _R.fromRotationMatrix(iso.linear());
50 }

References _R, _t, and translation().

◆ SE2() [3/4]

g2o::SE2::SE2 ( const Vector3 & v)
inline

Definition at line 52 of file se2.h.

52: _R(v[2]), _t(v[0], v[1]) {}

References _R, and _t.

◆ SE2() [4/4]

g2o::SE2::SE2 ( double x,
double y,
double theta )
inline

Definition at line 54 of file se2.h.

54: _R(theta), _t(x, y) {}

References _R, and _t.

Member Function Documentation

◆ fromVector()

void g2o::SE2::fromVector ( const Vector3 & v)
inline

assign from a 3D vector (x, y, theta)

Definition at line 102 of file se2.h.

102{ *this = SE2(v[0], v[1], v[2]); }
SE2()
Definition se2.h:46

References SE2().

Referenced by g2o::SensorPose2D::addNoise(), EdgeCalib::computeError(), g2o::EdgeSE2OdomDifferentialCalib::computeError(), g2o::EdgeSE2PureCalib::computeError(), main(), and g2o::Gm2dlIO::readGm2dl().

◆ inverse()

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

invert :-)

Definition at line 83 of file se2.h.

83 {
84 SE2 ret;
85 ret._R = _R.inverse();
86 ret._R.angle() = normalize_theta(ret._R.angle());
87#ifdef _MSC_VER
88 ret._t = ret._R * (Vector2(_t * -1.));
89#else
90 ret._t = ret._R * (_t * -1.);
91#endif
92 return ret;
93 }
double normalize_theta(double theta)
Definition misc.h:103
VectorN< 2 > Vector2
Definition eigen_types.h:50

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

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

◆ operator*() [1/2]

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

concatenate two SE2 elements (motion composition)

Definition at line 65 of file se2.h.

65 {
66 SE2 result(*this);
67 result *= tr2;
68 return result;
69 }

References SE2().

◆ operator*() [2/2]

Vector2 g2o::SE2::operator* ( const Vector2 & v) const
inline

project a 2D vector

Definition at line 80 of file se2.h.

80{ return _t + _R * v; }

References _R, and _t.

◆ operator*=()

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

motion composition operator

Definition at line 72 of file se2.h.

72 {
73 _t += _R * tr2._t;
74 _R.angle() += tr2._R.angle();
75 _R.angle() = normalize_theta(_R.angle());
76 return *this;
77 }

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

◆ operator[]()

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

Definition at line 95 of file se2.h.

95 {
96 assert(i >= 0 && i < 3);
97 if (i < 2) return _t(i);
98 return _R.angle();
99 }

References _R, and _t.

◆ rotation()

◆ setRotation()

void g2o::SE2::setRotation ( const Rotation2D & R_)
inline

Definition at line 62 of file se2.h.

62{ _R = R_; }

References _R.

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

◆ setTranslation()

void g2o::SE2::setTranslation ( const Vector2 & t_)
inline

Definition at line 58 of file se2.h.

58{ _t = t_; }

References _t.

Referenced by main().

◆ toIsometry()

Isometry2 g2o::SE2::toIsometry ( ) const
inline

Definition at line 109 of file se2.h.

109 {
110 Isometry2 iso = Isometry2::Identity();
111 iso.linear() = _R.toRotationMatrix();
112 iso.translation() = _t;
113 return iso;
114 }
Eigen::Transform< double, 2, Eigen::Isometry, Eigen::ColMajor > Isometry2
Definition eigen_types.h:76

References _R, and _t.

◆ toVector()

◆ translation()

Member Data Documentation

◆ _R

Rotation2D g2o::SE2::_R
protected

◆ _t

Vector2 g2o::SE2::_t
protected

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

g2o::SE2::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 45 of file se2.h.


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