lanelet2_map_server v1.2.3
Loading...
Searching...
No Matches
lanelet2_map.hpp
Go to the documentation of this file.
1// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
2// SPDX-License-Identifier: Apache-2.0
3
4#ifndef LANELET2_RVIZ_DISPLAY__LANELET2_MAP_HPP_
5#define LANELET2_RVIZ_DISPLAY__LANELET2_MAP_HPP_
6
7#include <OgreColourValue.h>
8
9#include <lanelet2_core/LaneletMap.h>
10
11#include <memory>
12#include <utility>
13#include <vector>
14
15namespace Ogre {
16class Material;
17class MovableObject;
18class SceneManager;
19class SceneNode;
20} // namespace Ogre
21
22namespace rviz_rendering {
23
24namespace detail {
26} // namespace detail
27
41
42using ClassifiedMovableObject = std::pair<ObjectClassification, Ogre::MovableObject*>;
43
46
47 public:
49
51 double linestringWidth = 0.1;
52 double seperatorWidth = 0.2;
53 double stopLineWidth = 0.2;
55 double areaWidth = 0.3;
56 double parkingWidth = 0.3;
57 double characterHeight = 1.0;
58 double zLaneFill = 0.02;
59 double zSidewalk = 0.03;
60 double zAreas = 0.032;
61 double zParking = 0.034;
62 double zCrosswalk = 0.05;
63 double zRoadLines = 0.06;
64 double zStopLine = 0.08;
65 double zSeparator = 0.085;
66
67 Ogre::ColourValue colorLeft{Ogre::ColourValue(1.0, 1.0, 1.0, 1.0)};
68 Ogre::ColourValue colorRight{Ogre::ColourValue(1.0, 1.0, 1.0, 1.0)};
69 Ogre::ColourValue colorSeperator{Ogre::ColourValue(0.1, 0.1, 0.9, 1.0)};
70 Ogre::ColourValue colorStopLine{Ogre::ColourValue(1.0, 0.1, 0.1, 1.0)};
71 Ogre::ColourValue colorTrafficLight{Ogre::ColourValue(0.4, 0.4, 0.4, 1.0)};
72 Ogre::ColourValue colorLaneFill{Ogre::ColourValue(0.22, 0.22, 0.22, 0.95)};
73 Ogre::ColourValue colorArea{Ogre::ColourValue(0.9, 0.5, 0.1, 1.0)};
74 Ogre::ColourValue colorParking{Ogre::ColourValue(0.0, 0.7, 0.3, 1.0)};
75 Ogre::ColourValue colorSidewalk{Ogre::ColourValue(0.75, 0.75, 0.75, 0.7)};
76 Ogre::ColourValue colorCrosswalk{Ogre::ColourValue(1.0, 1.0, 1.0, 0.85)};
77 Ogre::ColourValue colorLaneletId{Ogre::ColourValue(1.0, 1.0, 1.0, 1.0)};
78
79 bool threeD = true;
82 bool renderStopLines = true;
84 bool renderLaneletFills = true;
85 bool renderAreas = true;
86 bool fillArea = false;
87 bool renderParking = true;
88 bool fillParking = true;
89 bool renderSidewalks = true;
90 bool renderCrosswalks = true;
91 bool renderLaneletIds = false;
92 };
93
95 Lanelet2Map(Ogre::SceneManager* manager,
96 Ogre::SceneNode* parent_node,
98 lanelet::LaneletMapConstPtr map_ptr);
99
101 ~Lanelet2Map();
102
104 Lanelet2Map(const Lanelet2Map&) = delete;
105
108
111
114
116 void clearObjects();
117
119 Ogre::SceneNode* getSceneNode() { return scene_node_; }
120
122 void updateMap(RenderingOptions rend_opts, lanelet::LaneletMapConstPtr map_ptr);
123
125 void updateVisibility(const RenderingOptions& rend_opts);
126
127 private:
129 void create(lanelet::LaneletMapConstPtr map_ptr);
131 void updateVisibility(ObjectClassification classification, bool visible);
132
134
135 Ogre::SceneManager* scene_manager_;
136 Ogre::SceneNode* scene_node_;
137 std::vector<ClassifiedMovableObject> objects_;
138
139 std::shared_ptr<Ogre::Material> material_surface_;
140 std::shared_ptr<Ogre::Material> material_line_;
141 std::unique_ptr<detail::Lanelet2MapHelpers> bsd_helpers_;
142};
143
144} // namespace rviz_rendering
145
146#endif // LANELET2_RVIZ_DISPLAY__LANELET2_MAP_HPP_
Ogre::SceneNode * getSceneNode()
Return the root scene node used by this map.
Lanelet2Map & operator=(const Lanelet2Map &)=delete
Copy assignment is disabled because the map owns OGRE scene objects.
void clearObjects()
Remove all OGRE objects owned by this map.
Lanelet2Map::RenderingOptions rend_opts_
std::vector< ClassifiedMovableObject > objects_
void updateMap(RenderingOptions rend_opts, lanelet::LaneletMapConstPtr map_ptr)
Replace the rendered map and apply the given rendering options.
Ogre::SceneNode * scene_node_
std::unique_ptr< detail::Lanelet2MapHelpers > bsd_helpers_
~Lanelet2Map()
Destroy the scene representation and its OGRE objects.
Lanelet2Map(Ogre::SceneManager *manager, Ogre::SceneNode *parent_node, Lanelet2Map::RenderingOptions rend_opts, lanelet::LaneletMapConstPtr map_ptr)
Create an RViz scene representation for a lanelet map.
std::shared_ptr< Ogre::Material > material_line_
Lanelet2Map & operator=(Lanelet2Map &&)=delete
Move assignment is disabled because OGRE scene ownership is pointer-based.
std::shared_ptr< Ogre::Material > material_surface_
void updateVisibility(const RenderingOptions &rend_opts)
Update object visibility from the supplied rendering options.
Lanelet2Map(const Lanelet2Map &)=delete
Copy construction is disabled because the map owns OGRE scene objects.
void create(lanelet::LaneletMapConstPtr map_ptr)
Create OGRE objects for all supported lanelet map layers.
Ogre::SceneManager * scene_manager_
Lanelet2Map(Lanelet2Map &&)=delete
Move construction is disabled because OGRE scene ownership is pointer-based.
std::pair< ObjectClassification, Ogre::MovableObject * > ClassifiedMovableObject