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) =
|
std::tie(node_options, trajectory_options) =
|
||||||
LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename);
|
LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename);
|
||||||
|
|
||||||
auto map_builder = absl::make_unique<cartographer::mapping::MapBuilder>(
|
auto map_builder =
|
||||||
node_options.map_builder_options);
|
cartographer::mapping::CreateMapBuilder(node_options.map_builder_options);
|
||||||
Node node(node_options, std::move(map_builder), &tf_buffer,
|
Node node(node_options, std::move(map_builder), &tf_buffer,
|
||||||
FLAGS_collect_metrics);
|
FLAGS_collect_metrics);
|
||||||
if (!FLAGS_load_state_filename.empty()) {
|
if (!FLAGS_load_state_filename.empty()) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "cartographer/common/configuration_file_resolver.h"
|
#include "cartographer/common/configuration_file_resolver.h"
|
||||||
#include "cartographer/mapping/map_builder.h"
|
#include "cartographer/mapping/map_builder_interface.h"
|
||||||
#include "glog/logging.h"
|
#include "glog/logging.h"
|
||||||
|
|
||||||
namespace cartographer_ros {
|
namespace cartographer_ros {
|
||||||
|
|
|
@ -29,11 +29,10 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
cartographer_ros::ScopedRosLogSink ros_log_sink;
|
cartographer_ros::ScopedRosLogSink ros_log_sink;
|
||||||
|
|
||||||
const cartographer_ros::MapBuilderFactory map_builder_factory =
|
const cartographer_ros::MapBuilderFactory map_builder_factory = [](
|
||||||
[](const ::cartographer::mapping::proto::MapBuilderOptions&
|
const ::cartographer::mapping::proto::MapBuilderOptions&
|
||||||
map_builder_options) {
|
map_builder_options) {
|
||||||
return absl::make_unique< ::cartographer::mapping::MapBuilder>(
|
return ::cartographer::mapping::CreateMapBuilder(map_builder_options);
|
||||||
map_builder_options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cartographer_ros::RunOfflineNode(map_builder_factory);
|
cartographer_ros::RunOfflineNode(map_builder_factory);
|
||||||
|
|
Loading…
Reference in New Issue