4from sensor_msgs.msg
import PointCloud2
6from custom_interfaces.msg
import ConeArray
7from visualization_msgs.msg
import MarkerArray
13 """Adapater class to manage the use of the vehicle."""
17 Initializes the VehicleAdapter class.
19 node (rclpy.node.Node): The ROS2 node object.
26 self.node.state_ground_truth_subscription_ = self.node.create_subscription(
33 self.node.g_truth_subscription_ = self.node.create_subscription(
44 self.node.perception_subscription_,
52 self.node.state_estimation_ = self.node.create_subscription(
54 "/state_estimation/map",
61 Callback function for state estimation data.
64 map (ConeArray): The state estimation output received.
67 map_treated: np.ndarray = format_cone_array_msg(map)
70 groundtruth_map_treated: np.ndarray = format_marker_array_msg(
74 self.node.get_logger().warn(
75 "State ground truth is not set yet. Skipping processing."
77 groundtruth_map_treated = np.array([])
78 self.node.compute_and_publish_state_map(
80 groundtruth_map_treated,
85 Callback function for perception data.
87 perception (ConeArray): The perception output received.
92 perception_output: np.ndarray = format_cone_array_msg(perception)
93 self.node.compute_and_publish_perception(perception_output, self.
_g_truth)
97 Callback function for ground truth data.
99 g_truth (MarkerArray): The ground truth marker array.
105 self.
_g_truth = format_marker_array_msg(g_truth)
109 Callback function to process ground truth map messages.
112 state_ground_truth (MarkerArray): Ground truth map data.
Class for subscribing to a point cloud topic and synchronizing messages with a ROS2 node.
state_estimation_callback(self, ConeArray map)
state_estimation_callback
g_truth_callback(self, MarkerArray g_truth)
__init__(self, rclpy.node.Node node)
state_ground_truth_callback(self, MarkerArray state_ground_truth)
Callback function to process ground truth map messages.
state_ground_truth_callback
perception_callback(self, ConeArray perception)