Skip to content

Commit 5fd75fd

Browse files
authored
Merge branch 'main' into ros2nix
2 parents cf31c1a + ed7bca6 commit 5fd75fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+53769
-411
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Generate bindings
2+
3+
on:
4+
schedule:
5+
# Run the CI at 00:11 UTC every night
6+
# We pick an arbitrary time outside of most of the world's work hours
7+
# to minimize the likelihood of running alongside a heavy workload.
8+
- cron: '11 0 * * *'
9+
workflow_dispatch:
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
ros_distribution:
19+
- humble
20+
- jazzy
21+
- kilted
22+
- rolling
23+
include:
24+
# Humble Hawksbill (May 2022 - May 2027)
25+
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
26+
ros_distribution: humble
27+
ros_version: 2
28+
# Jazzy Jalisco (May 2024 - May 2029)
29+
- docker_image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
30+
ros_distribution: jazzy
31+
ros_version: 2
32+
# Kilted Kaiju (May 2025 - Dec 2026)
33+
- docker_image: rostooling/setup-ros-docker:ubuntu-noble-ros-kilted-ros-base-latest
34+
ros_distribution: kilted
35+
ros_version: 2
36+
# Rolling Ridley (June 2020 - Present)
37+
- docker_image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
38+
ros_distribution: rolling
39+
ros_version: 2
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
container:
45+
image: ${{ matrix.docker_image }}
46+
steps:
47+
- uses: actions/checkout@v5
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Setup ROS environment
52+
uses: ros-tooling/[email protected]
53+
with:
54+
required-ros-distributions: ${{ matrix.ros_distribution }}
55+
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}
56+
57+
- name: Setup Rust
58+
uses: dtolnay/[email protected]
59+
with:
60+
components: clippy, rustfmt
61+
62+
- name: Install cargo binstall
63+
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
64+
65+
- name: Install bindgen
66+
run: cargo binstall -y bindgen-cli
67+
68+
- name: Install GitHub CLI tool
69+
run: |
70+
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
71+
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
72+
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
73+
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
74+
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
75+
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
76+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
77+
&& sudo apt update \
78+
&& sudo apt install gh -y
79+
80+
- name: Generate bindings
81+
run: |
82+
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
83+
cd rclrs/src
84+
../generate_bindings.py rcl_wrapper.h ${{ matrix.ros_distribution }} .
85+
86+
- name: Submit PR
87+
run: |
88+
cd $GITHUB_WORKSPACE
89+
git config --global --add safe.directory $GITHUB_WORKSPACE
90+
if git diff --exit-code; then
91+
echo "No changes detected, skipping PR creation"
92+
exit 0
93+
fi
94+
95+
git config --global user.email "[email protected]"
96+
git config --global user.name "GitHub Action"
97+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
98+
git fetch origin
99+
100+
echo "Github env set and origin is fetched! Now checking if PR exists.."
101+
102+
BRANCH_NAME="update-bindings-${{ matrix.ros_distribution }}"
103+
if gh pr list --head "$BRANCH_NAME" --state open --json number --jq length | grep -q '^0$'; then
104+
echo "No existing PR found, will create new one"
105+
CREATE_PR=1
106+
else
107+
echo "PR already exists, will update it"
108+
CREATE_PR=0
109+
fi
110+
111+
git add rclrs/src/rcl_bindings_generated_${{ matrix.ros_distribution }}.rs
112+
git commit -m "Regenerate bindings for ${{ matrix.ros_distribution }}"
113+
114+
git push -f origin HEAD:refs/heads/$BRANCH_NAME
115+
116+
if [ $CREATE_PR -eq 1 ]; then
117+
gh pr create \
118+
--base main \
119+
--head "$BRANCH_NAME" \
120+
--title "Regenerate bindings for ${{ matrix.ros_distribution }}" \
121+
--body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}."
122+
echo "Created new PR!"
123+
else
124+
echo "PR already exists and has been updated with new commit"
125+
fi
126+
env:
127+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-plz.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77

8+
env:
9+
RUSTFLAGS: "--cfg ros_distro=\"humble\""
10+
811
jobs:
912
release-plz-release:
1013
name: Release-plz release

.github/workflows/rust-minimal.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
components: clippy, rustfmt
6969

