From d022b8182f9e313692caaebc80c8e9d01f78a2bc Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Tue, 25 Jul 2017 14:32:21 +0200 Subject: [PATCH] Track googlecartographer/cartographer#421. (#441) --- cartographer_ros/cartographer_ros/assets_writer_main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cartographer_ros/cartographer_ros/assets_writer_main.cc b/cartographer_ros/cartographer_ros/assets_writer_main.cc index 41c2cd5..93d06e0 100644 --- a/cartographer_ros/cartographer_ros/assets_writer_main.cc +++ b/cartographer_ros/cartographer_ros/assets_writer_main.cc @@ -162,9 +162,13 @@ void Run(const string& pose_graph_filename, return carto::common::make_unique(filename); }; + // This vector must outlive the pipeline. + std::vector<::cartographer::mapping::proto::Trajectory> all_trajectories( + pose_graph_proto.trajectory().begin(), + pose_graph_proto.trajectory().end()); + carto::io::PointsProcessorPipelineBuilder builder; - // TODO(hrapp): Pass all trajectories to the PointsProcessors. - carto::io::RegisterBuiltInPointsProcessors(pose_graph_proto.trajectory(0), + carto::io::RegisterBuiltInPointsProcessors(all_trajectories, file_writer_factory, &builder); std::vector> pipeline = builder.CreatePipeline(