Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
carma_cooperative_perception::DetectionListVizNode Class Reference

#include <detection_list_viz_component.hpp>

Inheritance diagram for carma_cooperative_perception::DetectionListVizNode:
Inheritance graph
Collaboration diagram for carma_cooperative_perception::DetectionListVizNode:
Collaboration graph

Public Member Functions

 DetectionListVizNode (const rclcpp::NodeOptions &options)
 

Private Attributes

rclcpp::Subscription< carma_cooperative_perception_interfaces::msg::DetectionList >::SharedPtr detection_list_sub_ {nullptr}
 
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr marker_pub_ {nullptr}
 

Detailed Description

Definition at line 24 of file detection_list_viz_component.hpp.

Constructor & Destructor Documentation

◆ DetectionListVizNode()

carma_cooperative_perception::DetectionListVizNode::DetectionListVizNode ( const rclcpp::NodeOptions &  options)
explicit

Definition at line 22 of file detection_list_viz_component.cpp.

23: Node("detection_list_viz_node", options)
24{
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;
30
31 for (const auto detection : msg_ptr->detections) {
32 visualization_msgs::msg::Marker marker;
33
34 marker.header = detection.header;
35 marker.ns = detection.id;
36 marker.type = marker.CUBE;
37 marker.action = marker.MODIFY; // equivalent to ADD if marker does not exist
38 marker.pose = detection.pose.pose;
39 marker.scale.x = 2.0;
40 marker.scale.y = 2.0;
41 marker.scale.z = 2.0;
42
43 markers.markers.push_back(marker);
44 }
45
46 marker_pub_->publish(markers);
47 });
48
49 marker_pub_ = create_publisher<visualization_msgs::msg::MarkerArray>("output/markers", 1);
50}
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr marker_pub_
rclcpp::Subscription< carma_cooperative_perception_interfaces::msg::DetectionList >::SharedPtr detection_list_sub_

References detection_list_sub_, and marker_pub_.

Member Data Documentation

◆ detection_list_sub_

rclcpp::Subscription<carma_cooperative_perception_interfaces::msg::DetectionList>::SharedPtr carma_cooperative_perception::DetectionListVizNode::detection_list_sub_ {nullptr}
private

Definition at line 31 of file detection_list_viz_component.hpp.

Referenced by DetectionListVizNode().

◆ marker_pub_

rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr carma_cooperative_perception::DetectionListVizNode::marker_pub_ {nullptr}
private

Definition at line 33 of file detection_list_viz_component.hpp.

Referenced by DetectionListVizNode().


The documentation for this class was generated from the following files: