10#include <OgreSceneManager.h>
11#include <OgreSceneNode.h>
13#include "rviz_common/display_context.hpp"
14#include "rviz_common/frame_manager_iface.hpp"
15#include "rviz_common/interaction/selection_manager.hpp"
16#include "rviz_common/properties/parse_color.hpp"
17#include "rviz_common/properties/property.hpp"
19using rviz_common::properties::BoolProperty;
20using rviz_common::properties::ColorProperty;
21using rviz_common::properties::FloatProperty;
22using rviz_common::properties::qtToOgre;
23using rviz_common::properties::StringProperty;
32 new StringProperty(QString::fromStdString(
"Name of lanelet2_map_server"), QString::fromStdString(
"lanelet2_map_server"),
33 QString::fromStdString(
"Global name of lanelet2_map_server node"),
this, SLOT(
updateServerName()));
36 new FloatProperty(
"Alpha", 1.0F,
"The amount of transparency to apply to the Map.",
this, SLOT(
updateColor()),
this);
41 new BoolProperty(
"Show Map in 3D",
true,
"Toggles wether to display the lanelet map with or without its z coordinates.",
45 new BoolProperty(
"Visualize Lanelet-Linestrings",
true,
"Activate the visualization of Lanelet-Linestrings.",
this,
48 ll_left_col_property_ =
new ColorProperty(
"LL Color Left", Qt::white,
"Color of left Lanelet-Linestring.",
51 ll_right_col_property_ =
new ColorProperty(
"LL Color Right", Qt::white,
"Color of right Lanelet-Linestring.",
59 new BoolProperty(
"Visualize Lanelet-Separators",
false,
"Activate the visualization of Lanelet-Separators.",
this,
62 separators_col_property_ =
new ColorProperty(
"Separators Color", QColor{25, 25, 230},
"Color of Lanelet Separators.",
69 viz_stop_line_property_ =
new BoolProperty(
"Visualize Stop lines",
true,
"Activate the visualization of Stop-Lines.",
this,
80 new BoolProperty(
"Visualize Traffic Lights",
true,
"Activate the visualization of Traffic-Lights.",
this,
87 new FloatProperty(
"Traffic Light Height", 3.0F,
"The height, in meters, of each traffic light.",
92 new BoolProperty(
"Visualize Areas",
true,
"Activate the visualization of Areas.",
this, SLOT(
updateAreaRendering()));
101 fill_area_property_ =
new BoolProperty(
"Fill Areas",
false,
"Toggles wether to fill the areas with color or not.",
105 new BoolProperty(
"Visualize Parking",
true,
"Activate the visualization of Parking.",
this, SLOT(
updateParkingRendering()));
114 fill_parking_property_ =
new BoolProperty(
"Fill Parking",
true,
"Toggles wether to fill the parking with color or not.",
118 viz_lane_fill_property_ =
new BoolProperty(
"Fill Lanelets (Road)",
true,
"Render road surface as filled polygons.",
this,
124 viz_sidewalk_property_ =
new BoolProperty(
"Visualize Sidewalks",
true,
"Render sidewalk areas as filled polygons.",
this,
126 sidewalk_col_property_ =
new ColorProperty(
"Sidewalk Color", QColor{191, 191, 191},
"Color of sidewalks.",
129 viz_crosswalk_property_ =
new BoolProperty(
"Visualize Crosswalks",
true,
"Render crosswalk areas as filled polygons.",
this,
134 viz_id_property_ =
new BoolProperty(
"Visualize Lanelet-IDs",
false,
"Activate the visualization of Lanelet-IDs.",
this,
150 if (name[0] !=
'/') {
158 auto nodeAbstraction = context_->getRosNodeAbstraction().lock();
178 Ogre::Vector3 position;
179 Ogre::Quaternion orientation;
180 if (context_->getFrameManager()->getTransform(
lanelet2_map_interface_->map_frame_id_, position, orientation)) {
181 scene_node_->setPosition(position);
182 scene_node_->setOrientation(orientation);
186 map_->getSceneNode()->setVisible(
false);
388#include <pluginlib/class_list_macros.hpp>
rviz_common::properties::ColorProperty * parking_col_property_
void onInitialize() override
Initializes the display once RViz has provided the rendering context.
bool visualizeMap()
Creates the RViz rendering object for the currently loaded map.
rviz_common::properties::StringProperty * ll2_server_name_property_
rviz_common::properties::BoolProperty * viz_sidewalk_property_
rviz_common::properties::BoolProperty * viz_lane_fill_property_
rviz_common::properties::BoolProperty * fill_parking_property_
rviz_common::properties::ColorProperty * stop_line_col_property_
rviz_common::properties::ColorProperty * ll_right_col_property_
rclcpp::Node::SharedPtr rviz_node_
rviz_common::properties::FloatProperty * area_width_property_
void updateParkingRendering()
std::unique_ptr< Lanelet2MapInterface > lanelet2_map_interface_
rviz_common::properties::BoolProperty * viz_separators_property_
rviz_common::properties::FloatProperty * char_height_property_
rviz_common::properties::ColorProperty * sidewalk_col_property_
void updateAreaRendering()
void updateTrafficLightRendering()
rviz_common::properties::BoolProperty * viz_traffic_light_property_
rviz_common::properties::ColorProperty * area_col_property_
rviz_common::properties::ColorProperty * separators_col_property_
void updateSidewalkRendering()
void initializeMapInterface(rclcpp::Node &parent_node)
Creates the map interface used to fetch map data from the server node.
rviz_common::properties::BoolProperty * viz_id_property_
~Lanelet2Display() override
Destroys the RViz display and releases its map visualization resources.
rviz_common::properties::FloatProperty * stop_line_width_property_
rviz_common::properties::BoolProperty * viz_crosswalk_property_
std::unique_ptr< rviz_rendering::Lanelet2Map > map_
void updateVisibility()
Applies visibility toggles to the existing rendered map objects.
void updateLinestringRendering()
rviz_common::properties::BoolProperty * viz_stop_line_property_
void update(float dt, float ros_dt) override
Periodically updates the display and refreshes the rendered map when needed.
void updateStopLineRendering()
rviz_common::properties::FloatProperty * traffic_light_height_property_
rviz_common::properties::ColorProperty * traffic_light_col_property_
rviz_common::properties::FloatProperty * linestring_width_property_
rviz_common::properties::FloatProperty * alpha_property_
rviz_common::properties::FloatProperty * separators_width_property_
rviz_common::properties::ColorProperty * id_col_property_
rviz_common::properties::ColorProperty * lane_fill_col_property_
void updateCrosswalkRendering()
rviz_common::properties::ColorProperty * ll_left_col_property_
rviz_common::properties::FloatProperty * parking_width_property_
void updateSeparatorsRendering()
Lanelet2Display()
Creates the RViz display and initializes its configurable properties.
rviz_common::properties::BoolProperty * viz_parking_property_
void updateVisualization()
Rebuilds the rendered map using the current rendering options.
rviz_rendering::Lanelet2Map::RenderingOptions rendering_options_
rviz_common::properties::BoolProperty * three_d_property_
void updateLaneFillRendering()
rviz_common::properties::BoolProperty * viz_linestring_property_
rviz_common::properties::BoolProperty * fill_area_property_
rviz_common::properties::BoolProperty * viz_area_property_
rviz_common::properties::ColorProperty * crosswalk_col_property_
Ogre::ColourValue colorLaneletId
Ogre::ColourValue colorSeperator
bool renderLaneletLinestrings
Ogre::ColourValue colorStopLine
Ogre::ColourValue colorLaneFill
Ogre::ColourValue colorParking
double trafficLightHeightAboveGround
Ogre::ColourValue colorLeft
Ogre::ColourValue colorSidewalk
Ogre::ColourValue colorArea
Ogre::ColourValue colorTrafficLight
Ogre::ColourValue colorCrosswalk
Ogre::ColourValue colorRight
bool renderLaneletSeparators