offline_node_main.cc
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "cartographer/mapping/map_builder.h"
00018 #include "cartographer_ros/offline_node.h"
00019 #include "cartographer_ros/ros_log_sink.h"
00020 #include "gflags/gflags.h"
00021 #include "ros/ros.h"
00022 
00023 int main(int argc, char** argv) {
00024   google::InitGoogleLogging(argv[0]);
00025   google::ParseCommandLineFlags(&argc, &argv, true);
00026 
00027   ::ros::init(argc, argv, "cartographer_offline_node");
00028   ::ros::start();
00029 
00030   cartographer_ros::ScopedRosLogSink ros_log_sink;
00031 
00032   const cartographer_ros::MapBuilderFactory map_builder_factory =
00033       [](const ::cartographer::mapping::proto::MapBuilderOptions&
00034              map_builder_options) {
00035         return absl::make_unique< ::cartographer::mapping::MapBuilder>(
00036             map_builder_options);
00037       };
00038 
00039   cartographer_ros::RunOfflineNode(map_builder_factory);
00040 
00041   ::ros::shutdown();
00042 }


cartographer_ros
Author(s): The Cartographer Authors
autogenerated on Wed Jul 10 2019 04:10:28