Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
modules
simulator
include
mvsim
WorldElements
OccupancyGridMap.h
Go to the documentation of this file.
1
/*+-------------------------------------------------------------------------+
2
| MultiVehicle simulator (libmvsim) |
3
| |
4
| Copyright (C) 2014-2020 Jose Luis Blanco Claraco |
5
| Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6
| Distributed under 3-clause BSD License |
7
| See COPYING |
8
+-------------------------------------------------------------------------+ */
9
10
#pragma once
11
12
#include <mrpt/maps/COccupancyGridMap2D.h>
13
#include <mrpt/obs/CObservation2DRangeScan.h>
14
#include <mrpt/obs/CSinCosLookUpTableFor2DScans.h>
15
#include <
mrpt/opengl/CPointCloud.h
>
16
#include <
mrpt/opengl/CSetOfObjects.h
>
17
#include <
mrpt/poses/CPose2D.h
>
18
#include <
mvsim/WorldElements/WorldElementBase.h
>
19
20
#include <mutex>
21
22
namespace
mvsim
23
{
24
class
OccupancyGridMap
:
public
WorldElementBase
25
{
26
DECLARES_REGISTER_WORLD_ELEMENT
(
OccupancyGridMap
)
27
public
:
28
OccupancyGridMap
(
World
* parent,
const
rapidxml::xml_node<char>
*
root
);
29
virtual
~OccupancyGridMap
();
30
31
virtual
void
loadConfigFrom
(
const
rapidxml::xml_node<char>
* root)
override
;
32
33
virtual
void
simul_pre_timestep
(
const
TSimulContext
& context)
override
;
34
35
const
mrpt::maps::COccupancyGridMap2D
&
getOccGrid
()
const
{
return
m_grid
; }
36
mrpt::maps::COccupancyGridMap2D
&
getOccGrid
() {
return
m_grid
; }
37
38
void
poses_mutex_lock
()
override
{}
39
void
poses_mutex_unlock
()
override
{}
40
41
protected
:
42
virtual
void
internalGuiUpdate
(
43
mrpt::opengl::COpenGLScene
&
scene
,
bool
childrenOnly)
override
;
44
45
mrpt::maps::COccupancyGridMap2D
m_grid
;
46
47
bool
m_gui_uptodate
;
48
mrpt::opengl::CSetOfObjects::Ptr
m_gl_grid
;
50
51
struct
TFixturePtr
52
{
53
b2Fixture
*
fixture
;
54
TFixturePtr
() : fixture(nullptr) {}
55
};
56
57
struct
TInfoPerCollidableobj
58
{
59
float
max_obstacles_ranges
;
60
mrpt::poses::CPose2D
pose
;
61
mrpt::obs::CObservation2DRangeScan::Ptr
scan
;
62
b2Body
*
collide_body
;
63
std::vector<TFixturePtr>
collide_fixtures
;
64
65
TInfoPerCollidableobj
() : max_obstacles_ranges(0), collide_body(nullptr)
66
{
67
}
68
};
69
70
std::vector<TInfoPerCollidableobj>
m_obstacles_for_each_obj
;
71
std::vector<mrpt::opengl::CSetOfObjects::Ptr>
m_gl_obs_clouds
;
72
73
std::mutex
m_gl_obs_clouds_buffer_cs
;
74
std::vector<mrpt::opengl::CPointCloud::Ptr>
m_gl_obs_clouds_buffer
;
75
76
mrpt::obs::CSinCosLookUpTableFor2DScans
m_sincos_lut
;
77
78
bool
m_show_grid_collision_points
;
79
double
m_restitution
;
80
double
m_lateral_friction
;
81
};
82
}
// namespace mvsim
CPose2D.h
mrpt::maps::COccupancyGridMap2D
mrpt::poses::CPose2D
mvsim::OccupancyGridMap::m_gl_obs_clouds
std::vector< mrpt::opengl::CSetOfObjects::Ptr > m_gl_obs_clouds
Definition:
OccupancyGridMap.h:71
mvsim::OccupancyGridMap::getOccGrid
const mrpt::maps::COccupancyGridMap2D & getOccGrid() const
Definition:
OccupancyGridMap.h:35
mvsim
mvsim::OccupancyGridMap::TInfoPerCollidableobj::max_obstacles_ranges
float max_obstacles_ranges
Definition:
OccupancyGridMap.h:59
mvsim::OccupancyGridMap::getOccGrid
mrpt::maps::COccupancyGridMap2D & getOccGrid()
Definition:
OccupancyGridMap.h:36
mvsim::OccupancyGridMap::m_gl_grid
mrpt::opengl::CSetOfObjects::Ptr m_gl_grid
call of internalGuiUpdate()
Definition:
OccupancyGridMap.h:49
mvsim::OccupancyGridMap::TInfoPerCollidableobj::scan
mrpt::obs::CObservation2DRangeScan::Ptr scan
Definition:
OccupancyGridMap.h:61
mvsim::OccupancyGridMap::m_show_grid_collision_points
bool m_show_grid_collision_points
Definition:
OccupancyGridMap.h:78
mrpt::opengl::COpenGLScene
mvsim::OccupancyGridMap::m_sincos_lut
mrpt::obs::CSinCosLookUpTableFor2DScans m_sincos_lut
Definition:
OccupancyGridMap.h:76
mvsim::OccupancyGridMap::~OccupancyGridMap
virtual ~OccupancyGridMap()
Definition:
OccupancyGridMap.cpp:38
mvsim::World
Definition:
World.h:41
mvsim::TSimulContext
Definition:
basic_types.h:56
scene
scene
mvsim::OccupancyGridMap::TInfoPerCollidableobj::collide_fixtures
std::vector< TFixturePtr > collide_fixtures
Definition:
OccupancyGridMap.h:63
b2Fixture
Definition:
b2Fixture.h:107
mvsim::OccupancyGridMap::TFixturePtr::fixture
b2Fixture * fixture
Definition:
OccupancyGridMap.h:53
b2Body
A rigid body. These are created via b2World::CreateBody.
Definition:
b2Body.h:126
mvsim::OccupancyGridMap::m_restitution
double m_restitution
Elastic restitution coef (default: 0.01)
Definition:
OccupancyGridMap.h:79
mvsim::OccupancyGridMap::OccupancyGridMap
OccupancyGridMap(World *parent, const rapidxml::xml_node< char > *root)
Definition:
OccupancyGridMap.cpp:27
mvsim::OccupancyGridMap::m_gui_uptodate
bool m_gui_uptodate
Definition:
OccupancyGridMap.h:47
mvsim::OccupancyGridMap::TInfoPerCollidableobj::collide_body
b2Body * collide_body
Definition:
OccupancyGridMap.h:62
CPointCloud.h
DECLARES_REGISTER_WORLD_ELEMENT
#define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME)
Definition:
WorldElementBase.h:45
mvsim::OccupancyGridMap::poses_mutex_lock
void poses_mutex_lock() override
Definition:
OccupancyGridMap.h:38
mvsim::WorldElementBase
Definition:
WorldElementBase.h:18
root
T root(const T v0, const T v1)
mvsim::OccupancyGridMap::loadConfigFrom
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root) override
Definition:
OccupancyGridMap.cpp:39
mvsim::OccupancyGridMap::poses_mutex_unlock
void poses_mutex_unlock() override
Definition:
OccupancyGridMap.h:39
WorldElementBase.h
mvsim::OccupancyGridMap::TInfoPerCollidableobj::TInfoPerCollidableobj
TInfoPerCollidableobj()
Definition:
OccupancyGridMap.h:65
mvsim::OccupancyGridMap::m_grid
mrpt::maps::COccupancyGridMap2D m_grid
Definition:
OccupancyGridMap.h:45
mvsim::OccupancyGridMap::TInfoPerCollidableobj
Definition:
OccupancyGridMap.h:57
mvsim::OccupancyGridMap::m_gl_obs_clouds_buffer
std::vector< mrpt::opengl::CPointCloud::Ptr > m_gl_obs_clouds_buffer
Definition:
OccupancyGridMap.h:74
mvsim::OccupancyGridMap::TFixturePtr::TFixturePtr
TFixturePtr()
Definition:
OccupancyGridMap.h:54
mvsim::OccupancyGridMap::internalGuiUpdate
virtual void internalGuiUpdate(mrpt::opengl::COpenGLScene &scene, bool childrenOnly) override
Definition:
OccupancyGridMap.cpp:92
mvsim::OccupancyGridMap
Definition:
OccupancyGridMap.h:24
mvsim::OccupancyGridMap::m_lateral_friction
double m_lateral_friction
(Default: 0.5)
Definition:
OccupancyGridMap.h:80
mvsim::OccupancyGridMap::m_obstacles_for_each_obj
std::vector< TInfoPerCollidableobj > m_obstacles_for_each_obj
Definition:
OccupancyGridMap.h:70
rapidxml::xml_node
Definition:
rapidxml.hpp:137
mvsim::OccupancyGridMap::TInfoPerCollidableobj::pose
mrpt::poses::CPose2D pose
Definition:
OccupancyGridMap.h:60
mvsim::OccupancyGridMap::TFixturePtr
Definition:
OccupancyGridMap.h:51
mvsim::OccupancyGridMap::simul_pre_timestep
virtual void simul_pre_timestep(const TSimulContext &context) override
Definition:
OccupancyGridMap.cpp:140
mvsim::OccupancyGridMap::m_gl_obs_clouds_buffer_cs
std::mutex m_gl_obs_clouds_buffer_cs
Definition:
OccupancyGridMap.h:73
mrpt::obs::CSinCosLookUpTableFor2DScans
CSetOfObjects.h
mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:51