7070
# Colcon can not be run in a venv which is required in Ubuntu Noble
71-
# Removing the externally managed file
71+
# Removing the externally managed file
7272
- name: Install colcon-cargo and colcon-ros-cargo
7373
run: |
7474
sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED
@@ -117,9 +117,7 @@ jobs:
117117
echo "Running cargo test in $path"
118118
# Run cargo test for all features except use_ros_shim (needed for docs.rs)
119119
if [ "$(basename $path)" = "rclrs" ]; then
120-
cargo test -F default,dyn_msg
121-
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
122-
cargo test -F default
120+
cargo test -F default,dyn_msg,serde
123121
else
124122
cargo test --all-features
125123
fi

.github/workflows/rust-stable.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
components: clippy, rustfmt
6969

7070
# Colcon can not be run in a venv which is required in Ubuntu Noble
71-
# Removing the externally managed file
71+
# Removing the externally managed file
7272
- name: Install colcon-cargo and colcon-ros-cargo
7373
run: |
7474
sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED
@@ -117,9 +117,7 @@ jobs:
117117
echo "Running cargo test in $path"
118118
# Run cargo test for all features except use_ros_shim (needed for docs.rs)
119119
if [ "$(basename $path)" = "rclrs" ]; then
120-
cargo test -F default,dyn_msg
121-
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
122-
cargo test -F default
120+
cargo test -F default,dyn_msg,serde
123121
else
124122
cargo test --all-features
125123
fi

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ RUN apt-get update && apt-get install -y \
1515
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.75.0 -y
1616
ENV PATH=/root/.cargo/bin:$PATH
1717

18-
# Install the colcon-cargo and colcon-ros-cargo plugins
19-
RUN if [ "$ROS_DISTRO" = "humble" ] ; \
20-
then pip install --upgrade pytest && pip install colcon-ros-cargo ; \
21-
else pip install --break-system-packages pytest colcon-ros-cargo ; fi
18+
COPY src/ros2_rust/docker/install_colcon_plugins.sh /
19+
RUN ./install_colcon_plugins.sh
20+
21+
COPY src/ros2_rust/docker/rosidl_rust_setup.sh /
22+
RUN ./rosidl_rust_setup.sh
2223

2324
RUN mkdir -p /workspace && echo "Did you forget to mount the repository into the Docker container?" > /workspace/HELLO.txt
2425
WORKDIR /workspace
26+
27+
COPY src/ros2_rust/docker/rosidl_rust_entrypoint.sh /
28+
ENTRYPOINT ["/rosidl_rust_entrypoint.sh"]
29+
CMD ["/bin/bash"]

docker/install_colcon_plugins.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
if [ "$ROS_DISTRO" = "humble" ]; then
4+
pip install --upgrade pytest
5+
pip install \
6+
git+https://github.com/colcon/colcon-cargo.git \
7+
git+https://github.com/colcon/colcon-ros-cargo.git
8+
else
9+
pip install --break-system-packages pytest \
10+
git+https://github.com/colcon/colcon-cargo.git \
11+
git+https://github.com/colcon/colcon-ros-cargo.git
12+
fi

docker/rosidl_rust_entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# setup ros2 environment
5+
source "/opt/ros/$ROS_DISTRO/setup.bash" --
6+
7+
# If we're a distro that needs the overlay built, then source it
8+
if [ -f "/tmp/rosidl_rust_overlay/install/setup.bash" ]; then
9+
source /tmp/rosidl_rust_overlay/install/setup.bash --
10+
fi
11+
12+
exec "$@"

docker/rosidl_rust_setup.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Depending on the ROS_DISTRO, make sure we've got rosidl_generator_rs
4+
# sourced and available in working directory workspace
5+
6+
if [ "$ROS_DISTRO" = "rolling" ]; then
7+
apt-get update && apt-get install -y ros-$ROS_DISTRO-rosidl-generator-rs
8+
else
9+
# Temporarily add `rosidl_rust` to an overlay, build, and source it.
10+
mkdir -p /tmp/rosidl_rust_overlay/src
11+
git clone https://github.com/ros2-rust/rosidl_rust /tmp/rosidl_rust_overlay/src
12+
13+
cd /tmp/rosidl_rust_overlay
14+
15+
. /opt/ros/$ROS_DISTRO/setup.sh
16+
colcon build
17+
fi

