Use node_handle.resolveName in start_trajectory_main. (#597)

As discussed in #584. The two functions behave completely identical for our purposes, so renaming for consistency with the rest of cartographer_ros.
master
Juraj Oršulić 2017-11-16 11:09:07 +01:00 committed by Wally B. Feed
parent a3df182d7e
commit e6060567b0
1 changed files with 7 additions and 6 deletions

View File

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