assets_writer_main.cc
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 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 "absl/strings/str_split.h"
00018 #include "cartographer_ros/assets_writer.h"
00019 #include "gflags/gflags.h"
00020 #include "glog/logging.h"
00021 
00022 DEFINE_string(configuration_directory, "",
00023               "First directory in which configuration files are searched, "
00024               "second is always the Cartographer installation to allow "
00025               "including files from there.");
00026 DEFINE_string(configuration_basename, "",
00027               "Basename, i.e. not containing any directory prefix, of the "
00028               "configuration file.");
00029 DEFINE_string(
00030     urdf_filename, "",
00031     "URDF file that contains static links for your sensor configuration.");
00032 DEFINE_string(bag_filenames, "",
00033               "Bags to process, must be in the same order as the trajectories "
00034               "in 'pose_graph_filename'.");
00035 DEFINE_string(pose_graph_filename, "",
00036               "Proto stream file containing the pose graph.");
00037 DEFINE_bool(use_bag_transforms, true,
00038             "Whether to read and use the transforms from the bag.");
00039 DEFINE_string(output_file_prefix, "",
00040               "Will be prefixed to all output file names and can be used to "
00041               "define the output directory. If empty, the first bag filename "
00042               "will be used.");
00043 
00044 int main(int argc, char** argv) {
00045   FLAGS_alsologtostderr = true;
00046   google::InitGoogleLogging(argv[0]);
00047   google::ParseCommandLineFlags(&argc, &argv, true);
00048 
00049   CHECK(!FLAGS_configuration_directory.empty())
00050       << "-configuration_directory is missing.";
00051   CHECK(!FLAGS_configuration_basename.empty())
00052       << "-configuration_basename is missing.";
00053   CHECK(!FLAGS_bag_filenames.empty()) << "-bag_filenames is missing.";
00054   CHECK(!FLAGS_pose_graph_filename.empty())
00055       << "-pose_graph_filename is missing.";
00056 
00057   ::cartographer_ros::AssetsWriter asset_writer(
00058       FLAGS_pose_graph_filename,
00059       absl::StrSplit(FLAGS_bag_filenames, ',', absl::SkipEmpty()),
00060       FLAGS_output_file_prefix);
00061 
00062   asset_writer.Run(FLAGS_configuration_directory, FLAGS_configuration_basename,
00063                    FLAGS_urdf_filename, FLAGS_use_bag_transforms);
00064 }


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