From 67030b1ad3d1faecc4a0ff380115e62d557ead12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Or=C5=A1uli=C4=87?= Date: Wed, 8 Nov 2017 17:29:33 +0100 Subject: [PATCH] Use start_trajectory_node topic remappings for the new trajectory. (#584) --- .../cartographer_ros/start_trajectory_main.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cartographer_ros/cartographer_ros/start_trajectory_main.cc b/cartographer_ros/cartographer_ros/start_trajectory_main.cc index 18ea230..6e2b231 100644 --- a/cartographer_ros/cartographer_ros/start_trajectory_main.cc +++ b/cartographer_ros/cartographer_ros/start_trajectory_main.cc @@ -59,11 +59,14 @@ bool Run() { kStartTrajectoryServiceName); cartographer_ros_msgs::StartTrajectory srv; srv.request.options = ToRosMessage(LoadOptions()); - srv.request.topics.laser_scan_topic = kLaserScanTopic; - srv.request.topics.multi_echo_laser_scan_topic = kMultiEchoLaserScanTopic; - srv.request.topics.point_cloud2_topic = kPointCloud2Topic; - srv.request.topics.imu_topic = kImuTopic; - srv.request.topics.odometry_topic = kOdometryTopic; + srv.request.topics.laser_scan_topic = + ros::names::resolve(kLaserScanTopic, true /* apply topic remapping */); + srv.request.topics.multi_echo_laser_scan_topic = + ros::names::resolve(kMultiEchoLaserScanTopic, true); + srv.request.topics.point_cloud2_topic = + ros::names::resolve(kPointCloud2Topic, true); + srv.request.topics.imu_topic = ros::names::resolve(kImuTopic, true); + srv.request.topics.odometry_topic = ros::names::resolve(kOdometryTopic, true); if (!client.call(srv)) { LOG(ERROR) << "Error starting trajectory.";