| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a set of projects (the rclrs client library, code generator, examples, and more) that enables developers to write ROS 2 applications in Rust.
The current set of features includes:
Some things are still missing however, see the issue list for an overview. You are very welcome to contribute!
Since the client library is still rapidly evolving, there are no stability guarantees for the moment.
First, install Rust and the required system dependencies:
# Install Rust (see https://rustup.rs/)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install required system packages
sudo apt install -y git libclang-dev python3-pip python3-vcstool
# Install colcon plugins for Rust
pip install --break-system-packages colcon-cargo colcon-ros-cargoBecause of an issue in rclrs (#557), as a workaround, the following two packages need to be installed:
# Install workaround packages
sudo apt install -y ros-$ROS_DISTRO-example-interfaces
sudo apt install -y ros-$ROS_DISTRO-test-msgsrclrs is released on crates.io and you can add it to your project directly:
[dependencies]
rclrs = "0.7"Due to different ROS 2 distributions having different levels of integration with rclrs, if you'd like to build and run the examples, please follow the corresponding section.
To run the examples, install the test_msgs and example_interfaces packages, clone the examples repository to your workspace, and build:
sudo apt install -y ros-rolling-example-interfaces ros-rolling-test-msgs
mkdir -p workspace/src && cd workspace
git clone https://github.com/ros2-rust/examples.git src/examplesTemporarily (as of 2025-01-21), the rosidl_rust repository which contains the code generator needs to be cloned as well:
mkdir -p workspace/src && cd workspace
git clone https://github.com/ros2-rust/rosidl_rust.git src/rosidl_rustThe above commands can be removed once an updated version of the generator is shipped with the next ROS 2 sync.
Build the workspace:
. /opt/ros/rolling/setup.sh # Or source your ROS 2 installation
colcon buildFor ROS 2 Kilted, clone the ROS 2 message packages to your workspace:
mkdir -p workspace/src && cd workspace
git clone -b kilted https://github.com/ros2/common_interfaces.git src/common_interfaces
git clone -b kilted https://github.com/ros2/example_interfaces.git src/example_interfaces
git clone -b kilted https://github.com/ros2/rcl_interfaces.git src/rcl_interfaces
git clone -b kilted https://github.com/ros2/rosidl_core.git src/rosidl_core
git clone -b kilted https://github.com/ros2/rosidl_defaults.git src/rosidl_defaults
git clone -b kilted https://github.com/ros2/unique_identifier_msgs.git src/unique_identifier_msgsTemporarily (as of 2025-01-21), the rosidl_rust repository which contains the code generator needs to be cloned as well:
git clone https://github.com/ros2-rust/rosidl_rust.git src/rosidl_rustThe above command can be removed once an updated version of the generator is shipped with the next ROS 2 sync.
Build the workspace:
. /opt/ros/kilted/setup.sh
colcon buildFor ROS 2 Jazzy, you need to clone the code generator and message packages to your workspace:
mkdir -p workspace/src && cd workspace
git clone -b jazzy https://github.com/ros2/common_interfaces.git src/common_interfaces
git clone -b jazzy https://github.com/ros2/example_interfaces.git src/example_interfaces
git clone -b jazzy https://github.com/ros2/rcl_interfaces.git src/rcl_interfaces
git clone -b jazzy https://github.com/ros2/rosidl_core.git src/rosidl_core
git clone -b jazzy https://github.com/ros2/rosidl_defaults.git src/rosidl_defaults
git clone -b jazzy https://github.com/ros2/unique_identifier_msgs.git src/unique_identifier_msgs
git clone https://github.com/ros2-rust/rosidl_rust.git src/rosidl_rust
git clone https://github.com/ros2-rust/examples.git src/examplesBuild the workspace:
. /opt/ros/jazzy/setup.sh
colcon buildFor ROS 2 Humble, you need to clone the code generator and message packages to your workspace:
mkdir -p workspace/src && cd workspace
git clone -b humble https://github.com/ros2/common_interfaces.git src/common_interfaces
git clone -b humble https://github.com/ros2/example_interfaces.git src/example_interfaces
git clone -b humble https://github.com/ros2/rcl_interfaces.git src/rcl_interfaces
git clone -b humble https://github.com/ros2/rosidl_core.git src/rosidl_core
git clone -b humble https://github.com/ros2/rosidl_defaults.git src/rosidl_defaults
git clone -b humble https://github.com/ros2/unique_identifier_msgs.git src/unique_identifier_msgs
git clone https://github.com/ros2-rust/rosidl_rust.git src/rosidl_rust
git clone https://github.com/ros2-rust/examples.git src/examplesBuild the workspace:
. /opt/ros/humble/setup.sh
colcon buildAfter building, source your workspace and run the examples:
# In a new terminal (or tmux window)
. ./install/setup.sh
ros2 run examples_rclrs_minimal_pub_sub minimal_publisher
# In a new terminal (or tmux window)
. ./install/setup.sh
ros2 run examples_rclrs_minimal_pub_sub minimal_subscriberOr:
# In a new terminal (or tmux window)
. ./install/setup.sh
ros2 launch examples_rclrs_minimal_pub_sub minimal_pub_sub.launch.xmlFor detailed building instructions and additional setup options, see the in-depth guide.
| Back | FazBrowse Home | New Git URL |