Use the MapBuilder factory function. (#1551)
This follows cartographer-project/cartographer#1776. Signed-off-by: Wolfgang Hess <whess@lyft.com>master
parent
b1dde03d52
commit
2712067e05
|
@ -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()) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue