Do not forget to finish trajectory if last message is not from a sensor topic (#681)

Bug introduced in #636.
master
Juraj Oršulić 2018-01-25 16:13:38 +01:00 committed by Wally B. Feed
parent 8d8a86790a
commit 7fc931688c
1 changed files with 26 additions and 28 deletions

View File

@ -274,10 +274,7 @@ void RunOfflineNode(const MapBuilderFactory& map_builder_factory) {
}
const std::string topic =
node.node_handle()->resolveName(msg.getTopic(), false /* resolve */);
if (bag_sensor_topics.at(bag_index).count(topic) == 0) {
continue;
}
if (bag_sensor_topics.at(bag_index).count(topic) > 0) {
if (msg.isType<sensor_msgs::LaserScan>()) {
node.HandleLaserScanMessage(trajectory_id, topic,
msg.instantiate<sensor_msgs::LaserScan>());
@ -303,6 +300,7 @@ void RunOfflineNode(const MapBuilderFactory& map_builder_factory) {
node.HandleNavSatFixMessage(trajectory_id, topic,
msg.instantiate<sensor_msgs::NavSatFix>());
}
}
clock.clock = msg.getTime();
clock_publisher.publish(clock);