From d624b1c250f1dee75992f475a8b11edc596ee4a3 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Tue, 9 May 2017 16:06:04 +0200 Subject: [PATCH] Track changes in Cartographer. (#331) googlecartographer/cartographer#268 changes the API. PAIR=wohe --- cartographer_ros/cartographer_ros/map_builder_bridge.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cartographer_ros/cartographer_ros/map_builder_bridge.cc b/cartographer_ros/cartographer_ros/map_builder_bridge.cc index 4447e4f..3cd8e69 100644 --- a/cartographer_ros/cartographer_ros/map_builder_bridge.cc +++ b/cartographer_ros/cartographer_ros/map_builder_bridge.cc @@ -111,11 +111,11 @@ cartographer_ros_msgs::SubmapList MapBuilderBridge::GetSubmapList() { const cartographer::mapping::Submaps* submaps = map_builder_.GetTrajectoryBuilder(trajectory_id)->submaps(); const std::vector submap_transforms = - map_builder_.sparse_pose_graph()->GetSubmapTransforms(*submaps); - CHECK_EQ(submap_transforms.size(), submaps->size()); + map_builder_.sparse_pose_graph()->GetSubmapTransforms(submaps); + CHECK_LE(submap_transforms.size(), submaps->size()); cartographer_ros_msgs::TrajectorySubmapList trajectory_submap_list; - for (int submap_index = 0; submap_index != submaps->size(); + for (size_t submap_index = 0; submap_index != submap_transforms.size(); ++submap_index) { cartographer_ros_msgs::SubmapEntry submap_entry; submap_entry.submap_version = submaps->Get(submap_index)->num_range_data; @@ -164,7 +164,7 @@ MapBuilderBridge::GetTrajectoryStates() { trajectory_states[trajectory_id] = { pose_estimate, map_builder_.sparse_pose_graph()->GetLocalToGlobalTransform( - *trajectory_builder->submaps()), + trajectory_builder->submaps()), sensor_bridge.tf_bridge().LookupToTracking(pose_estimate.time, options_.published_frame)}; }