From 52cd5d99746c52af91efe5c7cb19d6d74b1a9865 Mon Sep 17 00:00:00 2001 From: carter Date: Mon, 6 Jan 2025 14:51:12 -0700 Subject: [PATCH] Continuing to reorg and cleanup, reducing internal message generation --- Cargo.lock | 3 +-- roslibrust_ros1/Cargo.toml | 7 ++----- roslibrust_ros1/src/publisher.rs | 2 +- roslibrust_ros1/tests/ros1_xmlrpc.rs | 2 +- roslibrust_rosapi/src/lib.rs | 2 +- roslibrust_rosbridge/src/integration_tests.rs | 10 ++-------- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c994c3a..dc8e9a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2654,10 +2654,9 @@ dependencies = [ "log", "regex", "reqwest", - "roslibrust_codegen", - "roslibrust_codegen_macro", "roslibrust_common", "roslibrust_serde_rosmsg", + "roslibrust_test", "serde", "serde_xmlrpc", "test-log", diff --git a/roslibrust_ros1/Cargo.toml b/roslibrust_ros1/Cargo.toml index defcc53..445690e 100644 --- a/roslibrust_ros1/Cargo.toml +++ b/roslibrust_ros1/Cargo.toml @@ -29,11 +29,8 @@ thiserror = "2.0" anyhow = "1.0" [dev-dependencies] -# Used to provide message types for the examples -# TODO generate a roslibrust_std_msgs crate we can depend on instead of this -roslibrust_codegen_macro = { path = "../roslibrust_codegen_macro" } -# Relied on by generate types in the macro this should be cleaned up -roslibrust_codegen = { path = "../roslibrust_codegen" } +# Used for message definitions in tests +roslibrust_test = { path = "../roslibrust_test" } [features] # Used for enabling tests that rely on a running ros1 master diff --git a/roslibrust_ros1/src/publisher.rs b/roslibrust_ros1/src/publisher.rs index 1f35af2..8657087 100644 --- a/roslibrust_ros1/src/publisher.rs +++ b/roslibrust_ros1/src/publisher.rs @@ -16,7 +16,7 @@ use tokio::{ use super::actor::NodeServerHandle; -/// The regular Publisher representation returned by calling advertise on a [crate::ros1::NodeHandle]. +/// The regular Publisher representation returned by calling advertise on a [crate::NodeHandle]. pub struct Publisher { // Name of the topic this publisher is publishing on topic_name: String, diff --git a/roslibrust_ros1/tests/ros1_xmlrpc.rs b/roslibrust_ros1/tests/ros1_xmlrpc.rs index 56ca47c..606b776 100644 --- a/roslibrust_ros1/tests/ros1_xmlrpc.rs +++ b/roslibrust_ros1/tests/ros1_xmlrpc.rs @@ -2,9 +2,9 @@ mod tests { use roslibrust_common::RosMessageType; use roslibrust_ros1::NodeHandle; + use roslibrust_test::ros1::*; use serde::de::DeserializeOwned; use serde_xmlrpc::Value; - roslibrust_codegen_macro::find_and_generate_ros_messages!("assets/ros1_common_interfaces"); async fn call_node_api_raw(uri: &str, endpoint: &str, args: Vec) -> String { let client = reqwest::Client::new(); diff --git a/roslibrust_rosapi/src/lib.rs b/roslibrust_rosapi/src/lib.rs index ee85512..4aaec40 100644 --- a/roslibrust_rosapi/src/lib.rs +++ b/roslibrust_rosapi/src/lib.rs @@ -391,7 +391,7 @@ impl RosApi for T { #[cfg(feature = "ros1_test")] mod test { use super::RosApi; - use roslibrust_rosbridge::{ClientHandle, ClientHandleOptions}; + use roslibrust::rosbridge::{ClientHandle, ClientHandleOptions}; async fn fixture_client() -> ClientHandle { // Tiny sleep to throttle rate at which tests are run to try to make CI more consistent diff --git a/roslibrust_rosbridge/src/integration_tests.rs b/roslibrust_rosbridge/src/integration_tests.rs index 761cc59..75f6a19 100644 --- a/roslibrust_rosbridge/src/integration_tests.rs +++ b/roslibrust_rosbridge/src/integration_tests.rs @@ -20,16 +20,10 @@ mod integration_tests { const LOCAL_WS: &str = "ws://localhost:9090"; #[cfg(feature = "ros1_test")] - roslibrust_codegen_macro::find_and_generate_ros_messages!( - "assets/ros1_common_interfaces/ros_comm_msgs", - "assets/ros1_common_interfaces/std_msgs", - ); + use roslibrust_test::ros1::*; #[cfg(feature = "ros2_test")] - roslibrust_codegen_macro::find_and_generate_ros_messages!( - "assets/ros2_common_interfaces/std_msgs", - "assets/ros2_common_interfaces/std_srvs" - ); + use roslibrust_test::ros2::*; // This replaces the fact that Time.msg is no longer in std_msgs in ROS2 #[cfg(feature = "ros2_test")] use roslibrust_codegen::integral_types::Time;