cartographer/sensor/odometry_data.h

Overview

OdometryData is a timestamped robot pose measurement from an odometry source (wheel odometry, visual odometry, or similar). It is used by the pose extrapolator to improve pose prediction during local SLAM and by the optimization problem to add relative-pose constraints between consecutive nodes.

Struct: cartographer::sensor::OdometryData

struct OdometryData {
  common::Time time;
  transform::Rigid3d pose;
};
  • time — Timestamp of the measurement.

  • pose — The robot pose in an arbitrary odometry frame.

Serialization

proto::OdometryData ToProto(const OdometryData& odometry_data);
OdometryData FromProto(const proto::OdometryData& proto);

proto::OdometryData (defined in sensor/proto/sensor.proto) stores the timestamp as a UTS int64 and the pose as a transform.proto.Rigid3d:

message OdometryData {
  int64 timestamp = 1;
  transform.proto.Rigid3d pose = 2;
}

Usage

sensor::OdometryData odometry{time, pose};
trajectory_builder->AddOdometryData(sensor_id, odometry);

Data is wrapped into a Dispatchable by the collator before being dispatched to the trajectory builder:

auto dispatchable = sensor::MakeDispatchable("odometer", odometry);

Role in the SLAM Pipeline

  • Local SLAM — LocalTrajectoryBuilder2D/LocalTrajectoryBuilder3D forward odometry to the PoseExtrapolator, which interpolates odometry to compute relative motion between scan-match nodes and adds odometry residuals to its Ceres problem (odometry_translation_weight / odometry_rotation_weight).

  • Global optimization — OptimizationProblemInterface stores MapByTime<OdometryData> and the pose graph adds relative-pose constraints between consecutive nodes based on interpolated odometry.

  • Serialization — odometry data is stored per-trajectory in the serialization format via proto::OdometryData in serialization.proto.

See Also