Class VertexPose

Inheritance Relationships

Base Type

  • public g2o::BaseVertex< 3, PoseSE2 >

Class Documentation

class VertexPose : public g2o::BaseVertex<3, PoseSE2>

This class stores and wraps a SE2 pose (position and orientation) into a vertex that can be optimized via g2o.

See also

PoseSE2

See also

VertexTimeDiff

Public Functions

inline explicit VertexPose(bool fixed = false)

Default constructor.

Parameters:

fixed – if true, this vertex is considered fixed during optimization [default: false]

inline explicit VertexPose(const PoseSE2 &pose, bool fixed = false)

Construct pose using a given PoseSE2.

Parameters:
  • posePoseSE2 defining the pose [x, y, angle_rad]

  • fixed – if true, this vertex is considered fixed during optimization [default: false]

inline VertexPose(const Eigen::Ref<const Eigen::Vector2d> &position, double theta, bool fixed = false)

Construct pose using a given 2D position vector and orientation.

Parameters:
  • position – Eigen::Vector2d containing x and y coordinates

  • theta – yaw-angle

  • fixed – if true, this vertex is considered fixed during optimization [default: false]

inline VertexPose(double x, double y, double theta, bool fixed = false)

Construct pose using single components x, y, and the yaw angle.

Parameters:
  • x – x-coordinate

  • y – y-coordinate

  • theta – yaw angle in rad

  • fixed – if true, this vertex is considered fixed during optimization [default: false]

~VertexPose() override = default

Destructs the VertexPose.

inline PoseSE2 &pose()

Access the pose.

See also

estimate

Returns:

reference to the PoseSE2 estimate

inline const PoseSE2 &pose() const

Access the pose (read-only)

See also

estimate

Returns:

const reference to the PoseSE2 estimate

inline Eigen::Vector2d &position()

Access the 2D position part.

See also

estimate

Returns:

reference to the 2D position part

inline const Eigen::Vector2d &position() const

Access the 2D position part (read-only)

See also

estimate

Returns:

const reference to the 2D position part

inline double &x()

Access the x-coordinate the pose.

Returns:

reference to the x-coordinate

inline const double &x() const

Access the x-coordinate the pose (read-only)

Returns:

const reference to the x-coordinate

inline double &y()

Access the y-coordinate the pose.

Returns:

reference to the y-coordinate

inline const double &y() const

Access the y-coordinate the pose (read-only)

Returns:

const reference to the y-coordinate

inline double &theta()

Access the orientation part (yaw angle) of the pose.

Returns:

reference to the yaw angle

inline const double &theta() const

Access the orientation part (yaw angle) of the pose (read-only)

Returns:

const reference to the yaw angle

inline void setToOriginImpl() override

Set the underlying estimate (2D vector) to zero.

inline void oplusImpl(const double *update) override

Define the update increment \( \mathbf{x}_{k+1} = \mathbf{x}_k + \Delta \mathbf{x} \). A simple addition for the position. The angle is first added to the previous estimated angle and afterwards normalized to the interval \( [-\pi \pi] \).

Parameters:

update – increment that should be added to the previous esimate

inline bool read(std::istream &is) override

Read an estimate from an input stream. First the x-coordinate followed by y and the yaw angle.

Parameters:

is – input stream

Returns:

always true

inline 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.

Parameters:

os – output stream

Returns:

true if the export was successful, otherwise false