mrpt_sensorlib.h
Go to the documentation of this file.
1 /* mrpt_sensorlib ROS package
2  *
3  * Copyright 2021-2022, Jose Luis Blanco Claraco
4  * License: BSD 3-Clause License
5  */
6 
7 #pragma once
8 
9 #include <ros/ros.h>
10 #include <mrpt/hwdrivers/CGenericSensor.h>
11 #include <mrpt/io/CFileGZOutputStream.h>
12 #include <optional>
13 #include <mrpt/obs/obs_frwds.h>
14 
15 namespace mrpt_sensorlib
16 {
23 {
24  public:
26  virtual ~GenericSensorNode();
27 
29  virtual void init_from_config_file(int argc, char** argv);
30 
31  virtual void init_from_template_and_parameters(int argc, char** argv);
32 
34  void run();
35 
36  protected:
39 
40  std::optional<std::string> cfgfilename_;
41  std::shared_ptr<mrpt::config::CConfigFileBase> cfgfile_;
42  std::string cfg_section_{"SENSOR1"};
43 
44  mrpt::hwdrivers::CGenericSensor::Ptr sensor_;
45  std::string out_rawlog_prefix_;
46  mrpt::io::CFileGZOutputStream out_rawlog_;
48 
50  virtual void internal_init();
51 
52  virtual void process_sensor_specific()
53  { /*do nothing by default*/
54  }
55  virtual void init_sensor_specific()
56  { /*do nothing by default*/
57  }
58 
60  virtual void on_observation(const mrpt::obs::CObservation::Ptr& o);
61 
62  virtual void on_observation_velodyne(
63  const mrpt::obs::CObservationVelodyneScan& o);
64 };
65 
66 } // namespace mrpt_sensorlib
std::string out_rawlog_prefix_
If non-empty, write to rawlog.
virtual void init_from_config_file(int argc, char **argv)
mrpt::hwdrivers::CGenericSensor::Ptr sensor_
virtual void on_observation_velodyne(const mrpt::obs::CObservationVelodyneScan &o)
virtual void init_from_template_and_parameters(int argc, char **argv)
mrpt::io::CFileGZOutputStream out_rawlog_
std::optional< std::string > cfgfilename_
std::shared_ptr< mrpt::config::CConfigFileBase > cfgfile_
virtual void on_observation(const mrpt::obs::CObservation::Ptr &o)


mrpt_sensorlib
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Fri Jun 16 2023 02:35:27