# cartographer/sensor/fixed_frame_pose_data.h ## Overview `FixedFramePoseData` represents an absolute pose measurement in a fixed frame — for example GPS position, or an external pose estimate. Unlike relative sensor data (IMU, odometry), it is used directly in the global optimization: the pose graph adds residuals that pull each node's global pose toward the fixed-frame measurement, which helps bind the map to the world frame. ## Struct: `cartographer::sensor::FixedFramePoseData` ```cpp struct FixedFramePoseData { common::Time time; absl::optional pose; }; ``` - `time` — Timestamp of the measurement. - `pose` — Optional pose in the fixed frame. The `absl::optional` allows a measurement with no usable pose (e.g. a GPS fix with no lock) to be delivered without discarding the timestamp. ## Serialization ```cpp proto::FixedFramePoseData ToProto(const FixedFramePoseData& pose_data); FixedFramePoseData FromProto(const proto::FixedFramePoseData& proto); ``` `proto::FixedFramePoseData` stores the timestamp and an optional `transform.proto.Rigid3d`: ```protobuf message FixedFramePoseData { int64 timestamp = 1; transform.proto.Rigid3d pose = 2; } ``` `ToProto` omits `pose` when it is not set; `FromProto` reconstructs the `absl::optional` from `has_pose()`. ## Usage ```cpp sensor::FixedFramePoseData pose_data{time, pose}; // or {time, absl::nullopt} trajectory_builder->AddFixedFramePoseData(sensor_id, pose_data); ``` ## Role in the SLAM Pipeline - **Trajectory builder interface** — `AddFixedFramePoseData` accepts these measurements; they are stored per trajectory in the optimization problem. - **Optimization** — During `Solve`, each trajectory with fixed-frame pose data has a `fixed_frame_origin_in_map` transform computed and residual blocks (in `OptimizationProblem2D`/`OptimizationProblem3D`) pull the trajectory's nodes toward the measured poses, constraining the map to the fixed frame. - **Serialization** — per-trajectory fixed-frame pose data is stored in the serialization format via `proto::FixedFramePoseData` in `serialization.proto`. ## See Also - [Data](data.md) — Base class and `Dispatchable` wrapping - [OdometryData](odometry_data.md) — Relative pose measurement - [OptimizationProblemInterface](../mapping/internal/optimization/optimization_problem_interface.md) — Consumes fixed-frame pose data