Skip to content

Commit 8d5d57e

Browse files
authored
Remove Foxy from the list of supported ROS 2 distributions (#318)
1 parent 047f483 commit 8d5d57e

File tree

8 files changed

+11
-54
lines changed

8 files changed

+11
-54
lines changed

.github/workflows/rust.yml

-5
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ jobs:
1616
strategy:
1717
matrix:
1818
ros_distribution:
19-
- foxy
2019
- humble
2120
- rolling
2221
include:
23-
# Foxy Fitzroy (June 2020 - May 2023)
24-
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
25-
ros_distribution: foxy
26-
ros_version: 2
2722
# Humble Hawksbill (May 2022 - May 2027)
2823
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
2924
ros_distribution: humble

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ros:foxy as base
1+
FROM ros:humble as base
22
ARG DEBIAN_FRONTEND=noninteractive
33

44
# Install dependencies

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Here are the steps for building the `ros2_rust` examples in a vanilla Ubuntu Foc
3333
<!--- These steps should be kept in sync with docs/Building.md --->
3434
```shell
3535
# Install Rust, e.g. as described in https://rustup.rs/
36-
# Install ROS 2 as described in https://docs.ros.org/en/foxy/Installation.html
36+
# Install ROS 2 as described in https://docs.ros.org/en/humble/Installation.html
3737
# Assuming you installed the minimal version of ROS 2, you need these additional packages:
3838
sudo apt install -y git libclang-dev python3-pip python3-vcstool # libclang-dev is required by bindgen
3939
# Install these plugins for cargo and colcon:
@@ -43,8 +43,8 @@ pip install git+https://github.com/colcon/colcon-ros-cargo.git
4343

4444
mkdir -p workspace/src && cd workspace
4545
git clone https://github.com/ros2-rust/ros2_rust.git src/ros2_rust
46-
vcs import src < src/ros2_rust/ros2_rust_foxy.repos
47-
. /opt/ros/foxy/setup.sh
46+
vcs import src < src/ros2_rust/ros2_rust_humble.repos
47+
. /opt/ros/humble/setup.sh
4848
colcon build
4949
```
5050

docs/building.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a more detailed guide on how to build ROS 2 packages written in Rust that expands on the minimal steps in the README.
44

5-
In this guide, the Foxy distribution of ROS 2 is used, but newer distributions can be used by simply replacing 'foxy' with the distribution name everywhere.
5+
In this guide, the Humble distribution of ROS 2 is used, but newer distributions can be used by simply replacing 'humble' with the distribution name everywhere.
66

77

88
## Choosing a workspace directory and cloning `ros2_rust`
@@ -24,7 +24,7 @@ git clone https://github.com/ros2-rust/ros2_rust.git src/ros2_rust
2424

2525
## Environment setup
2626

27-
Building `rclrs` requires a standard [ROS 2 installation](https://docs.ros.org/en/foxy/Installation.html), and a few extensions.
27+
Building `rclrs` requires a standard [ROS 2 installation](https://docs.ros.org/en/humble/Installation.html), and a few extensions.
2828
These extensions are: `colcon-cargo`, `colcon-ros-cargo`, `cargo-ament-build`. The first two are `colcon` plugins, and the third is a `cargo` plugin.
2929

3030
The `libclang` library is also required for automatically generating FFI bindings with `bindgen`. See the [`bindgen` docs](https://rust-lang.github.io/rust-bindgen/requirements.html) on how to install it. As a side note, on Ubuntu the `clang` package is not required, only the `libclang-dev` package.
@@ -41,7 +41,7 @@ The exact steps may differ between platforms, but as an example, here is how you
4141
<!--- These steps should be kept in sync with README.md --->
4242
```shell
4343
# Install Rust, e.g. as described in https://rustup.rs/
44-
# Install ROS 2 as described in https://docs.ros.org/en/foxy/Installation.html
44+
# Install ROS 2 as described in https://docs.ros.org/en/humble/Installation.html
4545
# Assuming you installed the minimal version of ROS 2, you need these additional packages:
4646
sudo apt install -y git libclang-dev python3-pip python3-vcstool # libclang-dev is required by bindgen
4747
# Install these plugins for cargo and colcon:
@@ -75,7 +75,7 @@ As you can see, this maps the workspace directory to `/workspace` inside the con
7575

7676
```shell
7777
# Make sure to run this in the workspace directory
78-
vcs import src < src/ros2_rust/ros2_rust_foxy.repos
78+
vcs import src < src/ros2_rust/ros2_rust_humble.repos
7979
```
8080

8181
This uses the [`vcs` tool](https://github.com/dirk-thomas/vcstool), which is preinstalled in the Docker image.
@@ -87,13 +87,13 @@ The list of needed repositories should very rarely change, so you typically only
8787
### Sourcing the ROS 2 installation
8888

8989
Before building, the ROS 2 installation, and ideally _only_ the ROS 2 installation, should be sourced.
90-
Sourcing an installation populates a few environment variables such as `$AMENT_PREFIX_PATH`, so if you are not sure, you can check that the `$AMENT_PREFIX_PATH` environment variable contains the ROS 2 installation, e.g. `/opt/ros/foxy`.
90+
Sourcing an installation populates a few environment variables such as `$AMENT_PREFIX_PATH`, so if you are not sure, you can check that the `$AMENT_PREFIX_PATH` environment variable contains the ROS 2 installation, e.g. `/opt/ros/humble`.
9191

9292
In the pre-made Docker image, sourcing is already done for you. Otherwise, if `$AMENT_PREFIX_PATH` is empty, you need to source the ROS 2 installation yourself:
9393

9494
```shell
95-
# You can also do `source /opt/ros/foxy/setup.bash` in bash
96-
. /opt/ros/foxy/setup.sh
95+
# You can also do `source /opt/ros/humble/setup.bash` in bash
96+
. /opt/ros/humble/setup.sh
9797
````
9898

9999
If `$AMENT_PREFIX_PATH` contains undesired paths, exit and reopen your shell. If the problem persists, it's probably because of a sourcing command in your `~/.bashrc` or similar.

rclrs/src/dynamic_message.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ use std::fmt::{self, Display};
99
use std::path::PathBuf;
1010
use std::sync::Arc;
1111

12-
#[cfg(ros_distro = "foxy")]
13-
use crate::rcl_bindings::rosidl_typesupport_introspection_c__MessageMembers as rosidl_message_members_t;
14-
#[cfg(not(ros_distro = "foxy"))]
1512
use crate::rcl_bindings::rosidl_typesupport_introspection_c__MessageMembers_s as rosidl_message_members_t;
1613
use crate::rcl_bindings::*;
1714

rclrs/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ pub fn spin_once(node: &Node, timeout: Option<Duration>) -> Result<(), RclrsErro
7373
/// This function additionally checks that the context is still valid.
7474
pub fn spin(node: &Node) -> Result<(), RclrsError> {
7575
// The context_is_valid functions exists only to abstract away ROS distro differences
76-
#[cfg(ros_distro = "foxy")]
77-
// SAFETY: No preconditions for this function.
78-
let context_is_valid =
79-
|| unsafe { rcl_context_is_valid(&mut *node.rcl_context_mtx.lock().unwrap()) };
80-
#[cfg(not(ros_distro = "foxy"))]
8176
// SAFETY: No preconditions for this function.
8277
let context_is_valid =
8378
|| unsafe { rcl_context_is_valid(&*node.rcl_context_mtx.lock().unwrap()) };

rclrs/src/subscription/message_info.rs

-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub struct MessageInfo {
8080
/// received messages.
8181
/// Those might have already been taken by other messages that were received in between or lost.
8282
/// `psn2 - psn1 - 1 = 0` if and only if the messages were sent by the publisher consecutively.
83-
#[cfg(not(ros_distro = "foxy"))]
8483
pub publication_sequence_number: u64,
8584
/// Sequence number of the received message set by the subscription.
8685
///
@@ -98,7 +97,6 @@ pub struct MessageInfo {
9897
///
9998
/// - `rsn2 > rsn1` (except in the case of a wrap around)
10099
/// - `rsn2 = rsn1 + 1` if and only if both messages were received consecutively.
101-
#[cfg(not(ros_distro = "foxy"))]
102100
pub reception_sequence_number: u64,
103101
/// An identifier for the publisher that sent the message.
104102
pub publisher_gid: PublisherGid,
@@ -123,9 +121,7 @@ impl MessageInfo {
123121
Self {
124122
source_timestamp,
125123
received_timestamp,
126-
#[cfg(not(ros_distro = "foxy"))]
127124
publication_sequence_number: rmw_message_info.publication_sequence_number,
128-
#[cfg(not(ros_distro = "foxy"))]
129125
reception_sequence_number: rmw_message_info.reception_sequence_number,
130126
publisher_gid,
131127
}
@@ -136,7 +132,6 @@ impl MessageInfo {
136132
mod tests {
137133
use super::*;
138134

139-
#[cfg(not(ros_distro = "foxy"))]
140135
#[test]
141136
fn negative_durations() {
142137
let rmw_message_info = rmw_message_info_t {

ros2_rust_foxy.repos

-25
This file was deleted.

0 commit comments

Comments
 (0)