Rust bindings for ROS2
This is a set of projects (bindings, code generator, examples and more) that enables developers to write ROS2 applications in Rust.
The current set of features include: - Generation of all builtin ROS types - Support for publishers and subscriptions - Tunable QoS settings
Lots of things! - An ament build type for Cargo. The current examples use CMake to install and build the binaries... and it's really ugly. - Component nodes - Clients and services - Tests - Documentation
rclrsinterface is very limited for now and might not be so much idiomatic yet, any help and suggestion on the interface would be greatly appreciated
You can build and run the example using the included Dockerfile:
git clone https://github.com/ros2-rust/ros2_rust.git docker build --tag ros2:rust . docker run -it --rm ros2:rust ros2 run rclrs_examples rclrs_publisher & ros2 run rclrs_examples rclrs_subscriber
Or do so manually as summarized in the steps below:
The following steps were last tested on Ubuntu 20.04.
# first, install vcstool from PyPI or apt: # sudo apt install ros-foxy-desktop ros-foxy-test-interface-files python3-vcstool libclang-dev clang # pip install vcstool
mkdir -p ~/ros2_rust_ws/src/ros2-rust cd ~/ros2_rust_ws/src/ros2-rust git clone https://github.com/ros2-rust/ros2_rust.git cd ../../ vcs import src < src/ros2-rust/ros2_rust/ros2_rust_foxy.repos source /opt/ros/foxy/setup.sh colcon build
Now you can just run a bunch of examples.
ros2 run rclrs_examples rclrs_publisher
ros2 run rclrs_examples rclrs_subscriber