24 current_time = msg.header.stamp.sec + msg.header.stamp.nanosec * 1e-9
37 marker.header.frame_id =
"map"
38 marker.header.stamp = self.get_clock().now().to_msg()
39 marker.ns =
"location"
41 marker.type = Marker.CYLINDER
42 marker.action = Marker.ADD
43 marker.pose.position.x = self.
x
44 marker.pose.position.y = self.
y
45 marker.pose.position.z = 0.0
46 marker.pose.orientation.x = 0.0
47 marker.pose.orientation.y = 0.0
48 marker.pose.orientation.z = math.sin(self.
orientation / 2.0)
49 marker.pose.orientation.w = math.cos(self.
orientation / 2.0)
58 self.get_logger().info(f
'Current position: x={self.x:.4f}, y={self.y:.4f}, orientation={self.orientation:.4f}')