Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
des256 committed Jun 18, 2024
1 parent 05d2c19 commit 6322d98
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 13 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/rust_and_ros2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <https://github.com/sequenceplanner/r2r/issues/96>. There may be more of these to fix, please report if you encounter.
- Expose QoS settings for service clients and servers <https://github.com/sequenceplanner/r2r/pull/95>. Note, slight API change!
Expand Down
8 changes: 7 additions & 1 deletion r2r/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
18 changes: 9 additions & 9 deletions r2r/src/qos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -267,7 +267,7 @@ impl From<ReliabilityPolicy> 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
}
Expand All @@ -290,7 +290,7 @@ impl From<rmw_qos_reliability_policy_t> 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
}
Expand All @@ -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,
}
Expand All @@ -323,7 +323,7 @@ impl From<DurabilityPolicy> 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
}
Expand All @@ -346,7 +346,7 @@ impl From<rmw_qos_durability_policy_t> 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
}
Expand All @@ -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,
}
Expand All @@ -383,7 +383,7 @@ impl From<LivelinessPolicy> 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
}
Expand All @@ -409,7 +409,7 @@ impl From<rmw_qos_liveliness_policy_t> 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
}
Expand Down
2 changes: 1 addition & 1 deletion r2r_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 22 additions & 0 deletions tests/Dockerfile_jazzy
Original file line number Diff line number Diff line change
@@ -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" ]
4 changes: 3 additions & 1 deletion tests/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6322d98

Please sign in to comment.