Use the MapBuilder factory function. (#1551)

This follows cartographer-project/cartographer#1776.

Signed-off-by: Wolfgang Hess <whess@lyft.com>
master
Wolfgang Hess 2020-11-06 13:41:08 +01:00 committed by GitHub
parent b1dde03d52
commit 2712067e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View File

@ -56,8 +56,8 @@ void Run() {
std::tie(node_options, trajectory_options) =
LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename);
auto map_builder = absl::make_unique<cartographer::mapping::MapBuilder>(
node_options.map_builder_options);
auto map_builder =
cartographer::mapping::CreateMapBuilder(node_options.map_builder_options);
Node node(node_options, std::move(map_builder), &tf_buffer,
FLAGS_collect_metrics);
if (!FLAGS_load_state_filename.empty()) {

View File

@ -19,7 +19,7 @@
#include <vector>
#include "cartographer/common/configuration_file_resolver.h"
#include "cartographer/mapping/map_builder.h"
#include "cartographer/mapping/map_builder_interface.h"
#include "glog/logging.h"
namespace cartographer_ros {

View File

@ -29,12 +29,11 @@ int main(int argc, char** argv) {
cartographer_ros::ScopedRosLogSink ros_log_sink;
const cartographer_ros::MapBuilderFactory map_builder_factory =
[](const ::cartographer::mapping::proto::MapBuilderOptions&
map_builder_options) {
return absl::make_unique< ::cartographer::mapping::MapBuilder>(
map_builder_options);
};
const cartographer_ros::MapBuilderFactory map_builder_factory = [](
const ::cartographer::mapping::proto::MapBuilderOptions&
map_builder_options) {
return ::cartographer::mapping::CreateMapBuilder(map_builder_options);
};
cartographer_ros::RunOfflineNode(map_builder_factory);