assets_writer_main.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
19 #include "gflags/gflags.h"
20 #include "glog/logging.h"
21 
22 DEFINE_string(configuration_directory, "",
23  "First directory in which configuration files are searched, "
24  "second is always the Cartographer installation to allow "
25  "including files from there.");
26 DEFINE_string(configuration_basename, "",
27  "Basename, i.e. not containing any directory prefix, of the "
28  "configuration file.");
30  urdf_filename, "",
31  "URDF file that contains static links for your sensor configuration.");
32 DEFINE_string(bag_filenames, "",
33  "Bags to process, must be in the same order as the trajectories "
34  "in 'pose_graph_filename'.");
35 DEFINE_string(pose_graph_filename, "",
36  "Proto stream file containing the pose graph.");
37 DEFINE_bool(use_bag_transforms, true,
38  "Whether to read and use the transforms from the bag.");
39 DEFINE_string(output_file_prefix, "",
40  "Will be prefixed to all output file names and can be used to "
41  "define the output directory. If empty, the first bag filename "
42  "will be used.");
43 
44 int main(int argc, char** argv) {
45  FLAGS_alsologtostderr = true;
46  google::InitGoogleLogging(argv[0]);
47  google::ParseCommandLineFlags(&argc, &argv, true);
48 
49  CHECK(!FLAGS_configuration_directory.empty())
50  << "-configuration_directory is missing.";
51  CHECK(!FLAGS_configuration_basename.empty())
52  << "-configuration_basename is missing.";
53  CHECK(!FLAGS_bag_filenames.empty()) << "-bag_filenames is missing.";
54  CHECK(!FLAGS_pose_graph_filename.empty())
55  << "-pose_graph_filename is missing.";
56 
58  FLAGS_pose_graph_filename,
59  cartographer_ros::SplitString(FLAGS_bag_filenames, ','),
60  FLAGS_output_file_prefix);
61 
62  asset_writer.Run(FLAGS_configuration_directory, FLAGS_configuration_basename,
63  FLAGS_urdf_filename, FLAGS_use_bag_transforms);
64 }
int main(int argc, char **argv)
std::vector< std::string > SplitString(const std::string &input, const char delimiter)
Definition: split_string.cc:23
DEFINE_string(configuration_directory, "", "First directory in which configuration files are searched, " "second is always the Cartographer installation to allow " "including files from there.")
DEFINE_bool(use_bag_transforms, true, "Whether to read and use the transforms from the bag.")


cartographer_ros
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:06:05