From 6b68522fccb4a2943a76ff6f43e9667c31888198 Mon Sep 17 00:00:00 2001 From: Wolfgang Hess Date: Wed, 15 Nov 2017 12:57:50 +0100 Subject: [PATCH] Follow googlecartographer/cartographer#677. (#595) [RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md) --- .../cartographer_ros/map_builder_bridge.cc | 18 ++++++++---------- cartographer_ros/cartographer_ros/node.cc | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cartographer_ros/cartographer_ros/map_builder_bridge.cc b/cartographer_ros/cartographer_ros/map_builder_bridge.cc index 6f3432d..4546a5b 100644 --- a/cartographer_ros/cartographer_ros/map_builder_bridge.cc +++ b/cartographer_ros/cartographer_ros/map_builder_bridge.cc @@ -106,7 +106,7 @@ void MapBuilderBridge::FinishTrajectory(const int trajectory_id) { void MapBuilderBridge::RunFinalOptimization() { LOG(INFO) << "Running final trajectory optimization..."; - map_builder_.sparse_pose_graph()->RunFinalOptimization(); + map_builder_.pose_graph()->RunFinalOptimization(); } void MapBuilderBridge::SerializeState(const std::string& filename) { @@ -151,7 +151,7 @@ cartographer_ros_msgs::SubmapList MapBuilderBridge::GetSubmapList() { submap_list.header.stamp = ::ros::Time::now(); submap_list.header.frame_id = node_options_.map_frame; for (const auto& submap_id_data : - map_builder_.sparse_pose_graph()->GetAllSubmapData()) { + map_builder_.pose_graph()->GetAllSubmapData()) { cartographer_ros_msgs::SubmapEntry submap_entry; submap_entry.trajectory_id = submap_id_data.id.trajectory_id; submap_entry.submap_index = submap_id_data.id.submap_index; @@ -184,8 +184,7 @@ MapBuilderBridge::GetTrajectoryStates() { CHECK_EQ(trajectory_options_.count(trajectory_id), 1); trajectory_states[trajectory_id] = { pose_estimate, - map_builder_.sparse_pose_graph()->GetLocalToGlobalTransform( - trajectory_id), + map_builder_.pose_graph()->GetLocalToGlobalTransform(trajectory_id), sensor_bridge.tf_bridge().LookupToTracking( pose_estimate.time, trajectory_options_[trajectory_id].published_frame), @@ -196,7 +195,7 @@ MapBuilderBridge::GetTrajectoryStates() { visualization_msgs::MarkerArray MapBuilderBridge::GetTrajectoryNodeList() { visualization_msgs::MarkerArray trajectory_node_list; - const auto nodes = map_builder_.sparse_pose_graph()->GetTrajectoryNodes(); + const auto nodes = map_builder_.pose_graph()->GetTrajectoryNodes(); for (const int trajectory_id : nodes.trajectory_ids()) { visualization_msgs::Marker marker = CreateTrajectoryMarker(trajectory_id, node_options_.map_frame); @@ -252,16 +251,15 @@ visualization_msgs::MarkerArray MapBuilderBridge::GetConstraintList() { residual_inter_marker.ns = "Inter residuals"; residual_inter_marker.pose.position.z = 0.1; - const auto trajectory_nodes = - map_builder_.sparse_pose_graph()->GetTrajectoryNodes(); - const auto submap_data = map_builder_.sparse_pose_graph()->GetAllSubmapData(); - const auto constraints = map_builder_.sparse_pose_graph()->constraints(); + const auto trajectory_nodes = map_builder_.pose_graph()->GetTrajectoryNodes(); + const auto submap_data = map_builder_.pose_graph()->GetAllSubmapData(); + const auto constraints = map_builder_.pose_graph()->constraints(); for (const auto& constraint : constraints) { visualization_msgs::Marker *constraint_marker, *residual_marker; std_msgs::ColorRGBA color_constraint, color_residual; if (constraint.tag == - cartographer::mapping::SparsePoseGraph::Constraint::INTRA_SUBMAP) { + cartographer::mapping::PoseGraph::Constraint::INTRA_SUBMAP) { constraint_marker = &constraint_intra_marker; residual_marker = &residual_intra_marker; // Color mapping for submaps of various trajectories - add trajectory id diff --git a/cartographer_ros/cartographer_ros/node.cc b/cartographer_ros/cartographer_ros/node.cc index 4c6877e..b68e16b 100644 --- a/cartographer_ros/cartographer_ros/node.cc +++ b/cartographer_ros/cartographer_ros/node.cc @@ -27,7 +27,6 @@ #include "cartographer/common/port.h" #include "cartographer/common/time.h" #include "cartographer/mapping/proto/submap_visualization.pb.h" -#include "cartographer/mapping/sparse_pose_graph.h" #include "cartographer/sensor/point_cloud.h" #include "cartographer/transform/rigid_transform.h" #include "cartographer/transform/transform.h"