![]() |
rclnet repositorycsharp dotnet ros ros2 rcl custom_msgs example_action_server example_service fake_clock graph_monitor perf_publisher perf_subscriber turtle_circling turtle_clear turtle_pose turtle_rotate ros2cs_test_msgs rclnet_tests Company.Node1 |
Repository Summary
Description | Modern ROS 2 client library for .NET. |
Checkout URI | https://github.com/noelex/rclnet.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-09-28 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | csharp dotnet ros ros2 rcl |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
custom_msgs | 0.0.0 |
example_action_server | 1.0.0 |
example_service | 1.0.0 |
fake_clock | 1.0.0 |
graph_monitor | 1.0.0 |
perf_publisher | 1.0.0 |
perf_subscriber | 1.0.0 |
turtle_circling | 1.0.0 |
turtle_clear | 1.0.0 |
turtle_pose | 1.0.0 |
turtle_rotate | 1.0.0 |
ros2cs_test_msgs | |
rclnet_tests | 0.0.0 |
Company.Node1 | 1.0.0 |
README
rclnet
rclnet is a fast and easy-to-use .NET wrapper over ROS 2 client library, allowing .NET applications to interact with other ROS applications.
What’s New in 2.0
- Added support for .NET 10 and changed minimum supported .NET version to 8.0
- ROS 2 Kilted Support
- ROS 2 Jazzy Support by @AlrayQiu (#39)
- Simplified message generation workflow by @ha-ves (#38)
- String pooling is now disabled by default
Features
- Completely asynchronous and
async
/await
friendly. - Flexible asynchronous scheduling control to fit rclnet into existing applications.
- Unified message generation for POCOs and blittable structures.
- Intuitive ROS graph querying and monitoring APIs.
- Easy-to-use POCO-based APIs.
- Fast and zero managed heap allocation APIs operating directly on native message buffers.
- Single package with runtime support for different ROS 2 distros.
- Builtin support for querying topic messages and ROS graph events with Reactive Extensions.
Supported ROS Features
| Feature | Status | Additional Information |
| ———————– | —— | ——————————————————————————————————————————————————————————————————————————————– |
| Topics | ✅ | N/A |
| Services | ✅ | N/A |
| Actions | ✅ | Managed implementation. |
| Clocks | ✅ | Supports external time source by setting use_sim_time
to true
.CancellationTokenSource
s can also be configured to cancel with timeout measured by external clock. |
| Timers | ✅ | N/A |
| Guard Conditions | ✅ | N/A |
| Events | ✅ | Event handlers can be registered via SubscriptionOptions
or PublisherOptions
when creating the subscirption or publisher. |
| ROS Graph | ✅ | Managed implementation. |
| Logging | ✅ | Supports logging to stdout, /rosout and log files. Configurable with --ros-args
. |
| Content Filtered Topics | ✅ | Available since humble.
| Network Flow Endpoints | ✅ | Available since galactic.
Network flow endpoints of publishers and subscriptions can be retrieved via IRclPublisher.Endpoints
and IRclSubscription.Endpoints
property.
Unique network flow endpoints requirement can be configured when creating SubscriptionOptions
and PublisherOptions
.|
| Service Introspection | ✅ | Available since iron. |
| Parameter Service | ⚠️ | Supports loading parameters from command-line arguments and parameter files.
Locally declared parameters are exposed via Parameter API.
Parameter client is not implemented. |
| Lifecycle Nodes | ❌ | N/A |
✅Supported ⚠️Partial support ❌Not supported ⏳In development
Supported Platforms
Supported .NET Versions:
- .NET 8
- .NET 9
- .NET 10
Supported ROS 2 Distributions:
- Foxy Fitzroy
- Humble Hawksbill
- Iron Irwini
- Jazzy Jalisco
- Kilted Kaiju
Supported Operating Systems:
- Ubuntu
- Windows
Should also work on macOS but untested.
Installing
Stable releases of rclnet are hosted on NuGet. You can install them using the following command:
dotnet add package Rcl.NET
Generating Messages
Preparation
rclnet does not ship with message definitions. In order to communicate with other ROS 2 nodes, you need to generate messages first.
Message definitions are .NET classes / structs, you can either include messages in a console app which runs as an ROS 2 node, or compile separately in another library.
Projects containing messages will have to meet the following requirements:
-
Rcl.NET
(orRosidl.Runtime
if you are not using automated codegen) NuGet package is installed. -
AllowUnsafeBlocks
is set totrue
. This can be done by adding the following lines to the.csproj
file:
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
- Runtime marshalling for the assembly is disabled. You can add the following line to somewhere in the source code of the project:
[assembly: System.Runtime.CompilerServices.DisableRuntimeMarshalling]
To generate messages, you also need to add a ros2cs.spec
file to somewhere in the project (usually the project root).
A ros2cs.spec
file contains configurations such as output directory and where to find packages,
see here for detailed explanations.
Generating messages using automated codegen
Now simply build the project and message definitions should appear in a directory named Ros2csGeneratedInterfaces
.
The path to the spec file and output directory can also be customized using Ros2csSpecFile
and Ros2csOutputDir
MSBuild property, e.g.:
```xml
File truncated at 100 lines see the full file