44 #ifndef VERTEX_POSE_H_ 45 #define VERTEX_POSE_H_ 47 #include <g2o/config.h> 48 #include <g2o/core/base_vertex.h> 49 #include <g2o/core/hyper_graph_action.h> 50 #include <g2o/stuff/misc.h> 97 _estimate.theta() =
theta;
112 _estimate.theta() =
theta;
136 inline Eigen::Vector2d&
position() {
return _estimate.position();}
143 inline const Eigen::Vector2d&
position()
const {
return _estimate.position();}
149 inline double&
x() {
return _estimate.x();}
155 inline const double&
x()
const {
return _estimate.x();}
161 inline double&
y() {
return _estimate.y();}
167 inline const double&
y()
const {
return _estimate.y();}
173 inline double&
theta() {
return _estimate.theta();}
179 inline const double&
theta()
const {
return _estimate.theta();}
197 _estimate.plus(update);
206 virtual bool read(std::istream& is)
override 208 is >> _estimate.x() >> _estimate.y() >> _estimate.theta();
218 virtual bool write(std::ostream& os)
const override 220 os << _estimate.x() <<
" " << _estimate.y() <<
" " << _estimate.theta();
224 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
229 #endif // VERTEX_POSE_H_ virtual void setToOriginImpl() override
Set the underlying estimate (2D vector) to zero.
PoseSE2 & pose()
Access the pose.
virtual bool read(std::istream &is) override
Read an estimate from an input stream. First the x-coordinate followed by y and the yaw angle...
const double & y() const
Access the y-coordinate the pose (read-only)
virtual void oplusImpl(const double *update) override
Define the update increment . A simple addition for the position. The angle is first added to the pre...
double & y()
Access the y-coordinate the pose.
const double & theta() const
Access the orientation part (yaw angle) of the pose (read-only)
VertexPose(bool fixed=false)
Default constructor.
double & theta()
Access the orientation part (yaw angle) of the pose.
const PoseSE2 & pose() const
Access the pose (read-only)
double & x()
Access the x-coordinate the pose.
VertexPose(const Eigen::Ref< const Eigen::Vector2d > &position, double theta, bool fixed=false)
Construct pose using a given 2D position vector and orientation.
const Eigen::Vector2d & position() const
Access the 2D position part (read-only)
VertexPose(double x, double y, double theta, bool fixed=false)
Construct pose using single components x, y, and the yaw angle.
const double & x() const
Access the x-coordinate the pose (read-only)
This class implements a pose in the domain SE2: The pose consist of the position x and y and an orie...
Eigen::Vector2d & position()
Access the 2D position part.
VertexPose(const PoseSE2 &pose, bool fixed=false)
Construct pose using a given PoseSE2.
This class stores and wraps a SE2 pose (position and orientation) into a vertex that can be optimized...
virtual bool write(std::ostream &os) const override
Write the estimate to an output stream First the x-coordinate followed by y and the yaw angle...