MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / main

Function main

example/run_tum_rgbd_slam.cc:316–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316int main(int argc, char *argv[])
317{
318#ifdef USE_STACK_TRACE_LOGGER
319 google::InitGoogleLogging(argv[0]);
320 google::InstallFailureSignalHandler();
321#endif
322
323 // create options
324 popl::OptionParser op("Allowed options");
325 auto help = op.add<popl::Switch>("h", "help", "produce help message");
326 auto vocab_file_path = op.add<popl::Value<std::string>>("v", "vocab", "vocabulary file path");
327 auto data_dir_path = op.add<popl::Value<std::string>>("d", "data-dir", "directory path which contains dataset");
328 auto config_file_path = op.add<popl::Value<std::string>>("c", "config", "config file path");
329 auto frame_skip = op.add<popl::Value<unsigned int>>("", "frame-skip", "interval of frame skip", 1);
330 auto no_sleep = op.add<popl::Switch>("", "no-sleep", "not wait for next frame in real time");
331 auto auto_term = op.add<popl::Switch>("", "auto-term", "automatically terminate the viewer");
332 auto debug_mode = op.add<popl::Switch>("", "debug", "debug mode");
333 auto eval_log = op.add<popl::Switch>("", "eval-log", "store trajectory and tracking times for evaluation");
334 auto map_db_path = op.add<popl::Value<std::string>>("p", "map-db", "store a map database at this path after SLAM", "");
335 try
336 {
337 op.parse(argc, argv);
338 }
339 catch (const std::exception &e)
340 {
341 std::cerr << e.what() << std::endl;
342 std::cerr << std::endl;
343 std::cerr << op << std::endl;
344 return EXIT_FAILURE;
345 }
346
347 // check validness of options
348 if (help->is_set())
349 {
350 std::cerr << op << std::endl;
351 return EXIT_FAILURE;
352 }
353 if (!vocab_file_path->is_set() || !data_dir_path->is_set() || !config_file_path->is_set())
354 {
355 std::cerr << "invalid arguments" << std::endl;
356 std::cerr << std::endl;
357 std::cerr << op << std::endl;
358 return EXIT_FAILURE;
359 }
360
361 // setup logger
362 spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] %^[%L] %v%$");
363 if (debug_mode->is_set())
364 {
365 spdlog::set_level(spdlog::level::debug);
366 }
367 else
368 {
369 spdlog::set_level(spdlog::level::info);
370 }
371
372 // load configuration
373 std::shared_ptr<PLPSLAM::config> cfg;

Callers

nothing calls this directly

Calls 9

set_patternFunction · 0.85
set_levelFunction · 0.85
whatMethod · 0.80
is_setMethod · 0.80
get_setup_type_stringMethod · 0.80
mono_trackingFunction · 0.70
rgbd_trackingFunction · 0.70
parseMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected