MRPT  1.9.9
RawlogGrabberApp.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 
14 #include <mrpt/obs/CSensoryFrame.h>
15 #include <mrpt/obs/obs_frwds.h>
17 
18 namespace mrpt::apps
19 {
20 /** RawlogGrabber application wrapper class.
21  *
22  * \note If the environment variable `MRPT_HWDRIVERS_VERBOSE=1` is defined
23  * before calling initialize(), verbosity level will be changed to LVL_DEBUG.
24  *
25  * \ingroup mrpt_apps_grp
26  */
28 {
29  public:
31 
32  /** @name Main API
33  * @{ */
34 
35  /** Initializes the application from CLI parameters. Refer to the manpage of
36  * rawlog-grabber. Throws on errors.
37  */
38  void initialize(int argc, const char** argv);
39 
40  inline void initialize(int argc, char** argv)
41  {
42  initialize(argc, const_cast<const char**>(argv));
43  }
44 
45  /** Runs with the current parameter set. Throws on errors. */
46  void run();
47 
48  /** @} */
49 
50  /** @name Parameters and options. See: initialize()
51  * @{ */
52 
53  /** If >0, run() will return after this period (in seconds) */
54  double run_for_seconds = 0;
55 
56  /** If enabled (default), exceptions in sensor threads will be reported to
57  * std::cerr */
59 
60  /** Populated in initialize(). Can be replaced or manipulated by the user
61  * after that and before run() to change the parameters loaded from INI
62  * file. */
64 
65  /** @} */
66 
67  /** @name Outputs and result variables
68  * @{ */
69 
70  std::string rawlog_filename; //!< The generated .rawlog file
71  std::size_t rawlog_saved_objects; //!< Counter of saved objects
72 
73  /** @} */
74 
75  void SensorThread(std::string sensor_label);
76 
77  private:
78  using TListObservations =
80 
81  void dump_verbose_info(
83  void dump_verbose_info(const mrpt::obs::CSensoryFrame& sf) const;
85  void dump_IMU_info(const mrpt::obs::CObservationIMU& o) const;
86 
87  void process_observations_for_sf(const TListObservations& list_obs);
89 
92 
93  bool allThreadsMustExit = false;
94 
95  /** Directory where to save externally stored images, only for
96  * CCameraSensor's. */
97  std::string m_rawlog_ext_imgs_dir;
98 
100 
102  double SF_max_time_span = 0.25; // Seconds
103 };
104 
105 } // namespace mrpt::apps
This class implements a config file-like interface over a memory-stored string list.
mrpt::serialization::CArchive * m_out_arch_ptr
TListObservations m_global_list_obs
std::string m_rawlog_ext_imgs_dir
Directory where to save externally stored images, only for CCameraSensor&#39;s.
This class stores measurements from an Inertial Measurement Unit (IMU) (attitude estimation, raw gyroscope and accelerometer values), altimeters or magnetometers.
mrpt::hwdrivers::CGenericSensor::TListObservations TListObservations
bool show_sensor_thread_exceptions
If enabled (default), exceptions in sensor threads will be reported to std::cerr. ...
void dump_verbose_info(const mrpt::serialization::CSerializable::Ptr &o) const
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
Versatile class for consistent logging and management of output messages.
std::string rawlog_filename
The generated .rawlog file.
void run()
Runs with the current parameter set.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:51
void SensorThread(std::string sensor_label)
void process_observations_for_nonsf(const TListObservations &list_obs)
double run_for_seconds
If >0, run() will return after this period (in seconds)
const char * argv[]
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:54
std::multimap< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr > TListObservations
void process_observations_for_sf(const TListObservations &list_obs)
std::size_t rawlog_saved_objects
Counter of saved objects.
const int argc
void dump_GPS_mode_info(const mrpt::obs::CObservationGPS &o) const
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
mrpt::config::CConfigFileMemory params
Populated in initialize().
void dump_IMU_info(const mrpt::obs::CObservationIMU &o) const
RawlogGrabber application wrapper class.
void initialize(int argc, char **argv)
mrpt::obs::CSensoryFrame m_curSF



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 3a26b90fd Wed Mar 25 20:17:03 2020 +0100 at miƩ mar 25 23:05:41 CET 2020