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.
|
This node provides RViz visualization messages for recieved ExternalObject and RoadwayObstacle messages in carma-platform. More...
#include <object_visualizer_node.hpp>
Public Member Functions | |
Node (const rclcpp::NodeOptions &) | |
Node constructor. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Example callback for dynamic parameter updates. More... | |
void | external_objects_callback (carma_perception_msgs::msg::ExternalObjectList::UniquePtr msg) |
External objects callback. Converts the message to a visualization message to republish. More... | |
void | roadway_obstacles_callback (carma_perception_msgs::msg::RoadwayObstacleList::UniquePtr msg) |
Roadway obstacles callback. Converts the message to a visualization message to republish. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) |
Private Member Functions | |
void | clear_and_update_old_objects (visualization_msgs::msg::MarkerArray &viz_msg, size_t &old_size) |
Adds a marker deletion for a number of markers which is the delta between the new marker count and the previously published count. More... | |
Private Attributes | |
carma_ros2_utils::SubPtr< carma_perception_msgs::msg::ExternalObjectList > | external_objects_sub_ |
carma_ros2_utils::SubPtr< carma_perception_msgs::msg::RoadwayObstacleList > | roadway_obstacles_sub_ |
carma_ros2_utils::PubPtr< visualization_msgs::msg::MarkerArray > | external_objects_viz_pub_ |
carma_ros2_utils::PubPtr< visualization_msgs::msg::MarkerArray > | roadway_obstacles_viz_pub_ |
Config | config_ |
size_t | prev_external_objects_size_ = 0 |
size_t | prev_roadway_obstacles_size_ = 0 |
This node provides RViz visualization messages for recieved ExternalObject and RoadwayObstacle messages in carma-platform.
Definition at line 36 of file object_visualizer_node.hpp.
|
explicit |
Node constructor.
Definition at line 22 of file object_visualizer_node.cpp.
References config_, object_visualizer::Config::enable_external_objects_viz, object_visualizer::Config::enable_roadway_objects_viz, object_visualizer::Config::external_objects_viz_ns, object_visualizer::Config::marker_shape, and object_visualizer::Config::roadway_obstacles_viz_ns.
|
private |
Adds a marker deletion for a number of markers which is the delta between the new marker count and the previously published count.
ASSUMPTION: The marker array's ids are already recomputed starting from zero, such that tracking ids is not needed.
[in/out] | viz_msg The marker array to add deletion markers to |
[in/out] | old_size The size of the previous published marker array. The positive delta between this and the size of the viz_msg determines the number of deletions added |
Definition at line 166 of file object_visualizer_node.cpp.
References process_bag::i.
Referenced by external_objects_callback(), and roadway_obstacles_callback().
void object_visualizer::Node::external_objects_callback | ( | carma_perception_msgs::msg::ExternalObjectList::UniquePtr | msg | ) |
External objects callback. Converts the message to a visualization message to republish.
msg | The received message |
Definition at line 94 of file object_visualizer_node.cpp.
References clear_and_update_old_objects(), config_, object_visualizer::Config::enable_external_objects_viz, object_visualizer::Config::external_objects_viz_ns, external_objects_viz_pub_, object_visualizer::Config::marker_shape, prev_external_objects_size_, and carma_cooperative_perception::to_string().
Referenced by handle_on_configure().
carma_ros2_utils::CallbackReturn object_visualizer::Node::handle_on_configure | ( | const rclcpp_lifecycle::State & | ) |
Definition at line 64 of file object_visualizer_node.cpp.
References config_, object_visualizer::Config::enable_external_objects_viz, object_visualizer::Config::enable_roadway_objects_viz, external_objects_callback(), external_objects_sub_, object_visualizer::Config::external_objects_viz_ns, external_objects_viz_pub_, object_visualizer::Config::marker_shape, parameter_update_callback(), roadway_obstacles_callback(), roadway_obstacles_sub_, object_visualizer::Config::roadway_obstacles_viz_ns, and roadway_obstacles_viz_pub_.
rcl_interfaces::msg::SetParametersResult object_visualizer::Node::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Example callback for dynamic parameter updates.
Definition at line 37 of file object_visualizer_node.cpp.
References config_, object_visualizer::Config::enable_external_objects_viz, object_visualizer::Config::enable_roadway_objects_viz, object_visualizer::Config::external_objects_viz_ns, object_visualizer::Config::marker_shape, and object_visualizer::Config::roadway_obstacles_viz_ns.
Referenced by handle_on_configure().
void object_visualizer::Node::roadway_obstacles_callback | ( | carma_perception_msgs::msg::RoadwayObstacleList::UniquePtr | msg | ) |
Roadway obstacles callback. Converts the message to a visualization message to republish.
msg | The received message |
Definition at line 185 of file object_visualizer_node.cpp.
References clear_and_update_old_objects(), config_, object_visualizer::Config::enable_roadway_objects_viz, prev_roadway_obstacles_size_, object_visualizer::Config::roadway_obstacles_viz_ns, and roadway_obstacles_viz_pub_.
Referenced by handle_on_configure().
|
private |
Definition at line 49 of file object_visualizer_node.hpp.
Referenced by Node(), external_objects_callback(), handle_on_configure(), parameter_update_callback(), and roadway_obstacles_callback().
|
private |
Definition at line 41 of file object_visualizer_node.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 45 of file object_visualizer_node.hpp.
Referenced by external_objects_callback(), and handle_on_configure().
|
private |
Definition at line 52 of file object_visualizer_node.hpp.
Referenced by external_objects_callback().
|
private |
Definition at line 53 of file object_visualizer_node.hpp.
Referenced by roadway_obstacles_callback().
|
private |
Definition at line 42 of file object_visualizer_node.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 46 of file object_visualizer_node.hpp.
Referenced by handle_on_configure(), and roadway_obstacles_callback().