migrate_serialization_format_main.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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 
23  original_pbstream_file, "",
24  "Path to the pbstream file that will be migrated to the new version.");
25 DEFINE_string(output_pbstream_file, "",
26  "Output filename for the migrated pbstream.");
27 
28 int main(int argc, char** argv) {
29  google::InitGoogleLogging(argv[0]);
30  FLAGS_logtostderr = true;
31  google::SetUsageMessage(
32  "\n\n"
33  "Tool for migrating files that use the serialization output of "
34  "Cartographer 0.3, to the new serialization format, which includes a "
35  "header (Version 1).");
36  google::ParseCommandLineFlags(&argc, &argv, true);
37 
38  if (FLAGS_original_pbstream_file.empty() ||
39  FLAGS_output_pbstream_file.empty()) {
40  google::ShowUsageWithFlagsRestrict(argv[0], "migrate_serialization_format");
41  return EXIT_FAILURE;
42  }
43  cartographer::io::ProtoStreamReader input(FLAGS_original_pbstream_file);
44  cartographer::io::ProtoStreamWriter output(FLAGS_output_pbstream_file);
46 
47  return EXIT_SUCCESS;
48 }
int main(int argc, char **argv)
void MigrateStreamFormatToVersion1(cartographer::io::ProtoStreamReaderInterface *const input, cartographer::io::ProtoStreamWriterInterface *const output)
DEFINE_string(original_pbstream_file, "", "Path to the pbstream file that will be migrated to the new version.")


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58