g2o
Loading...
Searching...
No Matches
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 Isometry2 &iso)
 
 SE2 (const Vector3 &v)
 
 SE2 (double x, double y, double theta)
 
const Vector2translation () const
 translational component
 
void setTranslation (const Vector2 &t_)
 
const Rotation2Drotation () const
 rotational component
 
void setRotation (const Rotation2D &R_)
 
SE2 operator* (const SE2 &tr2) const
 concatenate two SE2 elements (motion composition)
 
SE2operator*= (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

◆ 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 }

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

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

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

Referenced by g2o::EdgeSE2PureCalib::computeError(), EdgeCalib::computeError(), g2o::EdgeSE2OdomDifferentialCalib::computeError(), main(), g2o::tutorial::VertexSE2::read(), 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, and g2o::normalize_theta().

Referenced by g2o::addOdometryCalibLinksDifferential(), g2o::OnlineEdgeSE2::chi2(), g2o::EdgeSE2PureCalib::computeError(), EdgeCalib::computeError(), g2o::tutorial::EdgeSE2::computeError(), g2o::EdgeSE2OdomDifferentialCalib::computeError(), g2o::EdgeSE2::computeError(), g2o::EdgeSE2LotsOfXY::computeError(), g2o::EdgeSE2PointXY::computeError(), g2o::EdgeSE2PointXYBearing::computeError(), g2o::EdgeSE2TwoPointsXY::computeError(), g2o::EdgeSE2Line2D::computeError(), g2o::EdgeSE2Segment2D::computeError(), g2o::EdgeSE2Segment2DLine::computeError(), g2o::EdgeSE2Segment2DPointLine::computeError(), g2o::EdgeSE2SensorCalib::initialEstimate(), g2o::EdgeSE2Offset::initialEstimate(), g2o::SensorSegment2D::isVisible(), g2o::SensorSegment2DLine::isVisible(), g2o::SensorSegment2DPointLine::isVisible(), main(), g2o::RobotLaser::read(), g2o::EdgeSE2SensorCalib::read(), g2o::EdgeSE2::read(), g2o::EdgeSE2Prior::read(), g2o::Gm2dlIO::readGm2dl(), g2o::EdgeSE2SensorCalib::setMeasurement(), g2o::EdgeSE2::setMeasurement(), g2o::EdgeSE2Offset::setMeasurement(), g2o::EdgeSE2Prior::setMeasurement(), g2o::EdgeSE2Prior::setMeasurementData(), g2o::EdgeSE2::setMeasurementFromState(), g2o::EdgeSE2LotsOfXY::setMeasurementFromState(), g2o::EdgeSE2PointXY::setMeasurementFromState(), g2o::EdgeSE2PointXYBearing::setMeasurementFromState(), g2o::EdgeSE2TwoPointsXY::setMeasurementFromState(), g2o::EdgeSE2Line2D::setMeasurementFromState(), g2o::EdgeSE2Segment2D::setMeasurementFromState(), g2o::EdgeSE2Segment2DLine::setMeasurementFromState(), g2o::EdgeSE2Segment2DPointLine::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 }

◆ 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; }

◆ 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, and g2o::normalize_theta().

◆ 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 }

◆ rotation()

const Rotation2D & g2o::SE2::rotation ( ) const
inline

◆ setRotation()

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

Definition at line 62 of file se2.h.

62{ _R = 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_; }

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

◆ toVector()

Vector3 g2o::SE2::toVector ( ) const
inline

◆ translation()

const Vector2 & g2o::SE2::translation ( ) const
inline

Member Data Documentation

◆ _R

Rotation2D g2o::SE2::_R
protected

Definition at line 117 of file se2.h.

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

◆ _t

Vector2 g2o::SE2::_t
protected

Definition at line 118 of file se2.h.

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

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