OccupancyGridMap.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/opengl/CSetOfObjects.h>
15 #include <mrpt/opengl/CPointCloud.h>
16 #include <mrpt/poses/CPose2D.h>
17 
18 #include <mrpt/version.h>
19 #if MRPT_VERSION >= 0x130
20 #include <mrpt/maps/COccupancyGridMap2D.h>
21 #include <mrpt/obs/CSinCosLookUpTableFor2DScans.h>
22 #include <mrpt/obs/CObservation2DRangeScan.h>
23 using namespace mrpt::obs;
24 using namespace mrpt::maps;
25 #else
26 #include <mrpt/slam/COccupancyGridMap2D.h>
27 #include <mrpt/slam/CSinCosLookUpTableFor2DScans.h>
28 #include <mrpt/slam/CObservation2DRangeScan.h>
29 using namespace mrpt::slam;
30 #endif
31 
32 namespace mvsim
33 {
35 {
37  public:
38  OccupancyGridMap(World* parent, const rapidxml::xml_node<char>* root);
39  virtual ~OccupancyGridMap();
40 
41  virtual void loadConfigFrom(
42  const rapidxml::xml_node<char>* root);
43  virtual void gui_update(
44  mrpt::opengl::COpenGLScene& scene);
45 
46  virtual void simul_pre_timestep(
47  const TSimulContext& context);
48 
49  const COccupancyGridMap2D& getOccGrid() const { return m_grid; }
50  COccupancyGridMap2D& getOccGrid() { return m_grid; }
51  protected:
52  COccupancyGridMap2D m_grid;
53 
55  mrpt::opengl::CSetOfObjects::Ptr m_gl_grid;
57 
58  struct TFixturePtr
59  {
61  TFixturePtr() : fixture(NULL) {}
62  };
63 
65  {
67  mrpt::poses::CPose2D pose;
68  CObservation2DRangeScan::Ptr scan;
70  std::vector<TFixturePtr> collide_fixtures;
71 
72  TInfoPerCollidableobj() : max_obstacles_ranges(0), collide_body(NULL) {}
73  };
74 
75  std::vector<TInfoPerCollidableobj> m_obstacles_for_each_obj;
76  std::vector<mrpt::opengl::CSetOfObjects::Ptr> m_gl_obs_clouds;
77 
79  std::vector<mrpt::opengl::CPointCloud::Ptr> m_gl_obs_clouds_buffer;
80 
81  CSinCosLookUpTableFor2DScans m_sincos_lut;
82 
84  double m_restitution;
86 };
87 }
std::vector< mrpt::opengl::CSetOfObjects::Ptr > m_gl_obs_clouds
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
CSinCosLookUpTableFor2DScans m_sincos_lut
double m_restitution
Elastic restitution coef (default: 0.01)
#define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME)
COccupancyGridMap2D m_grid
const COccupancyGridMap2D & getOccGrid() const
COccupancyGridMap2D & getOccGrid()
std::vector< mrpt::opengl::CPointCloud::Ptr > m_gl_obs_clouds_buffer
double m_lateral_friction
(Default: 0.5)
std::vector< TInfoPerCollidableobj > m_obstacles_for_each_obj
std::mutex m_gl_obs_clouds_buffer_cs


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