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.
bounding_box_to_detected_object::Node Class Reference

#include <bounding_box_to_detected_object_node.h>

Inheritance diagram for bounding_box_to_detected_object::Node:
Inheritance graph
Collaboration diagram for bounding_box_to_detected_object::Node:
Collaboration graph

Public Member Functions

 Node (const rclcpp::NodeOptions &)
 
void bbox_callback (autoware_auto_msgs::msg::BoundingBoxArray::UniquePtr msg)
 Callback for bounding box data to be converted. Publishes a DetectedObjects message from the bounding box array. More...
 
carma_ros2_utils::CallbackReturn handle_on_configure (const rclcpp_lifecycle::State &)
 

Private Attributes

carma_ros2_utils::SubPtr< autoware_auto_msgs::msg::BoundingBoxArray > bbox_sub_
 
carma_ros2_utils::PubPtr< autoware_auto_msgs::msg::DetectedObjects > object_pub_
 

Detailed Description

Definition at line 28 of file bounding_box_to_detected_object_node.h.

Constructor & Destructor Documentation

◆ Node()

bounding_box_to_detected_object::Node::Node ( const rclcpp::NodeOptions &  options)
explicit

Definition at line 25 of file bounding_box_to_detected_object_node.cpp.

26 : carma_ros2_utils::CarmaLifecycleNode(options)
27 {
28 }

Member Function Documentation

◆ bbox_callback()

void bounding_box_to_detected_object::Node::bbox_callback ( autoware_auto_msgs::msg::BoundingBoxArray::UniquePtr  msg)

Callback for bounding box data to be converted. Publishes a DetectedObjects message from the bounding box array.

Parameters
msgThe message to convert and republish

Definition at line 60 of file bounding_box_to_detected_object_node.cpp.

60 {
61 autoware_auto_msgs::msg::DetectedObjects objects;
62
63 objects.header = msg->header;
64 objects.objects.reserve(msg->boxes.size());
65
66 for (const auto& bb : msg->boxes) {
67 objects.objects.emplace_back(detected_obj_from_bounding_box(bb));
68 }
69
70 object_pub_->publish(objects);
71
72 }
carma_ros2_utils::PubPtr< autoware_auto_msgs::msg::DetectedObjects > object_pub_
autoware_auto_msgs::msg::DetectedObject detected_obj_from_bounding_box(const autoware_auto_msgs::msg::BoundingBox &box)

References bounding_box_to_detected_object::detected_obj_from_bounding_box(), and object_pub_.

Referenced by handle_on_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_on_configure()

carma_ros2_utils::CallbackReturn bounding_box_to_detected_object::Node::handle_on_configure ( const rclcpp_lifecycle::State &  )

Definition at line 30 of file bounding_box_to_detected_object_node.cpp.

30 {
31
32 // Setup pub/sub
33 bbox_sub_= create_subscription<autoware_auto_msgs::msg::BoundingBoxArray>("bounding_boxes",10,
34 std::bind(&Node::bbox_callback, this, _1)
35 );
36
37 object_pub_= create_publisher<autoware_auto_msgs::msg::DetectedObjects>("lidar_detected_objects", 10);
38
39 return CallbackReturn::SUCCESS;
40 }
void bbox_callback(autoware_auto_msgs::msg::BoundingBoxArray::UniquePtr msg)
Callback for bounding box data to be converted. Publishes a DetectedObjects message from the bounding...
carma_ros2_utils::SubPtr< autoware_auto_msgs::msg::BoundingBoxArray > bbox_sub_

References bbox_callback(), bbox_sub_, and object_pub_.

Here is the call graph for this function:

Member Data Documentation

◆ bbox_sub_

carma_ros2_utils::SubPtr<autoware_auto_msgs::msg::BoundingBoxArray> bounding_box_to_detected_object::Node::bbox_sub_
private

Definition at line 34 of file bounding_box_to_detected_object_node.h.

Referenced by handle_on_configure().

◆ object_pub_

carma_ros2_utils::PubPtr<autoware_auto_msgs::msg::DetectedObjects> bounding_box_to_detected_object::Node::object_pub_
private

Definition at line 37 of file bounding_box_to_detected_object_node.h.

Referenced by bbox_callback(), and handle_on_configure().


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