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;
141 Eigen::Vector2d&
position() {
return _estimate.position();}
148 const Eigen::Vector2d&
position()
const {
return _estimate.position();}
154 double&
x() {
return _estimate.x();}
160 const double&
x()
const {
return _estimate.x();}
166 double&
y() {
return _estimate.y();}
172 const double&
y()
const {
return _estimate.y();}
178 double&
theta() {
return _estimate.theta();}
184 const double&
theta()
const {
return _estimate.theta();}
202 _estimate.plus(update);
211 virtual bool read(std::istream& is)
213 is >> _estimate.x() >> _estimate.y() >> _estimate.theta();
223 virtual bool write(std::ostream& os)
const 225 os << _estimate.x() <<
" " << _estimate.y() << _estimate.theta();
229 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
234 #endif // VERTEX_POSE_H_ PoseSE2 & pose()
Access the pose.
const Eigen::Vector2d & position() const
Access the 2D position part (read-only)
virtual bool read(std::istream &is)
Read an estimate from an input stream. First the x-coordinate followed by y and the yaw angle...
double & y()
Access the y-coordinate the pose.
VertexPose(bool fixed=false)
Default constructor.
const PoseSE2 & pose() const
Access the pose (read-only)
virtual void oplusImpl(const double *update)
Define the update increment . A simple addition for the position. The angle is first added to the pre...
const double & x() const
Access the x-coordinate the pose (read-only)
double & theta()
Access the orientation part (yaw angle) of the pose.
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.
VertexPose(double x, double y, double theta, bool fixed=false)
Construct pose using single components x, y, and the yaw angle.
const double & y() const
Access the y-coordinate the pose (read-only)
virtual bool write(std::ostream &os) const
Write the estimate to an output stream First the x-coordinate followed by y and the yaw angle...
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...
const double & theta() const
Access the orientation part (yaw angle) of the pose (read-only)
~VertexPose()
Destructs the VertexPose.
virtual void setToOriginImpl()
Set the underlying estimate (2D vector) to zero.