13#include <tf2/LinearMath/Quaternion.h>
14#include <rclcpp/rclcpp.hpp>
15#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
17#include "geometry_msgs/msg/point.hpp"
18#include "visualization_msgs/msg/marker_array.hpp"
26template <
typename T,
typename A>
27struct is_vector<std::vector<T, A>> : std::true_type {};
59 const std::string& description,
60 const bool add_to_auto_reconfigurable_params =
true,
61 const bool is_required =
false,
62 const bool read_only =
false,
63 const std::optional<double>& from_value = std::nullopt,
64 const std::optional<double>& to_value = std::nullopt,
65 const std::optional<double>& step_value = std::nullopt,
66 const std::string& additional_constraints =
"");
74 rcl_interfaces::msg::SetParametersResult
parametersCallback(
const std::vector<rclcpp::Parameter>& parameters);
99 void hexToRgb(
const std::string& hex,
float& r,
float& g,
float& b);
110 void publishMarker(
const lanelet::LaneletMapConstPtr& lanelet_map);
120 static geometry_msgs::msg::Point
toRos(
const Eigen::Vector3d& point);
145 int& current_marker_id,
146 const std::string& ns,
148 const std::string& color_hex,
150 const std_msgs::msg::Header& header,
151 const std::vector<geometry_msgs::msg::Point>& points);
170 static void addMeshMarker(visualization_msgs::msg::MarkerArray& marker_array_msg,
171 int& current_marker_id,
172 const std::string& ns,
173 const std::string& mesh_resource,
174 const geometry_msgs::msg::Point& position,
178 const std_msgs::msg::Header& header,
180 const geometry_msgs::msg::Point& middle_point);
192 const std::shared_ptr<const lanelet::RegulatoryElement>& regulatory_element);
203 const std::shared_ptr<const lanelet::RegulatoryElement>& regulatory_element);
Lanelet2LichtblickDisplay class.
double traffic_light_scale_
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.
double left_bound_line_width_
double yield_sign_opacity_
std::string centerline_color_hex_
void checkMapStatus()
Check for a new or changed Lanelet2 map and publish markers if present.
std::string lanelet_text_color_hex_
static geometry_msgs::msg::Point toRos(const Eigen::Vector3d &point)
Converts an Eigen::Vector3d into a ROS geometry_msgs::msg::Point.
void hexToRgb(const std::string &hex, float &r, float &g, float &b)
Convert a hex color string into normalized RGB float components.
void clearAllMarkers()
Publishes a DELETEALL action to clear all markers from the topic.
void publishMarker(const lanelet::LaneletMapConstPtr &lanelet_map)
Converts a Lanelet2 map into a MarkerArray and publishes it.
std::string yield_sign_mesh_resource_
double yield_sign_z_offset_
Lanelet2LichtblickDisplay()
Creates the Lichtblick visualization node and declares its rendering parameters.
double reference_line_width_
double traffic_light_opacity_
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.
double traffic_light_z_offset_
std::shared_ptr< Lanelet2MapInterface > lanelet2_map_interface_
OnSetParametersCallbackHandle::SharedPtr parameters_callback_
Callback handle for dynamic parameter reconfiguration.
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.
rclcpp::TimerBase::SharedPtr timer_
std::string left_bound_color_hex_
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.
double centerline_line_width_
double reference_line_opacity_
std::atomic< bool > need_republish_
lanelet::LaneletMapConstPtr last_map_ptr_
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.
double lanelet_text_opacity_
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.
double right_bound_line_opacity_
double right_bound_line_width_
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr marker_array_publisher_
Publisher Marker Array.
std::string reference_line_color_hex_
rclcpp::Time current_timestamp
std::string traffic_light_mesh_resource_
std::string right_bound_color_hex_
double left_bound_line_opacity_
double lanelet_text_scale_
double centerline_line_opacity_
std::vector< std::tuple< std::string, std::function< void(const rclcpp::Parameter &)> > > auto_reconfigurable_params_
Auto-reconfigurable parameters for dynamic reconfiguration.
constexpr bool is_vector_v