diff --git a/radio/ateam_radio_bridge/src/radio_bridge_node.cpp b/radio/ateam_radio_bridge/src/radio_bridge_node.cpp index bf730242..256d8d01 100644 --- a/radio/ateam_radio_bridge/src/radio_bridge_node.cpp +++ b/radio/ateam_radio_bridge/src/radio_bridge_node.cpp @@ -419,22 +419,19 @@ class RadioBridgeNode : public rclcpp::Node HelloRequest hello_data = std::get(data_variant); - // Commented out until firmware implements git hash populating - - // const uint32_t incoming_coms_hash = hello_data.coms_hash[0] | (hello_data.coms_hash[1] << 8) | - // (hello_data.coms_hash[2] << 16) | (hello_data.coms_hash[3] << 24); - // if (incoming_coms_hash != ateam_radio_msgs::kComsHash) { - // RCLCPP_WARN(get_logger(), "Ignoring discovery packet. Packet version hash mismatch."); - // return; - // } - - // if (ateam_radio_msgs::kComsDirty) { - // RCLCPP_WARN(get_logger(), "Local packet version is dirty. Compatibility check may be unreliable."); - // } - - // if (hello_data.coms_repo_dirty) { - // RCLCPP_WARN(get_logger(), "Remote robot's packet version is dirty. Compatibility check may be unreliable."); - // } + const uint32_t incoming_coms_hash = hello_data.coms_hash[0] << 24 | hello_data.coms_hash[1] << 16 | hello_data.coms_hash[2] << 8 | hello_data.coms_hash[3]; + if (incoming_coms_hash != ateam_radio_msgs::kComsHash) { + RCLCPP_WARN(get_logger(), "Ignoring discovery packet. Packet version hash mismatch. Robot: %x Local: %x", incoming_coms_hash, ateam_radio_msgs::kComsHash); + return; + } + + if (ateam_radio_msgs::kComsDirty) { + RCLCPP_WARN(get_logger(), "Local packet version is dirty. Compatibility check may be unreliable."); + } + + if (hello_data.coms_repo_dirty) { + RCLCPP_WARN(get_logger(), "Remote robot's packet version is dirty. Compatibility check may be unreliable."); + } if (!(game_controller_listener_.GetTeamColor() == ateam_common::TeamColor::Blue && hello_data.color == TC_BLUE) && diff --git a/radio/ateam_radio_bridge/test/launch_tests/bridge_command_test.py b/radio/ateam_radio_bridge/test/launch_tests/bridge_command_test.py index ef3760d0..069d6001 100644 --- a/radio/ateam_radio_bridge/test/launch_tests/bridge_command_test.py +++ b/radio/ateam_radio_bridge/test/launch_tests/bridge_command_test.py @@ -107,6 +107,7 @@ def test_2_vision_updates(self): vis_msg.pose.orientation.y = 0.0 vis_msg.pose.orientation.z = 0.707 vis_msg.pose.orientation.w = 0.707 + vis_msg.visible = True self.vis_pub.publish(vis_msg) timeout = time.time() + 1 @@ -118,10 +119,12 @@ def test_2_vision_updates(self): self.vis_pub.publish(vis_msg) last_packet = self.robot.getLastCmdMessage() if len(last_packet) != 64: + print(f'unexpected packet length: {len(last_packet)}') continue # Extract vision updates vision_update_flag = struct.unpack("