From 5d69c19309a37e22b592f25c179913f79e16d3c5 Mon Sep 17 00:00:00 2001 From: TiaSinghania Date: Wed, 8 Jan 2025 23:25:40 -0800 Subject: [PATCH] added logging timestamps + other missing data --- rb_ws/src/buggy/buggy/serial/ros_to_bnyahaj.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rb_ws/src/buggy/buggy/serial/ros_to_bnyahaj.py b/rb_ws/src/buggy/buggy/serial/ros_to_bnyahaj.py index 34daa60..0525518 100644 --- a/rb_ws/src/buggy/buggy/serial/ros_to_bnyahaj.py +++ b/rb_ws/src/buggy/buggy/serial/ros_to_bnyahaj.py @@ -182,7 +182,7 @@ def reader_thread(self): self.tx12_state_publisher.publish(packet.tx12_state) self.stepper_alarm_publisher.publish(packet.stepper_alarm) self.rc_uplink_qual_publisher.publish(packet.rc_uplink_quality) - + self.get_logger().debug(f'NAND Debug Timestamp: {packet.timestamp}') elif isinstance(packet, NANDUKF): odom = Odometry() @@ -196,6 +196,8 @@ def reader_thread(self): odom.twist.twist.angular.z = packet.heading_rate self.nand_ukf_odom_publisher.publish(odom) + self.get_logger().debug(f'NAND UKF Timestamp: {packet.timestamp}') + elif isinstance(packet, NANDRawGPS): odom = Odometry() @@ -212,7 +214,10 @@ def reader_thread(self): self.nand_gps_acc_publisher.publish(packet.accuracy) self.nand_gps_seqnum_publisher.publish(packet.gps_seqnum) self.nand_gps_time_publisher.publish(packet.gps_time) + self.get_logger().debug(f'NAND Raw GPS Timestamp: {packet.timestamp}') + + # this packet is received on Short Circuit elif isinstance(packet, Radio): # Publish to odom topic x and y coord @@ -221,6 +226,9 @@ def reader_thread(self): odom.pose.pose.position.x = packet.nand_east_gps odom.pose.pose.position.y = packet.nand_north_gps self.observed_nand_odom_publisher.publish(odom) + self.get_logger().debug(f'Radio Received NAND GPS Seqnum: {packet.gps_seqnum}') + + elif isinstance(packet, SCDebugInfo): self.encoder_angle_publisher.publish(packet.encoder_angle) @@ -233,10 +241,14 @@ def reader_thread(self): self.tx12_state_publisher.publish(packet.tx12_state) self.stepper_alarm_publisher.publish(packet.stepper_alarm) self.rc_uplink_qual_publisher.publish(packet.rc_uplink_quality) + self.get_logger().debug(f'SC Debug Timestamp: {packet.timestamp}') + elif isinstance(packet, SCSensors): self.sc_velocity_publisher.publish(packet.velocity) self.sc_steering_angle_publisher.publish(packet.steering_angle) + self.get_logger().debug(f'SC Sensors Timestamp: {packet.timestamp}') + elif isinstance(packet, RoundtripTimestamp): self.roundtrip_time_publisher.publish(time.time() - packet.returned_time)