Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ros2 iron #84

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/rust_and_ros2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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_humble:
minimal_workspace_iron:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,8 +26,15 @@ jobs:
with:
repository: m-dahl/r2r_minimal_node
path: r2r_minimal_node
- run: docker build . --file ./tests/Dockerfile_humble --tag r2r_humble
- run: docker run r2r_humble /r2r/tests/build_minimal_node.bash
- run: docker build . --file ./tests/Dockerfile_iron --tag r2r_iron
- run: docker run r2r_iron /r2r/tests/build_minimal_node.bash

tests_iron:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build . --file ./tests/Dockerfile_iron --tag r2r_iron
- run: docker run r2r_iron cargo test

tests_humble:
runs-on: ubuntu-latest
Expand Down
30 changes: 30 additions & 0 deletions r2r/src/qos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ pub enum ReliabilityPolicy {
BestEffort,
Reliable,
SystemDefault,
#[cfg(r2r__ros__distro__iron)]
BestAvailable,
Unknown,
}
impl From<ReliabilityPolicy> for rmw_qos_reliability_policy_t {
Expand All @@ -265,6 +267,10 @@ impl From<ReliabilityPolicy> for rmw_qos_reliability_policy_t {
ReliabilityPolicy::SystemDefault => {
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT
}
#[cfg(r2r__ros__distro__iron)]
ReliabilityPolicy::BestAvailable => {
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE
}
ReliabilityPolicy::Unknown => {
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_UNKNOWN
}
Expand All @@ -284,6 +290,10 @@ impl From<rmw_qos_reliability_policy_t> for ReliabilityPolicy {
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT => {
ReliabilityPolicy::SystemDefault
}
#[cfg(r2r__ros__distro__iron)]
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE => {
ReliabilityPolicy::BestAvailable
}
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_UNKNOWN => {
ReliabilityPolicy::Unknown
}
Expand All @@ -296,6 +306,8 @@ pub enum DurabilityPolicy {
TransientLocal,
Volatile,
SystemDefault,
#[cfg(r2r__ros__distro__iron)]
BestAvailable,
Unknown,
}

Expand All @@ -311,6 +323,10 @@ impl From<DurabilityPolicy> for rmw_qos_durability_policy_t {
DurabilityPolicy::SystemDefault => {
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT
}
#[cfg(r2r__ros__distro__iron)]
DurabilityPolicy::BestAvailable => {
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE
}
DurabilityPolicy::Unknown => {
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_UNKNOWN
}
Expand All @@ -330,6 +346,10 @@ impl From<rmw_qos_durability_policy_t> for DurabilityPolicy {
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT => {
DurabilityPolicy::SystemDefault
}
#[cfg(r2r__ros__distro__iron)]
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE => {
DurabilityPolicy::BestAvailable
}
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_UNKNOWN => {
DurabilityPolicy::Unknown
}
Expand All @@ -343,6 +363,8 @@ pub enum LivelinessPolicy {
ManualByNode,
ManualByTopic,
SystemDefault,
#[cfg(r2r__ros__distro__iron)]
BestAvailable,
Unknown,
}

Expand All @@ -361,6 +383,10 @@ impl From<LivelinessPolicy> for rmw_qos_liveliness_policy_t {
LivelinessPolicy::SystemDefault => {
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT
}
#[cfg(r2r__ros__distro__iron)]
LivelinessPolicy::BestAvailable => {
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE
}
LivelinessPolicy::Unknown => {
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_UNKNOWN
}
Expand All @@ -383,6 +409,10 @@ impl From<rmw_qos_liveliness_policy_t> for LivelinessPolicy {
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT => {
LivelinessPolicy::SystemDefault
}
#[cfg(r2r__ros__distro__iron)]
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE => {
LivelinessPolicy::BestAvailable
}
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_UNKNOWN => {
LivelinessPolicy::Unknown
}
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 @@ -8,7 +8,7 @@ use std::io::Read;
use std::path::Path;

#[cfg(not(feature = "doc-only"))]
const SUPPORTED_ROS_DISTROS: &[&str] = &["foxy", "galactic", "humble", "rolling"];
const SUPPORTED_ROS_DISTROS: &[&str] = &["foxy", "galactic", "humble", "iron", "rolling"];

const WATCHED_ENV_VARS: &[&str] = &[
"AMENT_PREFIX_PATH",
Expand Down
22 changes: 22 additions & 0 deletions tests/Dockerfile_iron
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# syntax=docker/dockerfile:1
FROM ros:iron

# 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-iron-test-msgs ros-iron-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" ]
10 changes: 5 additions & 5 deletions tests/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
# run rustup to test with latest rust version
rustup update

if [ -e "/opt/ros/humble/setup.bash" ]; then
if [ -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"
fi
if [ -e "/opt/ros/galactic/setup.bash" ]; then
elif [ -e "/opt/ros/galactic/setup.bash" ]; then
source "/opt/ros/galactic/setup.bash"
fi
if [ -e "/opt/ros/foxy/setup.bash" ]; then
elif [ -e "/opt/ros/foxy/setup.bash" ]; then
source "/opt/ros/foxy/setup.bash"
fi

Expand Down