LaserScanner.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014 Jose Luis Blanco Claraco (University of Almeria) |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under GNU General Public License version 3 |
7  | See <http://www.gnu.org/licenses/> |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mutex>
14 #include <mrpt/poses/CPose2D.h>
15 #include <mrpt/opengl/CPlanarLaserScan.h>
16 
17 #include <mrpt/version.h>
18 #if MRPT_VERSION >= 0x130
19 #include <mrpt/obs/CObservation2DRangeScan.h>
20 using mrpt::obs::CObservation2DRangeScan;
21 #else
22 #include <mrpt/slam/CObservation2DRangeScan.h>
23 using mrpt::slam::CObservation2DRangeScan;
24 using mrpt::slam::CObservation2DRangeScanPtr;
25 #endif
26 
27 namespace mvsim
28 {
29 class LaserScanner : public SensorBase
30 {
32  public:
34  virtual ~LaserScanner();
35 
36  virtual void loadConfigFrom(
37  const rapidxml::xml_node<char>* root);
38  virtual void gui_update(
39  mrpt::opengl::COpenGLScene& scene);
40 
41  virtual void simul_pre_timestep(
42  const TSimulContext& context);
43  virtual void simul_post_timestep(
44  const TSimulContext& context);
45 
46  protected:
47  int m_z_order;
48  mrpt::poses::CPose2D m_sensor_pose_on_veh;
49  std::string m_name;
53 
55  CObservation2DRangeScan m_scan_model;
56 
60  std::mutex m_last_scan_cs;
61  mrpt::obs::CObservation2DRangeScan::Ptr
63  mrpt::obs::CObservation2DRangeScan::Ptr m_last_scan2gui;
64 
66  mrpt::opengl::CPlanarLaserScan::Ptr m_gl_scan;
68 };
69 }
mrpt::poses::CPose2D m_sensor_pose_on_veh
Definition: LaserScanner.h:48
LaserScanner(VehicleBase &parent, const rapidxml::xml_node< char > *root)
virtual void simul_post_timestep(const TSimulContext &context)
See docs in base class.
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root)
See docs in base class.
std::string m_name
sensor label/name
Definition: LaserScanner.h:49
mrpt::obs::CObservation2DRangeScan::Ptr m_last_scan
Last simulated scan.
Definition: LaserScanner.h:62
virtual void gui_update(mrpt::opengl::COpenGLScene &scene)
See docs in base class.
CObservation2DRangeScan m_scan_model
or not (Default=true)
Definition: LaserScanner.h:55
#define DECLARES_REGISTER_SENSOR(CLASS_NAME)
Definition: SensorBase.h:51
mrpt::obs::CObservation2DRangeScan::Ptr m_last_scan2gui
Definition: LaserScanner.h:63
int m_z_order
to help rendering multiple scans
Definition: LaserScanner.h:47
virtual void simul_pre_timestep(const TSimulContext &context)
See docs in base class.
mrpt::opengl::CPlanarLaserScan::Ptr m_gl_scan
call of gui_update() from m_last_scan2gui
Definition: LaserScanner.h:67
std::mutex m_last_scan_cs
Definition: LaserScanner.h:60


mvsim
Author(s):
autogenerated on Thu Jun 6 2019 19:36:40