diff --git a/cartographer_ros/cartographer_ros/map_builder_bridge.cc b/cartographer_ros/cartographer_ros/map_builder_bridge.cc index c811692..3fc7aa5 100644 --- a/cartographer_ros/cartographer_ros/map_builder_bridge.cc +++ b/cartographer_ros/cartographer_ros/map_builder_bridge.cc @@ -171,6 +171,9 @@ MapBuilderBridge::GetTrajectoryStates() { const cartographer::mapping::TrajectoryBuilder* const trajectory_builder = map_builder_.GetTrajectoryBuilder(trajectory_id); + if (trajectory_builder == nullptr) { + continue; + } const cartographer::mapping::TrajectoryBuilder::PoseEstimate pose_estimate = trajectory_builder->pose_estimate(); if (cartographer::common::ToUniversal(pose_estimate.time) < 0) {