17#include <rclcpp_components/register_node_macro.hpp>
23: Node(
"detection_list_viz_node", options)
26 create_subscription<carma_cooperative_perception_interfaces::msg::DetectionList>(
27 "input/detections_lists", 1,
28 [
this](carma_cooperative_perception_interfaces::msg::DetectionList::ConstSharedPtr msg_ptr) {
29 visualization_msgs::msg::MarkerArray markers;
31 for (
const auto detection : msg_ptr->detections) {
32 visualization_msgs::msg::Marker marker;
34 marker.header = detection.header;
35 marker.ns = detection.id;
36 marker.type = marker.CUBE;
37 marker.action = marker.MODIFY;
38 marker.pose = detection.pose.pose;
43 markers.markers.push_back(marker);
49 marker_pub_ = create_publisher<visualization_msgs::msg::MarkerArray>(
"output/markers", 1);
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr marker_pub_
rclcpp::Subscription< carma_cooperative_perception_interfaces::msg::DetectionList >::SharedPtr detection_list_sub_
DetectionListVizNode(const rclcpp::NodeOptions &options)