RosLibRust
Documentation about the crate is on docs.rs, extended guides can be found on roslibrust.github.io
An async rust library for interfacing with ROS1 and ROS2, built on Tokio.
- One Trait Based API - Write your behavior once and use it with any backend! Select the backend you want to use at compile time.
- Pure Rust - No ROS1 or ROS2 dependencies or installation required! Compile time message generation from .msg/.srv files.
This allows writing generic behaviors like:
# use *;
use ;
async
async
All of this is backed by common traits for ROS messages, topics, and services. roslibrust_codegen provides generation of Rust types from both ROS1 and ROS2 .msg/.srv files and
roslibrust_codegen_macro provides a convenient macro for generating these types:
// Will generate types from all packages in ROS_PACKAGE_PATH
find_and_generate_ros_messages!;
If you want to see what the generated code looks like checkout our generated messages in our test crate.
While the macro is useful for getting started, we recommend using roslibrust_codegen with a build.rs as shown in example_package.
This allows cargo to know when message files are edited and automatically re-generate the code.
Getting Started / Examples
- Checkout the Quick Getting Started Guide for a brief guide on how to get started with RosLibRust.
- Checkout the Extended Getting Started Guide for a more in depth guide on how to get started with RosLibRust.
- Examples can be found in examples.
Contributing
Contribution through reporting of issues encountered and implementation in PRs is welcome! Before landing a large PR with lots of code implemented, please open an issue if there isn't a relevant one already available and chat with a maintainer to make sure the design fits well with all supported platforms and any in-progress implementation efforts.
We uphold the rust lang Code of Conduct.
Minimum Supported Rust Version / MSRV
MSRV is currently 1.85 to support edition 2024.