apps/mm-info/main.cpp
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------
2  * A repertory of multi primitive-to-primitive (MP2P) ICP algorithms in C++
3  * Copyright (C) 2018-2024 Jose Luis Blanco, University of Almeria
4  * See LICENSE for license information.
5  * ------------------------------------------------------------------------- */
6 
14 #include <mp2p_icp/metricmap.h>
15 #include <mrpt/3rdparty/tclap/CmdLine.h>
16 #include <mrpt/containers/yaml.h>
17 #include <mrpt/system/filesystem.h>
18 
19 // CLI flags:
20 static TCLAP::CmdLine cmd("mm-filter");
21 
22 static TCLAP::UnlabeledValueArg<std::string> argMapFile(
23  "input", "Load this metric map file (*.mm)", true, "myMap.mm", "myMap.mm",
24  cmd);
25 
27 {
28  const auto& filInput = argMapFile.getValue();
29 
30  ASSERT_FILE_EXISTS_(argMapFile.getValue());
31 
32  std::cout << "[mm-info] Reading input map from: '" << filInput << "'..."
33  << std::endl;
34 
36  mm.load_from_file(filInput);
37 
38  std::cout << "[mm-info] Done read map. Contents:\n"
39  << mm.contents_summary() << std::endl;
40 }
41 
42 int main(int argc, char** argv)
43 {
44  try
45  {
46  // Parse arguments:
47  if (!cmd.parse(argc, argv)) return 1; // should exit.
48 
49  run_mm_info();
50  }
51  catch (const std::exception& e)
52  {
53  std::cerr << e.what();
54  return 1;
55  }
56  return 0;
57 }
main
int main(int argc, char **argv)
Definition: apps/mm-info/main.cpp:42
mp2p_icp::metric_map_t::contents_summary
virtual std::string contents_summary() const
Definition: metricmap.cpp:500
mp2p_icp::metric_map_t::load_from_file
bool load_from_file(const std::string &fileName)
Definition: metricmap.cpp:578
cmd
static TCLAP::CmdLine cmd("mm-filter")
argMapFile
static TCLAP::UnlabeledValueArg< std::string > argMapFile("input", "Load this metric map file (*.mm)", true, "myMap.mm", "myMap.mm", cmd)
metricmap.h
Generic representation of pointcloud(s) and/or extracted features.
mp2p_icp::metric_map_t
Generic container of pointcloud(s), extracted features and other maps.
Definition: metricmap.h:49
run_mm_info
void run_mm_info()
Definition: apps/mm-info/main.cpp:26


mp2p_icp
Author(s):
autogenerated on Wed Oct 23 2024 02:45:40