|
lanelet2_map_server v1.2.3
|
Lanelet2LichtblickDisplay class. More...
#include <lanelet2_lichtblick_display.hpp>
Public Member Functions | |
| Lanelet2LichtblickDisplay () | |
| Creates the Lichtblick visualization node and declares its rendering parameters. | |
Private Member Functions | |
| template<typename T > | |
| void | declareAndLoadParameter (const std::string &name, T ¶m, const std::string &description, const bool add_to_auto_reconfigurable_params=true, const bool is_required=false, const bool read_only=false, const std::optional< double > &from_value=std::nullopt, const std::optional< double > &to_value=std::nullopt, const std::optional< double > &step_value=std::nullopt, const std::string &additional_constraints="") |
| Declares and loads a ROS parameter. | |
| rcl_interfaces::msg::SetParametersResult | parametersCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Handles reconfiguration when a parameter value is changed. | |
| void | setup () |
| Sets up subscribers, publishers, etc. to configure the node. | |
| void | checkMapStatus () |
| Check for a new or changed Lanelet2 map and publish markers if present. | |
| void | hexToRgb (const std::string &hex, float &r, float &g, float &b) |
| Convert a hex color string into normalized RGB float components. | |
| void | publishMarker (const lanelet::LaneletMapConstPtr &lanelet_map) |
| Converts a Lanelet2 map into a MarkerArray and publishes it. | |
| void | clearAllMarkers () |
| Publishes a DELETEALL action to clear all markers from the topic. | |
| void | addLineStripMarker (visualization_msgs::msg::MarkerArray &marker_array_msg, int ¤t_marker_id, const std::string &ns, double line_width, const std::string &color_hex, double opacity, const std_msgs::msg::Header &header, const std::vector< geometry_msgs::msg::Point > &points) |
| Creates and adds a LINE_STRIP marker to a marker array. | |
Static Private Member Functions | |
| static geometry_msgs::msg::Point | toRos (const Eigen::Vector3d &point) |
| Converts an Eigen::Vector3d into a ROS geometry_msgs::msg::Point. | |
| static void | addMeshMarker (visualization_msgs::msg::MarkerArray &marker_array_msg, int ¤t_marker_id, const std::string &ns, const std::string &mesh_resource, const geometry_msgs::msg::Point &position, double scale, double z_offset, double opacity, const std_msgs::msg::Header &header, double yaw_ref_line, const geometry_msgs::msg::Point &middle_point) |
| Creates and adds a MESH_RESOURCE marker for regulatory elements. | |
| static std::optional< std::array< geometry_msgs::msg::Point, 2 > > | regulatoryElementReferenceLine (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the reference/effect line of a regulatory element. | |
| static std::vector< geometry_msgs::msg::Point > | regulatoryElementPositions (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the sign/signal positions of a regulatory element. | |
Private Attributes | |
| std::vector< std::tuple< std::string, std::function< void(const rclcpp::Parameter &)> > > | auto_reconfigurable_params_ |
| Auto-reconfigurable parameters for dynamic reconfiguration. | |
| OnSetParametersCallbackHandle::SharedPtr | parameters_callback_ |
| Callback handle for dynamic parameter reconfiguration. | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | marker_array_publisher_ |
| Publisher Marker Array. | |
| rclcpp::TimerBase::SharedPtr | timer_ |
| std::atomic< bool > | need_republish_ {false} |
| std::shared_ptr< Lanelet2MapInterface > | lanelet2_map_interface_ |
| lanelet::LaneletMapConstPtr | last_map_ptr_ |
| std::string | map_frame_id |
| rclcpp::Time | current_timestamp |
| double | left_bound_line_width_ = 0.1 |
| std::string | left_bound_color_hex_ = "#0000FF" |
| double | left_bound_line_opacity_ = 0.5 |
| double | right_bound_line_width_ = 0.1 |
| std::string | right_bound_color_hex_ = "#FF0000" |
| double | right_bound_line_opacity_ = 0.5 |
| double | centerline_line_width_ = 0.08 |
| std::string | centerline_color_hex_ = "#008000" |
| double | centerline_line_opacity_ = 0.4 |
| double | lanelet_text_scale_ = 0.5 |
| std::string | lanelet_text_color_hex_ = "#000000" |
| double | lanelet_text_opacity_ = 1.0 |
| double | reference_line_width_ = 0.2 |
| std::string | reference_line_color_hex_ = "#FFFF00" |
| double | reference_line_opacity_ = 0.5 |
| std::string | traffic_light_mesh_resource_ |
| double | traffic_light_scale_ = 1.0 |
| double | traffic_light_z_offset_ = 1.3 |
| double | traffic_light_opacity_ = 1.0 |
| std::string | yield_sign_mesh_resource_ |
| double | yield_sign_scale_ = 1.0 |
| double | yield_sign_z_offset_ = 0.0 |
| double | yield_sign_opacity_ = 1.0 |
Lanelet2LichtblickDisplay class.
Definition at line 34 of file lanelet2_lichtblick_display.hpp.
| lanelet2_lichtblick_display::Lanelet2LichtblickDisplay::Lanelet2LichtblickDisplay | ( | ) |
Creates the Lichtblick visualization node and declares its rendering parameters.
Definition at line 8 of file lanelet2_lichtblick_display.cpp.
|
private |
Creates and adds a LINE_STRIP marker to a marker array.
| marker_array_msg | The marker array message to which the new marker will be added. |
| current_marker_id | A reference to the marker ID counter, which will be incremented. |
| ns | The namespace for the marker, used for grouping in the visualization tool. |
| line_width | The width of the line in meters. |
| color_hex | The hexadecimal color string. |
| opacity | The opacity of the line. |
| header | The ROS header containing the frame ID and timestamp. |
| points | A vector of geometry_msgs::msg::Point objects defining the line segments. |
Definition at line 220 of file lanelet2_lichtblick_display.cpp.
|
staticprivate |
Creates and adds a MESH_RESOURCE marker for regulatory elements.
| marker_array_msg | The marker array message to which the new marker will be added. |
| current_marker_id | A reference to the marker ID counter, which will be incremented. |
| ns | The namespace for the marker. |
| mesh_resource | The URI of the 3D mesh model. |
| position | The base position of the mesh marker. |
| scale | The uniform scale factor for the mesh. |
| z_offset | A vertical offset to correctly position the mesh above the ground. |
| opacity | The opacity of the mesh marker. |
| header | The ROS header. |
| yaw_ref_line | The yaw of the reference line, used to calculate orthogonal orientation. |
| middle_point | The middle point of the reference line, used to determine orientation. |
Definition at line 254 of file lanelet2_lichtblick_display.cpp.
|
private |
Check for a new or changed Lanelet2 map and publish markers if present.
This function queries the Lanelet2MapInterface for the current map pointer and compares it against the internally stored last_map_ptr_. If a new map is detected (pointer change and non-null), it triggers publishMarker(...) to convert the map into visualization markers.
Called periodically by the node's timer.
Definition at line 335 of file lanelet2_lichtblick_display.cpp.
|
private |
Publishes a DELETEALL action to clear all markers from the topic.
Definition at line 208 of file lanelet2_lichtblick_display.cpp.
|
private |
Declares and loads a ROS parameter.
| name | name |
| param | parameter variable to load into |
| description | description |
| add_to_auto_reconfigurable_params | enable reconfiguration of parameter |
| is_required | whether failure to load parameter will stop node |
| read_only | set parameter to read-only |
| from_value | parameter range minimum |
| to_value | parameter range maximum |
| step_value | parameter range step |
| additional_constraints | additional constraints description |
Definition at line 63 of file lanelet2_lichtblick_display.cpp.
|
private |
Convert a hex color string into normalized RGB float components.
Accepted formats: "#RRGGBB", "0xRRGGBB", or "RRGGBB". If the input is invalid (wrong length or parse error), the function writes black (0,0,0) into r,g,b and logs a warning.
Definition at line 170 of file lanelet2_lichtblick_display.cpp.
|
private |
Handles reconfiguration when a parameter value is changed.
| parameters | parameters |
Definition at line 135 of file lanelet2_lichtblick_display.cpp.
|
private |
Converts a Lanelet2 map into a MarkerArray and publishes it.
This function iterates over lanelets in lanelet_map and creates markers for the various elements. The marker array is published on the marker_array_publisher_ which is configured with transient_local QoS so late joiners receive the last message.
| lanelet_map | lanelet map to visualize |
Definition at line 358 of file lanelet2_lichtblick_display.cpp.
|
staticprivate |
Extracts the sign/signal positions of a regulatory element.
Only the first point of referenced line strings is considered.
| [in] | regulatory_element | regulatory element |
Definition at line 321 of file lanelet2_lichtblick_display.cpp.
|
staticprivate |
Extracts the reference/effect line of a regulatory element.
Only the first reference line of the regulatory element is considered. Only the end points of that reference line are considered.
| [in] | regulatory_element | regulatory element |
Definition at line 306 of file lanelet2_lichtblick_display.cpp.
|
private |
Sets up subscribers, publishers, etc. to configure the node.
Definition at line 154 of file lanelet2_lichtblick_display.cpp.
|
staticprivate |
Converts an Eigen::Vector3d into a ROS geometry_msgs::msg::Point.
Simple helper to copy x, y, z components from Eigen to the ROS message.
| point | Eigen 3D point |
Definition at line 200 of file lanelet2_lichtblick_display.cpp.
|
private |
Auto-reconfigurable parameters for dynamic reconfiguration.
Definition at line 208 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 240 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 241 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 239 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 228 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 224 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 244 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 245 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 243 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 225 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 232 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 233 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 231 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 226 of file lanelet2_lichtblick_display.hpp.
|
private |
Publisher Marker Array.
Definition at line 218 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 222 of file lanelet2_lichtblick_display.hpp.
|
private |
Callback handle for dynamic parameter reconfiguration.
Definition at line 213 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 248 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 249 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 247 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 236 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 237 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 235 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 220 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 251 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 254 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 252 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 253 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 256 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 259 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 257 of file lanelet2_lichtblick_display.hpp.
|
private |
Definition at line 258 of file lanelet2_lichtblick_display.hpp.