31#include <Eigen/Geometry>
46 SE2() : _R(0), _t(0, 0) {}
49 _R.fromRotationMatrix(iso.linear());
54 SE2(
double x,
double y,
double theta) : _R(theta), _t(x, y) {}
74 _R.angle() += tr2.
_R.angle();
85 ret.
_R = _R.inverse();
90 ret.
_t = ret.
_R * (_t * -1.);
96 assert(i >= 0 && i < 3);
97 if (i < 2)
return _t(i);
106 return Vector3(_t.x(), _t.y(), _R.angle());
111 iso.linear() = _R.toRotationMatrix();
112 iso.translation() = _t;
const Vector2 & translation() const
translational component
Vector2 operator*(const Vector2 &v) const
project a 2D vector
Vector3 toVector() const
convert to a 3D vector (x, y, theta)
SE2 operator*(const SE2 &tr2) const
concatenate two SE2 elements (motion composition)
void setRotation(const Rotation2D &R_)
SE2 inverse() const
invert :-)
SE2 & operator*=(const SE2 &tr2)
motion composition operator
void fromVector(const Vector3 &v)
assign from a 3D vector (x, y, theta)
SE2(const Isometry2 &iso)
void setTranslation(const Vector2 &t_)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
SE2(double x, double y, double theta)
double operator[](int i) const
const Rotation2D & rotation() const
rotational component
Isometry2 toIsometry() const
#define G2O_TYPES_SLAM2D_API
some general case utility functions
Eigen::Transform< double, 2, Eigen::Isometry, Eigen::ColMajor > Isometry2
double normalize_theta(double theta)
Eigen::Rotation2D< double > Rotation2D