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.
|
Node which provies exposes map publication and carma_wm update logic. More...
#include <WMBroadcasterNode.hpp>
Public Member Functions | |
WMBroadcasterNode (const rclcpp::NodeOptions &options) | |
Constructor. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) |
void | publishMap (const autoware_lanelet2_msgs::msg::MapBin &map_msg) |
Callback to publish a map. More... | |
void | initializeWorker (std::weak_ptr< carma_ros2_utils::CarmaLifecycleNode > weak_node_pointer) |
Initializes the WMBroadcaster worker with reference to the CarmaLifecycleNode itself. More... | |
void | publishCtrlReq (const carma_v2x_msgs::msg::TrafficControlRequest &ctrlreq_msg) const |
Callback to publish TrafficControlRequest Messages. More... | |
void | publishMapUpdate (const autoware_lanelet2_msgs::msg::MapBin &geofence_msg) const |
Callback to publish map updates (geofences) More... | |
void | publishActiveGeofence (const carma_perception_msgs::msg::CheckActiveGeofence &active_geof_msg) |
Callback to publish active geofence information. More... | |
void | publishTCMACK (const carma_v2x_msgs::msg::MobilityOperation &mom_msg) |
Callback to publish traffic control acknowledgement information. More... | |
Private Member Functions | |
bool | spin_callback () |
Spin callback, which will be called frequently based on the configured spin rate. More... | |
Private Attributes | |
Config | config_ |
carma_ros2_utils::PubPtr< autoware_lanelet2_msgs::msg::MapBin > | map_pub_ |
carma_ros2_utils::PubPtr< autoware_lanelet2_msgs::msg::MapBin > | map_update_pub_ |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::TrafficControlRequest > | control_msg_pub_ |
carma_ros2_utils::PubPtr< visualization_msgs::msg::MarkerArray > | tcm_visualizer_pub_ |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::TrafficControlRequestPolygon > | tcr_visualizer_pub_ |
carma_ros2_utils::PubPtr< std_msgs::msg::Int32MultiArray > | upcoming_intersection_ids_pub_ |
carma_ros2_utils::PubPtr< carma_perception_msgs::msg::CheckActiveGeofence > | active_pub_ |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityOperation > | tcm_ack_pub_ |
carma_ros2_utils::SubPtr< autoware_lanelet2_msgs::msg::MapBin > | base_map_sub_ |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::Route > | route_callmsg_sub_ |
carma_ros2_utils::SubPtr< std_msgs::msg::String > | georef_sub_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::TrafficControlMessage > | geofence_sub_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MapData > | incoming_map_sub_ |
carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > | curr_location_sub_ |
rclcpp::TimerBase::SharedPtr | timer_ |
std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > | ptr_ |
std::unique_ptr< carma_wm_ctrl::WMBroadcaster > | wmb_ |
Node which provies exposes map publication and carma_wm update logic.
The WMBroadcasterNode handles updating the lanelet2 base map and publishing the new versions to the rest of the CARMA Platform ROS network. The broadcaster also provides functions for adding or removing geofences from the map and notifying the rest of the system.
Definition at line 45 of file WMBroadcasterNode.hpp.
|
explicit |
Constructor.
Definition at line 52 of file WMBroadcasterNode.cpp.
References carma_wm_ctrl::Config::ack_pub_times, config_, carma_wm_ctrl::Config::config_limit, carma_wm_ctrl::Config::max_lane_width, carma_wm_ctrl::Config::participant, carma_wm_ctrl::Config::traffic_control_request_period, and carma_wm_ctrl::Config::vehicle_id.
carma_ros2_utils::CallbackReturn carma_wm_ctrl::WMBroadcasterNode::handle_on_activate | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 153 of file WMBroadcasterNode.cpp.
References base_map_sub_, carma_wm_ctrl::WMBroadcaster::baseMapCallback(), config_, curr_location_sub_, carma_wm_ctrl::WMBroadcaster::currentLocationCallback(), carma_wm_ctrl::WMBroadcaster::externalMapMsgCallback(), geofence_sub_, carma_wm_ctrl::WMBroadcaster::geofenceCallback(), georef_sub_, carma_wm_ctrl::WMBroadcaster::geoReferenceCallback(), incoming_map_sub_, route_callmsg_sub_, carma_wm_ctrl::WMBroadcaster::routeCallbackMessage(), spin_callback(), timer_, carma_wm_ctrl::Config::traffic_control_request_period, and wmb_.
carma_ros2_utils::CallbackReturn carma_wm_ctrl::WMBroadcasterNode::handle_on_configure | ( | const rclcpp_lifecycle::State & | ) |
Definition at line 77 of file WMBroadcasterNode.cpp.
References carma_wm_ctrl::Config::ack_pub_times, active_pub_, config_, carma_wm_ctrl::Config::config_limit, control_msg_pub_, initializeWorker(), carma_wm_ctrl::Config::intersection_coord_correction, carma_wm_ctrl::Config::intersection_ids_for_correction, map_pub_, map_update_pub_, carma_wm_ctrl::Config::max_lane_width, carma_wm_ctrl::Config::participant, tcm_ack_pub_, tcm_visualizer_pub_, tcr_visualizer_pub_, carma_wm_ctrl::Config::traffic_control_request_period, upcoming_intersection_ids_pub_, carma_wm_ctrl::Config::vehicle_id, and wmb_.
void carma_wm_ctrl::WMBroadcasterNode::initializeWorker | ( | std::weak_ptr< carma_ros2_utils::CarmaLifecycleNode > | weak_node_pointer | ) |
Initializes the WMBroadcaster worker with reference to the CarmaLifecycleNode itself.
weak_ptr | to the node of type CarmaLifecycleNode that owns this worker |
Definition at line 69 of file WMBroadcasterNode.cpp.
References publishActiveGeofence(), publishCtrlReq(), publishMap(), publishMapUpdate(), publishTCMACK(), and wmb_.
Referenced by handle_on_configure().
void carma_wm_ctrl::WMBroadcasterNode::publishActiveGeofence | ( | const carma_perception_msgs::msg::CheckActiveGeofence & | active_geof_msg | ) |
Callback to publish active geofence information.
active_geof_msg | The geofence information to publish |
Definition at line 42 of file WMBroadcasterNode.cpp.
References active_pub_.
Referenced by initializeWorker().
void carma_wm_ctrl::WMBroadcasterNode::publishCtrlReq | ( | const carma_v2x_msgs::msg::TrafficControlRequest & | ctrlreq_msg | ) | const |
Callback to publish TrafficControlRequest Messages.
route_msg | The TrafficControlRequest message to publish |
Definition at line 37 of file WMBroadcasterNode.cpp.
References control_msg_pub_.
Referenced by initializeWorker().
void carma_wm_ctrl::WMBroadcasterNode::publishMap | ( | const autoware_lanelet2_msgs::msg::MapBin & | map_msg | ) |
Callback to publish a map.
map_msg | The map message to publish |
Definition at line 27 of file WMBroadcasterNode.cpp.
References map_pub_.
Referenced by initializeWorker().
void carma_wm_ctrl::WMBroadcasterNode::publishMapUpdate | ( | const autoware_lanelet2_msgs::msg::MapBin & | geofence_msg | ) | const |
Callback to publish map updates (geofences)
geofence_msg | The geofence message to publish |
Definition at line 32 of file WMBroadcasterNode.cpp.
References map_update_pub_.
Referenced by initializeWorker().
void carma_wm_ctrl::WMBroadcasterNode::publishTCMACK | ( | const carma_v2x_msgs::msg::MobilityOperation & | mom_msg | ) |
Callback to publish traffic control acknowledgement information.
mom_msg | The acknowledgement information to publish |
Definition at line 47 of file WMBroadcasterNode.cpp.
References tcm_ack_pub_.
Referenced by initializeWorker().
|
private |
Spin callback, which will be called frequently based on the configured spin rate.
Definition at line 191 of file WMBroadcasterNode.cpp.
References tcm_visualizer_pub_, tcr_visualizer_pub_, upcoming_intersection_ids_pub_, and wmb_.
Referenced by handle_on_activate().
|
private |
Definition at line 117 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and publishActiveGeofence().
|
private |
Definition at line 120 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 109 of file WMBroadcasterNode.hpp.
Referenced by WMBroadcasterNode(), handle_on_activate(), and handle_on_configure().
|
private |
Definition at line 113 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and publishCtrlReq().
|
private |
Definition at line 125 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 123 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 122 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 124 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 111 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and publishMap().
|
private |
Definition at line 112 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and publishMapUpdate().
|
private |
Definition at line 130 of file WMBroadcasterNode.hpp.
|
private |
Definition at line 121 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 118 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and publishTCMACK().
|
private |
Definition at line 114 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and spin_callback().
|
private |
Definition at line 115 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and spin_callback().
|
private |
Definition at line 128 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 116 of file WMBroadcasterNode.hpp.
Referenced by handle_on_configure(), and spin_callback().
|
private |
Definition at line 131 of file WMBroadcasterNode.hpp.
Referenced by handle_on_activate(), handle_on_configure(), initializeWorker(), and spin_callback().