rclrs/CHANGELOG.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.6.0](https://github.com/ros2-rust/ros2_rust/compare/v0.5.1...v0.6.0) - 2025-10-27
11+
12+
### Added
13+
14+
- [**breaking**] async actions ([#503](https://github.com/ros2-rust/ros2_rust/pull/503))
15+
- timers API ([#480](https://github.com/ros2-rust/ros2_rust/pull/480))
16+
17+
### Other
18+
19+
- re-add generate_bindings.py script
20+
- Minimal changes for new Action trait ([#539](https://github.com/ros2-rust/ros2_rust/pull/539))
21+
- Re-export traits from rosidl_runtime_rs ([#537](https://github.com/ros2-rust/ros2_rust/pull/537))
22+
- Fix use of serde ([#538](https://github.com/ros2-rust/ros2_rust/pull/538))
23+
- Put `use rustflags` next to its usage to prevent a build warning. ([#526](https://github.com/ros2-rust/ros2_rust/pull/526))
24+
25+
## [0.5.1](https://github.com/ros2-rust/ros2_rust/compare/v0.5.0...v0.5.1) - 2025-08-23
26+
27+
### Other
28+
29+
- Fix executor timeout ([#519](https://github.com/ros2-rust/ros2_rust/pull/519))
30+
31+
## [0.5.0](https://github.com/ros2-rust/ros2_rust/compare/v0.4.1...v0.5.0) - 2025-08-15
32+
33+
### Added
34+
35+
- vendorize messages so that cargo update works ([#509](https://github.com/ros2-rust/ros2_rust/pull/509))
36+
37+
### Other
38+
39+
- Moved examples to its own repo ([#504](https://github.com/ros2-rust/ros2_rust/pull/504))
40+
- Wake up wait set when adding a new waitable ([#505](https://github.com/ros2-rust/ros2_rust/pull/505))
41+
- rename generate_docs feature to use_ros_shim ([#501](https://github.com/ros2-rust/ros2_rust/pull/501))
42+
- Async Workers ([#446](https://github.com/ros2-rust/ros2_rust/pull/446))
43+
- Shared state pattern (spin-off of #427) ([#430](https://github.com/ros2-rust/ros2_rust/pull/430))
44+
- Options pattern (spin-off of #427) ([#429](https://github.com/ros2-rust/ros2_rust/pull/429))
45+
- Fix RAII for subscription, client, and service ([#463](https://github.com/ros2-rust/ros2_rust/pull/463))
46+
- Execution structure (spin-off of #427) ([#428](https://github.com/ros2-rust/ros2_rust/pull/428))
47+
- Remove Iron support ([#443](https://github.com/ros2-rust/ros2_rust/pull/443))
48+
- Add Publisher::get_subscription_count ([#457](https://github.com/ros2-rust/ros2_rust/pull/457))
49+
- Bumb bindgen dependency to 0.70 ([#452](https://github.com/ros2-rust/ros2_rust/pull/452))
50+
- Update for clippy 1.83 ([#441](https://github.com/ros2-rust/ros2_rust/pull/441))
51+
- Add Publisher::can_loan_msgs ([#434](https://github.com/ros2-rust/ros2_rust/pull/434))
52+
- Add rosout logging to rclrs ([#422](https://github.com/ros2-rust/ros2_rust/pull/422))
53+
- Update vendored interface packages ([#423](https://github.com/ros2-rust/ros2_rust/pull/423))
54+
- Use latest stable Rust CI + Fix Test Errors ([#420](https://github.com/ros2-rust/ros2_rust/pull/420))
55+
- Add std::error::Error impls to Error enums of `parameter` module ([#413](https://github.com/ros2-rust/ros2_rust/pull/413))
56+
- Wrap slice::from_raw_parts to be compatible with rcl ([#419](https://github.com/ros2-rust/ros2_rust/pull/419))
57+
- Compile on targets where c_char ≠ i8 ([#403](https://github.com/ros2-rust/ros2_rust/pull/403))
58+
- Add parameter services ([#342](https://github.com/ros2-rust/ros2_rust/pull/342))
59+
- Fixup of #388 ([#389](https://github.com/ros2-rust/ros2_rust/pull/389))
60+
- Fix link formatting
61+
- Get rid of doc links to private structs
62+
- Update documentation on ENTITY_LIFECYCLE_MUTEX
63+
- Improve the documentation for the domain ID situation of test_graph_empty
64+
- Rename to avoid confusion with Handle pattern
65+
- Update documentation and safety info on rcl entity lifecycles
66+
- Remove the need for lazy_static
67+
- Satisfy clippy
68+
- Use usize instead of u8 for domain id
69+
- Ensure that test_graph_empty works even if the system has ROS_DOMAIN_ID set to 99
70+
- Run clippy
71+
- Run rustfmt
72+
- Apply lifecycle lock to all middleware entities
73+
- Ensure that mutex guards are not being dropped prematurely
74+
- Introduce InitOptions to allow manually setting domain ID
75+
- Keep context alive for guard conditions
76+
- Manage all rcl bindings with Handle structs
77+
- Reworking the lifecycle management of rcl bindings
78+
- Import the builtin_interfaces directly from the internal vendor module.
79+
- Added `test_msgs` as a test dependency
80+
- Move the tests in the `rclrs_tests` crate into `rclrs`.
81+
- Move rcl structs to end of Node declaration
82+
- Allow ros2_rust to be built within a distro workspace
83+
- Add default implementation and builder pattern for QoS ([#361](https://github.com/ros2-rust/ros2_rust/pull/361))
84+
- Adding a simple helper function for converting `rclrs::Time` to a ros message ([#359](https://github.com/ros2-rust/ros2_rust/pull/359))
85+
- Remove leading underscore from private fields ([#354](https://github.com/ros2-rust/ros2_rust/pull/354))
86+
87+
## [0.4.1](https://github.com/ros2-rust/ros2_rust/compare/v0.4.0...v0.4.1) - 2023-11-28
88+
- Added minor changes to enable documentation generation on docs.rs for the `ros2-rust` projects.
89+
90+
## [0.4.0](https://github.com/ros2-rust/ros2_rust/compare/v0.3.1...v0.4.0) - 2023-11-07
91+
- Service clients now support service_is_ready to check if a service server is present ahead of calling ([#399](https://github.com/ros2-rust/ros2_rust/pull/339))
92+
- Added preliminary support for parameters
93+
- Added support for Iron Irwini
94+
- Added Serde big array support
95+
- Added basic functionality for loading introspection type support libraries
96+
- Added extended string types
97+
- Added time source and clock API to nodes
98+
- Removed support for Galactic
99+
- Removed support for Foxy
100+
101+
## [0.3.1](https://github.com/ros2-rust/ros2_rust/compare/v0.3.0...v0.3.1) - 2022-10-17
102+
- Fixed segfault when re-using `WaitSet`
103+
- Fixed `Node::get_{publishers,subscriptions}_info_by_topic()`
104+
105+
## [0.3.0](https://github.com/ros2-rust/ros2_rust/compare/v0.2.0...v0.3.0) - 2022-10-03
106+
- Loaned messages (zero-copy) ([#212](https://github.com/ros2-rust/ros2_rust/pull/212))
107+
- Graph queries ([#234](https://github.com/ros2-rust/ros2_rust/pull/234))
108+
- Guard conditions ([#249](https://github.com/ros2-rust/ros2_rust/pull/249))
109+
110+
## [0.2.0] (2022-07-21)
111+
- First release
112+
- `colcon-cargo` and `colcon-ros-cargo` can now build any pure Cargo and ament-aware Cargo projects
113+
- `rclrs` and `rclrs_examples` are now `ament_cargo` projects, no more CMake involved
114+
- `rosidl_generator_rs` has been updated to support all ROS message types
115+
- `rclrs` now supports clients and services
116+
- Better API documentation
117+
- Foxy, Galactic, Humble and Rolling are now supported ROS distros
118+
- Preliminary support for Windows
119+
- Build based on `colcon-ros-cargo`
120+
- Message generation packages `rosidl_generator_rs` and `rosidl_runtime_rs`
121+
- Publisher, Subscription, Client and Service
122+
- Tunable QoS settings

rclrs/CHANGELOG.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)