From 6322d98b498b67ae31ae7dac88d762e18815a85d Mon Sep 17 00:00:00 2001 From: Desmond Germans Date: Tue, 18 Jun 2024 13:09:16 +0200 Subject: [PATCH] update --- .github/workflows/rust_and_ros2.yml | 19 +++++++++++++++++++ README.md | 4 +++- r2r/src/lib.rs | 8 +++++++- r2r/src/qos.rs | 18 +++++++++--------- r2r_common/src/lib.rs | 2 +- tests/Dockerfile_jazzy | 22 ++++++++++++++++++++++ tests/test.bash | 4 +++- 7 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 tests/Dockerfile_jazzy diff --git a/.github/workflows/rust_and_ros2.yml b/.github/workflows/rust_and_ros2.yml index 2dfb57417..4240624e7 100644 --- a/.github/workflows/rust_and_ros2.yml +++ b/.github/workflows/rust_and_ros2.yml @@ -17,6 +17,18 @@ jobs: - run: docker build . --file ./tests/Dockerfile_no_ros --tag r2r_no_ros - run: docker run r2r_no_ros cargo build --features doc-only + minimal_workspace_jazzy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Checkout tools repo + uses: actions/checkout@v4 + with: + repository: m-dahl/r2r_minimal_node + path: r2r_minimal_node + - run: docker build . --file ./tests/Dockerfile_jazzy --tag r2r_jazzy + - run: docker run r2r_jazzy /r2r/tests/build_minimal_node.bash + minimal_workspace_iron: runs-on: ubuntu-latest steps: @@ -29,6 +41,13 @@ jobs: - run: docker build . --file ./tests/Dockerfile_iron --tag r2r_iron - run: docker run r2r_iron /r2r/tests/build_minimal_node.bash + tests_jazzy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: docker build . --file ./tests/Dockerfile_jazzy --tag r2r_jazzy + - run: docker run r2r_jazzy cargo test + tests_iron: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 3066b71b0..ac07f183d 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Since the default behavior is to build all sourced message types, build time can What works? -------------------- -- Up to date with ROS2 ~Dashing~ ~Eloquent~ Foxy Galactic Humble Iron +- Up to date with ROS2 ~Dashing~ ~Eloquent~ Foxy Galactic Humble Iron Jazzy - Building Rust types - Publish/subscribe - Services @@ -47,6 +47,8 @@ Changelog -------------------- #### [Unreleased] +- Update for ros2 jazzy + #### [0.9.0] - 2024-05-17 - Fix unsafe precondition(s) violated with rust 1.78 . There may be more of these to fix, please report if you encounter. - Expose QoS settings for service clients and servers . Note, slight API change! diff --git a/r2r/src/lib.rs b/r2r/src/lib.rs index e2f1854b2..9bc51ed9b 100644 --- a/r2r/src/lib.rs +++ b/r2r/src/lib.rs @@ -143,10 +143,16 @@ pub const ROS_DISTRO: &str = "galactic"; pub const ROS_DISTRO: &str = "humble"; #[cfg(r2r__ros__distro__rolling)] pub const ROS_DISTRO: &str = "rolling"; +#[cfg(r2r__ros__distro__iron)] +pub const ROS_DISTRO: &str = "iron"; +#[cfg(r2r__ros__distro__jazzy)] +pub const ROS_DISTRO: &str = "jazzy"; #[cfg(not(any( r2r__ros__distro__foxy, r2r__ros__distro__galactic, r2r__ros__distro__humble, - r2r__ros__distro__rolling + r2r__ros__distro__rolling, + r2r__ros__distro__iron, + r2r__ros__distro__jazzy )))] pub const ROS_DISTRO: &str = "unknown"; diff --git a/r2r/src/qos.rs b/r2r/src/qos.rs index 7665d4b07..5b6cda2e3 100644 --- a/r2r/src/qos.rs +++ b/r2r/src/qos.rs @@ -251,7 +251,7 @@ pub enum ReliabilityPolicy { BestEffort, Reliable, SystemDefault, - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] BestAvailable, Unknown, } @@ -267,7 +267,7 @@ impl From for rmw_qos_reliability_policy_t { ReliabilityPolicy::SystemDefault => { rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] ReliabilityPolicy::BestAvailable => { rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE } @@ -290,7 +290,7 @@ impl From for ReliabilityPolicy { rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT => { ReliabilityPolicy::SystemDefault } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE => { ReliabilityPolicy::BestAvailable } @@ -306,7 +306,7 @@ pub enum DurabilityPolicy { TransientLocal, Volatile, SystemDefault, - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] BestAvailable, Unknown, } @@ -323,7 +323,7 @@ impl From for rmw_qos_durability_policy_t { DurabilityPolicy::SystemDefault => { rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] DurabilityPolicy::BestAvailable => { rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE } @@ -346,7 +346,7 @@ impl From for DurabilityPolicy { rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT => { DurabilityPolicy::SystemDefault } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE => { DurabilityPolicy::BestAvailable } @@ -363,7 +363,7 @@ pub enum LivelinessPolicy { ManualByNode, ManualByTopic, SystemDefault, - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] BestAvailable, Unknown, } @@ -383,7 +383,7 @@ impl From for rmw_qos_liveliness_policy_t { LivelinessPolicy::SystemDefault => { rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] LivelinessPolicy::BestAvailable => { rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE } @@ -409,7 +409,7 @@ impl From for LivelinessPolicy { rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT => { LivelinessPolicy::SystemDefault } - #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling))] + #[cfg(any(r2r__ros__distro__iron, r2r__ros__distro__rolling, r2r__ros__distro__jazzy))] rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE => { LivelinessPolicy::BestAvailable } diff --git a/r2r_common/src/lib.rs b/r2r_common/src/lib.rs index d9bccfbb7..c728e6840 100644 --- a/r2r_common/src/lib.rs +++ b/r2r_common/src/lib.rs @@ -10,7 +10,7 @@ use std::{ }; #[cfg(not(feature = "doc-only"))] -const SUPPORTED_ROS_DISTROS: &[&str] = &["foxy", "galactic", "humble", "iron", "rolling"]; +const SUPPORTED_ROS_DISTROS: &[&str] = &["foxy", "galactic", "humble", "iron", "rolling", "jazzy"]; const WATCHED_ENV_VARS: &[&str] = &[ "AMENT_PREFIX_PATH", diff --git a/tests/Dockerfile_jazzy b/tests/Dockerfile_jazzy new file mode 100644 index 000000000..2731d59b9 --- /dev/null +++ b/tests/Dockerfile_jazzy @@ -0,0 +1,22 @@ +# syntax=docker/dockerfile:1 +FROM ros:jazzy + +# Update default packages +RUN apt-get update + +# Get Ubuntu packages +RUN apt-get install -y \ + build-essential \ + curl \ + libclang-dev + +# Get ros test messages +RUN apt-get install -y ros-jazzy-test-msgs ros-jazzy-example-interfaces + +# Get Rust +RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y +RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc + +COPY . /r2r +RUN chmod +x /r2r/tests/test.bash +ENTRYPOINT [ "/r2r/tests/test.bash" ] diff --git a/tests/test.bash b/tests/test.bash index f1232043e..b6257e238 100644 --- a/tests/test.bash +++ b/tests/test.bash @@ -5,7 +5,9 @@ # run rustup to test with latest rust version rustup update -if [ -e "/opt/ros/iron/setup.bash" ]; then +if [ -e "/opt/ros/jazzy/setup.bash" ]; then + source "/opt/ros/jazzy/setup.bash" +elif [ -e "/opt/ros/iron/setup.bash" ]; then source "/opt/ros/iron/setup.bash" elif [ -e "/opt/ros/humble/setup.bash" ]; then source "/opt/ros/humble/setup.bash"