diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 632aabb..482a99d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,45 +63,45 @@ jobs: - name: Run tests run: cargo test --verbose - system_tests_with_ros2_humble: - name: System tests with ROS 2 Humble - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - steps: - - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: humble - - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Install ACL - run: sudo apt-get -y install libacl1-dev - - - name: Run ROS tests (enable feature ros_test) - shell: bash - run: "source /opt/ros/humble/setup.bash && cargo test --features ros_test --verbose" - - system_tests_with_ros2_jazzy: - name: System tests with ROS 2 Jazzy - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest - steps: - - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: jazzy - - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Install ACL - run: sudo apt-get -y install libacl1-dev - - - name: Run ROS tests (enable feature ros_test) - shell: bash - run: "source /opt/ros/jazzy/setup.bash && cargo test --features ros_test --verbose" + # system_tests_with_ros2_humble: + # name: System tests with ROS 2 Humble + # runs-on: ubuntu-latest + # container: + # image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + # steps: + # - uses: ros-tooling/setup-ros@v0.7 + # with: + # required-ros-distributions: humble + + # - uses: actions/checkout@v4 + # - uses: actions-rust-lang/setup-rust-toolchain@v1 + + # - name: Install ACL + # run: sudo apt-get -y install libacl1-dev + + # - name: Run ROS tests (enable feature ros_test) + # shell: bash + # run: "source /opt/ros/humble/setup.bash && cargo test --features ros_test --verbose" + + # system_tests_with_ros2_jazzy: + # name: System tests with ROS 2 Jazzy + # runs-on: ubuntu-latest + # container: + # image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest + # steps: + # - uses: ros-tooling/setup-ros@v0.7 + # with: + # required-ros-distributions: jazzy + + # - uses: actions/checkout@v4 + # - uses: actions-rust-lang/setup-rust-toolchain@v1 + + # - name: Install ACL + # run: sudo apt-get -y install libacl1-dev + + # - name: Run ROS tests (enable feature ros_test) + # shell: bash + # run: "source /opt/ros/jazzy/setup.bash && cargo test --features ros_test --verbose" # NOTE: In GitHub repository settings, the "Require status checks to pass # before merging" branch protection rule ensures that commits are only merged diff --git a/Cargo.lock b/Cargo.lock index 8207895..e243313 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -570,28 +570,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" -dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex", - "syn 1.0.109", - "which", -] - [[package]] name = "bindgen" version = "0.69.5" @@ -978,25 +956,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -1049,7 +1008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e085999238629d13a7a19e4dc7a6e61505bcb2033f6a1bed24bff35035c47c4" dependencies = [ "bincode", - "bindgen 0.69.5", + "bindgen", "cmake", "derivative", "libc", @@ -1299,12 +1258,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "force-send-sync" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32688dcc448aa684426ecc398f9af78c55b0769515ccd12baa565daf6f32feb6" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2227,15 +2180,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" -dependencies = [ - "memchr", -] - [[package]] name = "outref" version = "0.5.1" @@ -2283,12 +2227,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -2643,99 +2581,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "r2r" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f7b62c21b28403706844629ce89de2869677d83f33bdef615b32de56f0b5a0" -dependencies = [ - "force-send-sync", - "futures", - "indexmap", - "lazy_static", - "log", - "phf", - "prettyplease", - "proc-macro2", - "quote", - "r2r_actions", - "r2r_common", - "r2r_macros", - "r2r_msg_gen", - "r2r_rcl", - "rayon", - "serde", - "serde_json", - "syn 2.0.77", - "thiserror", - "uuid", -] - -[[package]] -name = "r2r_actions" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4e672304c3e50c75f39b8c97f97b87f7aef89fc43091071d7c9ab2a2ecf057" -dependencies = [ - "bindgen 0.63.0", - "r2r_common", - "r2r_msg_gen", - "r2r_rcl", -] - -[[package]] -name = "r2r_common" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4dee1e660f88ae6f8caf368db2b616f178bb7d57332e4ac157beeb6bbe57fe5" -dependencies = [ - "bindgen 0.63.0", - "os_str_bytes", - "regex", - "sha2 0.10.8", -] - -[[package]] -name = "r2r_macros" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d47d4c56155db63630574a4f0a2426561ff37c18a2021affdf8611b712b7a892" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - -[[package]] -name = "r2r_msg_gen" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec7a0473fa69271526ac1eeb5b1279b94e76cbfccec8ba9e32a18f0fb313de4" -dependencies = [ - "bindgen 0.63.0", - "force-send-sync", - "itertools 0.10.5", - "phf", - "proc-macro2", - "quote", - "r2r_common", - "r2r_rcl", - "rayon", - "syn 2.0.77", -] - -[[package]] -name = "r2r_rcl" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d79af52bdec385b7b732e78e5b8c20631c8f6968bd37316a84e6adaae41591" -dependencies = [ - "bindgen 0.63.0", - "paste", - "r2r_common", - "widestring", -] - [[package]] name = "rand" version = "0.7.3" @@ -2807,26 +2652,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "redox_syscall" version = "0.5.4" @@ -4139,7 +3964,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom 0.2.15", - "serde", ] [[package]] @@ -4365,12 +4189,6 @@ dependencies = [ "rustix 0.38.37", ] -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - [[package]] name = "winapi" version = "0.3.9" @@ -4579,7 +4397,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "ahash", "async-trait", @@ -4644,7 +4462,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "zenoh-collections", ] @@ -4652,7 +4470,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "tracing", "uhlc", @@ -4663,12 +4481,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "json5", "num_cpus", @@ -4690,7 +4508,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "lazy_static", "tokio", @@ -4701,7 +4519,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "aes 0.8.4", "hmac 0.12.1", @@ -4714,7 +4532,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "bincode", "flume", @@ -4731,7 +4549,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "hashbrown", "keyed-set", @@ -4745,7 +4563,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -4762,7 +4580,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "flume", @@ -4786,7 +4604,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "base64 0.22.1", @@ -4812,24 +4630,24 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "socket2 0.5.7", "tokio", "tokio-util", "tracing", + "zenoh-config", "zenoh-core", "zenoh-link-commons", "zenoh-protocol", "zenoh-result", - "zenoh-util", ] [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "base64 0.22.1", @@ -4858,7 +4676,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4877,7 +4695,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "nix", @@ -4895,7 +4713,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "futures-util", @@ -4915,7 +4733,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "proc-macro2", "quote", @@ -4926,7 +4744,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-rest" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "anyhow", "async-std", @@ -4962,7 +4780,6 @@ dependencies = [ "git-version", "hex", "lazy_static", - "r2r", "regex", "rustc_version 0.4.1", "serde", @@ -4979,7 +4796,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "git-version", "libloading", @@ -4995,7 +4812,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "const_format", "rand 0.8.5", @@ -5009,7 +4826,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "anyhow", ] @@ -5017,7 +4834,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "lazy_static", "ron", @@ -5030,7 +4847,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "event-listener 5.3.1", "futures", @@ -5043,7 +4860,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "futures", "tokio", @@ -5056,7 +4873,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "crossbeam-utils", @@ -5089,7 +4906,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#64e8caa298164ce543682c30211862188d262e44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fb2d2bc2865beeb49a49337fcfe12654cd013ffc" dependencies = [ "async-trait", "const_format", diff --git a/Cargo.toml b/Cargo.toml index c88085c..fcdd2dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,11 +52,14 @@ zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zen "unstable", ] } zenoh-plugin-ros2dds = { version = "1.0.0-dev", path = "zenoh-plugin-ros2dds/", default-features = false } -zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features=["static_plugin"]} +zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = [ + "static_plugin", +] } zenoh-plugin-trait = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false } # r2r is for tests only. See in in zenoh-plugins-ros2dds/Cargo.toml -r2r = "0.9" +# TODO: The ros_test should be re-enabled as soon the r2r dependency is removed from the build of zenoh-plugin-ros2dds +# r2r = "0.9" [profile.release] diff --git a/zenoh-plugin-ros2dds/Cargo.toml b/zenoh-plugin-ros2dds/Cargo.toml index 7d12da1..d4a8e94 100644 --- a/zenoh-plugin-ros2dds/Cargo.toml +++ b/zenoh-plugin-ros2dds/Cargo.toml @@ -31,7 +31,9 @@ default = ["dynamic_plugin"] stats = ["zenoh/stats"] dynamic_plugin = [] dds_shm = ["cyclors/iceoryx"] -ros_test = ["r2r"] + +# TODO: The ros_test should be re-enabled as soon the r2r dependency is removed from the build of zenoh-plugin-ros2dds +# ros_test = ["r2r"] [dependencies] async-trait = { workspace = true } @@ -58,7 +60,7 @@ zenoh-plugin-trait = { workspace = true } # r2r is for tests only. It has to be optional because its building requires a full ROS 2 environement # However "optional" is not supported for "dev-dependencies". # Hence it's declared as a dependency but active only with "ros_test" feature -r2r = { workspace = true, optional = true } +# r2r = { workspace = true, optional = true } [build-dependencies] diff --git a/zenoh-plugin-ros2dds/tests/test.rs b/zenoh-plugin-ros2dds/tests/test.rs index 28edbd0..ecf1a90 100644 --- a/zenoh-plugin-ros2dds/tests/test.rs +++ b/zenoh-plugin-ros2dds/tests/test.rs @@ -12,127 +12,129 @@ // ZettaScale Zenoh Team, // -#[cfg(feature = "ros_test")] -mod ros_test { - use std::{sync::mpsc::channel, time::Duration}; - - use futures::StreamExt; - use r2r::{self, QosProfile}; - use zenoh::{ - config::Config, - internal::{plugins::PluginsManager, runtime::RuntimeBuilder}, - }; - use zenoh_config::ModeDependentValue; - - // The test topic - const TEST_TOPIC: &str = "test_topic"; - // The test TEST_PAYLOAD - const TEST_PAYLOAD: &str = "Hello World"; - - fn init_env() { - std::env::set_var("RMW_IMPLEMENTATION", "rmw_cyclonedds_cpp"); - } - - async fn create_bridge() { - let mut plugins_mgr = PluginsManager::static_plugins_only(); - plugins_mgr - .declare_static_plugin::("ros2dds", true); - let mut config = Config::default(); - config.insert_json5("plugins/ros2dds", "{}").unwrap(); - config - .timestamping - .set_enabled(Some(ModeDependentValue::Unique(true))) - .unwrap(); - config.adminspace.set_enabled(true).unwrap(); - config.plugins_loading.set_enabled(true).unwrap(); - let mut runtime = RuntimeBuilder::new(config) - .plugins_manager(plugins_mgr) - .build() - .await - .unwrap(); - runtime.start().await.unwrap(); - } - - #[tokio::test(flavor = "multi_thread")] - async fn test_zenoh_pub_ros_sub() { - init_env(); - let (tx, rx) = channel(); - - // Create zenoh-bridge-ros2dds - tokio::spawn(create_bridge()); - - // ROS subscriber - let ctx = r2r::Context::create().unwrap(); - let mut node = r2r::Node::create(ctx, "ros_sub", "").unwrap(); - let subscriber = node - .subscribe::( - &format!("/{}", TEST_TOPIC), - QosProfile::default(), - ) - .unwrap(); - - // Zenoh publisher - let session = zenoh::open(zenoh::Config::default()).await.unwrap(); - let publisher = session.declare_publisher(TEST_TOPIC).await.unwrap(); - - // Wait for the environment to be ready - tokio::time::sleep(Duration::from_secs(1)).await; - - // Publish Zenoh message - let buf = cdr::serialize::<_, _, cdr::CdrLe>(TEST_PAYLOAD, cdr::size::Infinite).unwrap(); - publisher.put(buf).await.unwrap(); - - // Check ROS subscriber will receive the data - tokio::spawn(async move { - subscriber - .for_each(|msg| { - tx.send(msg.data).unwrap(); - futures::future::ready(()) - }) - .await - }); - node.spin_once(std::time::Duration::from_millis(100)); - let data = rx - .recv_timeout(Duration::from_secs(3)) - .expect("Receiver timeout"); - assert_eq!(data, TEST_PAYLOAD); - } - - #[tokio::test(flavor = "multi_thread")] - async fn test_ros_pub_zenoh_sub() { - init_env(); - // Create zenoh-bridge-ros2dds - tokio::spawn(create_bridge()); - - // Zenoh subscriber - let session = zenoh::open(zenoh::Config::default()).await.unwrap(); - let subscriber = session.declare_subscriber(TEST_TOPIC).await.unwrap(); - - // ROS publisher - let ctx = r2r::Context::create().unwrap(); - let mut node = r2r::Node::create(ctx, "ros_pub", "").unwrap(); - let publisher = node - .create_publisher(&format!("/{}", TEST_TOPIC), QosProfile::default()) - .unwrap(); - let msg = r2r::std_msgs::msg::String { - data: TEST_PAYLOAD.into(), - }; - - // Wait for the environment to be ready - tokio::time::sleep(Duration::from_secs(1)).await; - - // Publish ROS message - publisher.publish(&msg).unwrap(); - - // Check Zenoh subscriber will receive the data - tokio::time::timeout(Duration::from_secs(3), async { - let sample = subscriber.recv_async().await.unwrap(); - let result: Result = - cdr::deserialize_from(sample.payload().reader(), cdr::size::Infinite); - let recv_data = result.expect("Fail to receive data"); - assert_eq!(recv_data, TEST_PAYLOAD); - }) - .await - .expect("Timeout: Zenoh subscriber didn't receive any ROS message."); - } -} +// TODO: The ros_test should be re-enabled as soon the r2r dependency is removed from the build of zenoh-plugin-ros2dds + +// #[cfg(feature = "ros_test")] +// mod ros_test { +// use std::{sync::mpsc::channel, time::Duration}; + +// use futures::StreamExt; +// use r2r::{self, QosProfile}; +// use zenoh::{ +// config::Config, +// internal::{plugins::PluginsManager, runtime::RuntimeBuilder}, +// }; +// use zenoh_config::ModeDependentValue; + +// // The test topic +// const TEST_TOPIC: &str = "test_topic"; +// // The test TEST_PAYLOAD +// const TEST_PAYLOAD: &str = "Hello World"; + +// fn init_env() { +// std::env::set_var("RMW_IMPLEMENTATION", "rmw_cyclonedds_cpp"); +// } + +// async fn create_bridge() { +// let mut plugins_mgr = PluginsManager::static_plugins_only(); +// plugins_mgr +// .declare_static_plugin::("ros2dds", true); +// let mut config = Config::default(); +// config.insert_json5("plugins/ros2dds", "{}").unwrap(); +// config +// .timestamping +// .set_enabled(Some(ModeDependentValue::Unique(true))) +// .unwrap(); +// config.adminspace.set_enabled(true).unwrap(); +// config.plugins_loading.set_enabled(true).unwrap(); +// let mut runtime = RuntimeBuilder::new(config) +// .plugins_manager(plugins_mgr) +// .build() +// .await +// .unwrap(); +// runtime.start().await.unwrap(); +// } + +// #[tokio::test(flavor = "multi_thread")] +// async fn test_zenoh_pub_ros_sub() { +// init_env(); +// let (tx, rx) = channel(); + +// // Create zenoh-bridge-ros2dds +// tokio::spawn(create_bridge()); + +// // ROS subscriber +// let ctx = r2r::Context::create().unwrap(); +// let mut node = r2r::Node::create(ctx, "ros_sub", "").unwrap(); +// let subscriber = node +// .subscribe::( +// &format!("/{}", TEST_TOPIC), +// QosProfile::default(), +// ) +// .unwrap(); + +// // Zenoh publisher +// let session = zenoh::open(zenoh::Config::default()).await.unwrap(); +// let publisher = session.declare_publisher(TEST_TOPIC).await.unwrap(); + +// // Wait for the environment to be ready +// tokio::time::sleep(Duration::from_secs(1)).await; + +// // Publish Zenoh message +// let buf = cdr::serialize::<_, _, cdr::CdrLe>(TEST_PAYLOAD, cdr::size::Infinite).unwrap(); +// publisher.put(buf).await.unwrap(); + +// // Check ROS subscriber will receive the data +// tokio::spawn(async move { +// subscriber +// .for_each(|msg| { +// tx.send(msg.data).unwrap(); +// futures::future::ready(()) +// }) +// .await +// }); +// node.spin_once(std::time::Duration::from_millis(100)); +// let data = rx +// .recv_timeout(Duration::from_secs(3)) +// .expect("Receiver timeout"); +// assert_eq!(data, TEST_PAYLOAD); +// } + +// #[tokio::test(flavor = "multi_thread")] +// async fn test_ros_pub_zenoh_sub() { +// init_env(); +// // Create zenoh-bridge-ros2dds +// tokio::spawn(create_bridge()); + +// // Zenoh subscriber +// let session = zenoh::open(zenoh::Config::default()).await.unwrap(); +// let subscriber = session.declare_subscriber(TEST_TOPIC).await.unwrap(); + +// // ROS publisher +// let ctx = r2r::Context::create().unwrap(); +// let mut node = r2r::Node::create(ctx, "ros_pub", "").unwrap(); +// let publisher = node +// .create_publisher(&format!("/{}", TEST_TOPIC), QosProfile::default()) +// .unwrap(); +// let msg = r2r::std_msgs::msg::String { +// data: TEST_PAYLOAD.into(), +// }; + +// // Wait for the environment to be ready +// tokio::time::sleep(Duration::from_secs(1)).await; + +// // Publish ROS message +// publisher.publish(&msg).unwrap(); + +// // Check Zenoh subscriber will receive the data +// tokio::time::timeout(Duration::from_secs(3), async { +// let sample = subscriber.recv_async().await.unwrap(); +// let result: Result = +// cdr::deserialize_from(sample.payload().reader(), cdr::size::Infinite); +// let recv_data = result.expect("Fail to receive data"); +// assert_eq!(recv_data, TEST_PAYLOAD); +// }) +// .await +// .expect("Timeout: Zenoh subscriber didn't receive any ROS message."); +// } +// }