MRPT  2.0.0
ICP_SLAM_App.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
18 #include <atomic>
19 
20 namespace mrpt::apps
21 {
22 /** ICP-SLAM virtual base class for application wrappers.
23  *
24  * This virtual base provides the common code to the applications icp-slam and
25  * icp-slam-live, and could be used by users to build their own ICP-SLAM
26  * solution.
27  *
28  * \sa mrpt::slam::CMetricMapBuilderICP
29  * \ingroup mrpt_apps_grp
30  */
33  virtual public mrpt::apps::BaseAppDataSource
34 {
35  public:
37 
38  /** @name Main API
39  * @{ */
40 
41  /** Initializes the application from CLI parameters. Refer to the manpage of
42  * icp-slam and icp-slam-live. Throws on errors.
43  */
44  void initialize(int argc, const char** argv);
45 
46  inline void initialize(int argc, char** argv)
47  {
48  initialize(argc, const_cast<const char**>(argv));
49  }
50 
51  /** Runs with the current parameter set. Throws on errors. */
52  void run();
53 
54  /** @} */
55 
56  /** @name Parameters and options. See: initialize()
57  * @{ */
58 
59  /** Populated in initialize(). Can be replaced or manipulated by the user
60  * after that and before run() to change the parameters loaded from INI
61  * file. */
63 
64  /** If enabled (default), stdin will be watched and application quits if ESC
65  * is pressed. */
66  bool quits_with_esc_key = true;
67 
68  /** @} */
69 
70  /** @name Outputs and result variables
71  * @{ */
72 
73  std::map<mrpt::system::TTimeStamp, mrpt::math::TPose3D> out_estimated_path;
74 
75  /** @} */
76 };
77 
78 /** Instance of ICP_SLAM_App_Base to run mapping from an offline dataset file.
79  */
81 {
82  public:
84 
85  protected:
86  void impl_initialize(int argc, const char** argv) override;
87  std::string impl_get_usage() const override
88  {
89  return "icp-slam <config_file> [dataset.rawlog]";
90  }
91 };
92 
93 /** Instance of ICP_SLAM_App_Base to run mapping from a live LIDAR sensor.
94  */
96 {
97  public:
99  virtual ~ICP_SLAM_App_Live() override;
100 
101  protected:
102  void impl_initialize(int argc, const char** argv) override;
103  std::string impl_get_usage() const override
104  {
105  return "icp-slam-live <config_file>";
106  }
107 
110  mrpt::obs::CSensoryFrame::Ptr& observations,
111  mrpt::obs::CObservation::Ptr& observation) override;
112 
114  {
116  std::string section_name;
117  };
118 
120 
123  std::atomic_bool m_allThreadsMustExit = false;
124 };
125 
126 } // namespace mrpt::apps
std::atomic_bool m_allThreadsMustExit
Definition: ICP_SLAM_App.h:123
mrpt::hwdrivers::CGenericSensor::TListObservations m_global_list_obs
Definition: ICP_SLAM_App.h:121
This class implements a config file-like interface over a memory-stored string list.
Virtual interface for applications that initialize from CLI parameters.
mrpt::config::CConfigFileMemory params
Populated in initialize().
Definition: ICP_SLAM_App.h:62
std::string impl_get_usage() const override
Definition: ICP_SLAM_App.h:103
std::map< mrpt::system::TTimeStamp, mrpt::math::TPose3D > out_estimated_path
Definition: ICP_SLAM_App.h:73
bool impl_get_next_observations(mrpt::obs::CActionCollection::Ptr &action, mrpt::obs::CSensoryFrame::Ptr &observations, mrpt::obs::CObservation::Ptr &observation) override
Get next sensory data.
mrpt::config::CConfigFileBase * cfgFile
Definition: ICP_SLAM_App.h:115
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
void run()
Runs with the current parameter set.
ICP-SLAM virtual base class for application wrappers.
Definition: ICP_SLAM_App.h:31
Instance of ICP_SLAM_App_Base to run mapping from an offline dataset file.
Definition: ICP_SLAM_App.h:80
This class allows loading and storing values and vectors of different types from a configuration text...
Versatile class for consistent logging and management of output messages.
void initialize(int argc, char **argv)
Definition: ICP_SLAM_App.h:46
Instance of ICP_SLAM_App_Base to run mapping from a live LIDAR sensor.
Definition: ICP_SLAM_App.h:95
void impl_initialize(int argc, const char **argv) override
const char * argv[]
std::multimap< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr > TListObservations
std::string impl_get_usage() const override
Definition: ICP_SLAM_App.h:87
void impl_initialize(int argc, const char **argv) override
Implementation of BaseAppDataSource for reading from a rawlog file.
const int argc
void SensorThread(TThreadParams params)
virtual ~ICP_SLAM_App_Live() override
bool quits_with_esc_key
If enabled (default), stdin will be watched and application quits if ESC is pressed.
Definition: ICP_SLAM_App.h:66
Virtual interface for offline datasets (rawlog) or live sensors.



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020