Use start_trajectory_node topic remappings for the new trajectory. (#584)

master
Juraj Oršulić 2017-11-08 17:29:33 +01:00 committed by Holger Rapp
parent ff92e9e4bd
commit 67030b1ad3
1 changed files with 8 additions and 5 deletions

View File

@ -59,11 +59,14 @@ bool Run() {
kStartTrajectoryServiceName); kStartTrajectoryServiceName);
cartographer_ros_msgs::StartTrajectory srv; cartographer_ros_msgs::StartTrajectory srv;
srv.request.options = ToRosMessage(LoadOptions()); srv.request.options = ToRosMessage(LoadOptions());
srv.request.topics.laser_scan_topic = kLaserScanTopic; srv.request.topics.laser_scan_topic =
srv.request.topics.multi_echo_laser_scan_topic = kMultiEchoLaserScanTopic; ros::names::resolve(kLaserScanTopic, true /* apply topic remapping */);
srv.request.topics.point_cloud2_topic = kPointCloud2Topic; srv.request.topics.multi_echo_laser_scan_topic =
srv.request.topics.imu_topic = kImuTopic; ros::names::resolve(kMultiEchoLaserScanTopic, true);
srv.request.topics.odometry_topic = kOdometryTopic; 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)) { if (!client.call(srv)) {
LOG(ERROR) << "Error starting trajectory."; LOG(ERROR) << "Error starting trajectory.";