From 44a3eaedbe89d8aa2ac75250a21c304148d3c581 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 5 Apr 2024 18:09:04 +0200 Subject: [PATCH 1/4] Update to latest version of our `ros2-client` fork --- Cargo.lock | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b83b95d2..1bde1f3d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -906,9 +906,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", @@ -916,7 +916,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -2582,12 +2582,12 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +checksum = "624c5448ba529e74f594c65b7024f31b2de7b64a9b228b8df26796bbb6e32c36" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2976,9 +2976,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" @@ -3058,9 +3058,9 @@ checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "local-ip-address" -version = "0.5.6" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66357e687a569abca487dc399a9c9ac19beb3f13991ed49f00c144e02cbd42ab" +checksum = "136ef34e18462b17bf39a7826f8f3bbc223341f8e83822beb8b77db9a3d49696" dependencies = [ "libc", "neli", @@ -4676,8 +4676,8 @@ dependencies = [ [[package]] name = "ros2-client" -version = "0.6.1" -source = "git+https://github.com/dora-rs/ros2-client.git?branch=deserialize-seed-2#23cbcc8557011cf3e89f95bab4fe02a40c5dac74" +version = "0.7.0" +source = "git+https://github.com/dora-rs/ros2-client.git?branch=deserialize-seed-2#008b76c9cbdff5222554af28421c67b659d4275d" dependencies = [ "async-channel 2.1.1", "bstr", @@ -4688,6 +4688,7 @@ dependencies = [ "futures", "itertools 0.11.0", "lazy_static", + "libc", "log", "mio 0.6.23", "mio-extras", @@ -4795,8 +4796,8 @@ dependencies = [ [[package]] name = "rustdds" -version = "0.9.0" -source = "git+https://github.com/dora-rs/RustDDS.git?branch=deserialize-seed-2#fae9fcfb582c4842b849268b3466875daf62fb7f" +version = "0.9.2" +source = "git+https://github.com/dora-rs/RustDDS.git?branch=deserialize-seed-2#4e8e37d6405a21f6d54c1d1255e7ae1d65f41720" dependencies = [ "bit-vec", "byteorder", From d4a406e93ec498df4966afcb01d6313bb0fe2e71 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 5 Apr 2024 20:10:58 +0200 Subject: [PATCH 2/4] Adjust generated code and examples for latest `ros2-client` version --- examples/rust-ros2-dataflow/node/src/main.rs | 8 +++++--- libraries/extensions/ros2-bridge/msg-gen/src/lib.rs | 5 +++-- libraries/extensions/ros2-bridge/python/src/lib.rs | 5 ++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/rust-ros2-dataflow/node/src/main.rs b/examples/rust-ros2-dataflow/node/src/main.rs index 32ac8cf4c..395a5e344 100644 --- a/examples/rust-ros2-dataflow/node/src/main.rs +++ b/examples/rust-ros2-dataflow/node/src/main.rs @@ -25,7 +25,9 @@ fn main() -> eyre::Result<()> { // spawn a background spinner task that is handles service discovery (and other things) let pool = futures::executor::ThreadPool::new()?; - let spinner = ros_node.spinner(); + let spinner = ros_node + .spinner() + .map_err(|e| eyre::eyre!("failed to create spinner: {e:?}"))?; pool.spawn(async { if let Err(err) = spinner.spin().await { eprintln!("ros2 spinner failed: {err:?}"); @@ -150,7 +152,7 @@ async fn add_two_ints_request( let response = add_client.async_receive_response(request_id); futures::pin_mut!(response); - let timeout = futures_timer::Delay::new(Duration::from_secs(5)); + let timeout = futures_timer::Delay::new(Duration::from_secs(15)); match futures::future::select(response, timeout).await { futures::future::Either::Left((Ok(response), _)) => { println!("received response: {response:?}"); @@ -172,7 +174,7 @@ fn init_ros_node() -> eyre::Result { .map_err(|e| eyre!("failed to create ROS2 node name: {e}"))?, NodeOptions::new().enable_rosout(true), ) - .context("failed to create ros2 node") + .map_err(|e| eyre::eyre!("failed to create ros2 node: {e:?}")) } fn create_vel_publisher( diff --git a/libraries/extensions/ros2-bridge/msg-gen/src/lib.rs b/libraries/extensions/ros2-bridge/msg-gen/src/lib.rs index e338410c7..9e598a069 100644 --- a/libraries/extensions/ros2-bridge/msg-gen/src/lib.rs +++ b/libraries/extensions/ros2-bridge/msg-gen/src/lib.rs @@ -126,9 +126,10 @@ where let name = ros2_client::NodeName::new(name_space, base_name).map_err(|e| eyre::eyre!(e))?; let options = ros2_client::NodeOptions::new().enable_rosout(true); - let mut node = self.context.new_node(name, options)?; + let mut node = self.context.new_node(name, options) + .map_err(|e| eyre::eyre!("failed to create ROS2 node: {e:?}"))?; - let spinner = node.spinner(); + let spinner = node.spinner().context("failed to create spinner")?; self.executor.spawn(async { if let Err(err) = spinner.spin().await { eprintln!("ros2 spinner failed: {err:?}"); diff --git a/libraries/extensions/ros2-bridge/python/src/lib.rs b/libraries/extensions/ros2-bridge/python/src/lib.rs index c9492dcab..ac0a0becd 100644 --- a/libraries/extensions/ros2-bridge/python/src/lib.rs +++ b/libraries/extensions/ros2-bridge/python/src/lib.rs @@ -81,7 +81,10 @@ impl Ros2Context { let name = ros2_client::NodeName::new(namespace, name) .map_err(|err| eyre!("invalid node name: {err}"))?; Ok(Ros2Node { - node: self.context.new_node(name, options.into())?, + node: self + .context + .new_node(name, options.into()) + .map_err(|e| eyre::eyre!("failed to create ROS2 node: {e:?}"))?, messages: self.messages.clone(), }) } From 9824dd986feb4b46a16f979069b7716be7864d8f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 15 Apr 2024 10:21:02 +0200 Subject: [PATCH 3/4] Update to upstream RustDDS PR Update to use https://github.com/jhelovuo/RustDDS/pull/334 . --- Cargo.lock | 8 ++++---- libraries/extensions/ros2-bridge/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bde1f3d6..8342caf9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2582,9 +2582,9 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624c5448ba529e74f594c65b7024f31b2de7b64a9b228b8df26796bbb6e32c36" +checksum = "bb2a33e9c38988ecbda730c85b0fd9ddcdf83c0305ac7fd21c8bb9f57f2f0cc8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4677,7 +4677,7 @@ dependencies = [ [[package]] name = "ros2-client" version = "0.7.0" -source = "git+https://github.com/dora-rs/ros2-client.git?branch=deserialize-seed-2#008b76c9cbdff5222554af28421c67b659d4275d" +source = "git+https://github.com/dora-rs/ros2-client.git?branch=deserialize-seed-2#34196be6fd7c9293d76584fdc5996ff8e11be325" dependencies = [ "async-channel 2.1.1", "bstr", @@ -4797,7 +4797,7 @@ dependencies = [ [[package]] name = "rustdds" version = "0.9.2" -source = "git+https://github.com/dora-rs/RustDDS.git?branch=deserialize-seed-2#4e8e37d6405a21f6d54c1d1255e7ae1d65f41720" +source = "git+https://github.com/jhelovuo/RustDDS.git?branch=deserialize-with-seed#8b6d8d4db1b382447a4079adabb0d07ea66fe7b8" dependencies = [ "bit-vec", "byteorder", diff --git a/libraries/extensions/ros2-bridge/Cargo.toml b/libraries/extensions/ros2-bridge/Cargo.toml index 967403f25..dc27f90f0 100644 --- a/libraries/extensions/ros2-bridge/Cargo.toml +++ b/libraries/extensions/ros2-bridge/Cargo.toml @@ -18,7 +18,7 @@ serde = { version = "1.0.164", features = ["derive"] } serde-big-array = "0.5.1" widestring = "1.0.2" ros2-client = { git = "https://github.com/dora-rs/ros2-client.git", branch = "deserialize-seed-2" } -rustdds = { git = "https://github.com/dora-rs/RustDDS.git", branch = "deserialize-seed-2" } +rustdds = { git = "https://github.com/jhelovuo/RustDDS.git", branch = "deserialize-with-seed" } eyre = { version = "0.6.8", optional = true } tokio = { version = "1.29.1", features = ["full"], optional = true } dora-daemon = { path = "../../../binaries/daemon", optional = true } From e50e166057d2767379666471432f0d75552e5c55 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 16 Apr 2024 15:59:28 +0200 Subject: [PATCH 4/4] Update to upstream ros2-client 0.7.1 and rustdds 0.10.0 releases --- Cargo.lock | 14 ++++++++------ libraries/extensions/ros2-bridge/Cargo.toml | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8342caf9f..de3c8b117 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2582,9 +2582,9 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.12.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2a33e9c38988ecbda730c85b0fd9ddcdf83c0305ac7fd21c8bb9f57f2f0cc8" +checksum = "624c5448ba529e74f594c65b7024f31b2de7b64a9b228b8df26796bbb6e32c36" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4676,8 +4676,9 @@ dependencies = [ [[package]] name = "ros2-client" -version = "0.7.0" -source = "git+https://github.com/dora-rs/ros2-client.git?branch=deserialize-seed-2#34196be6fd7c9293d76584fdc5996ff8e11be325" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bee0c156d235d3d52d217d29b628e56dd8a0be5308acb1925a7d76835ee5bb" dependencies = [ "async-channel 2.1.1", "bstr", @@ -4796,8 +4797,9 @@ dependencies = [ [[package]] name = "rustdds" -version = "0.9.2" -source = "git+https://github.com/jhelovuo/RustDDS.git?branch=deserialize-with-seed#8b6d8d4db1b382447a4079adabb0d07ea66fe7b8" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fc6a62fccbe521b5de1bb40c06f4a9b8844337eb218c94577b40c5bae5f584" dependencies = [ "bit-vec", "byteorder", diff --git a/libraries/extensions/ros2-bridge/Cargo.toml b/libraries/extensions/ros2-bridge/Cargo.toml index dc27f90f0..96a2ad869 100644 --- a/libraries/extensions/ros2-bridge/Cargo.toml +++ b/libraries/extensions/ros2-bridge/Cargo.toml @@ -17,8 +17,8 @@ array-init = "2.1.0" serde = { version = "1.0.164", features = ["derive"] } serde-big-array = "0.5.1" widestring = "1.0.2" -ros2-client = { git = "https://github.com/dora-rs/ros2-client.git", branch = "deserialize-seed-2" } -rustdds = { git = "https://github.com/jhelovuo/RustDDS.git", branch = "deserialize-with-seed" } +ros2-client = "0.7.1" +rustdds = "0.10.0" eyre = { version = "0.6.8", optional = true } tokio = { version = "1.29.1", features = ["full"], optional = true } dora-daemon = { path = "../../../binaries/daemon", optional = true }