From aa4f44dbcded7272398d528768de0b96aa3a3612 Mon Sep 17 00:00:00 2001 From: carter Date: Tue, 29 Oct 2024 10:18:16 -0600 Subject: [PATCH] Ignore request_type and response_type in header parsing --- CHANGELOG.md | 1 + roslibrust/src/ros1/tcpros.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9f0fe..aeac997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Generated code now includes various lint attributes to suppress warnings. +- TCPROS header parsing now ignores (the undocumented fields) response_type and request_type and doesn't produce warnings on them. ### Changed diff --git a/roslibrust/src/ros1/tcpros.rs b/roslibrust/src/ros1/tcpros.rs index 6307760..e78d897 100644 --- a/roslibrust/src/ros1/tcpros.rs +++ b/roslibrust/src/ros1/tcpros.rs @@ -86,6 +86,10 @@ impl ConnectionHeader { // for the purpose of discovering the service type // If you do `rosservice call /my_service` and hit TAB you'll see this field in the connection header // we can ignore it + } else if field.starts_with("response_type=") || field.starts_with("request_type=") { + // More undocumented fields! + // Discovered in testing that some roscpp service servers will set these on service responses + // We can ignore em } else if field.starts_with("error=") { log::error!("Error reported in TCPROS connection header: {field}, full header: {header_data:#?}"); } else {