![]() |
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-05-13 |
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.
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 7
- .NET 8
- .NET 9
Supported ROS 2 Distributions:
- Iron Irwini
- Humble Hawksbill
- Foxy Fitzroy
Supported Operating Systems:
- Ubuntu
- Windows
Should also work on macOS but untested.
Getting Started
rclnet provides project templates to help you getting started quickly. You can install the templates using the following command:
dotnet new install Rcl.NET.Templates
Then, to create a node application:
mkdir MyNode
cd MyNode
dotnet new ros2-node
To create a message only library:
mkdir MyMessageLibrary
cd MyMessageLibrary
dotnet new ros2-msg
If you prefer creating the projects by yourself, or want to use rclnet in existing projects, refer the Installing and Generating Messages section.
Installing
Stable releases of rclnet are hosted on NuGet. You can install them using the following command:
dotnet add package Rcl.NET
For message only projects, you can install only Rosidl.Runtime
without Rcl.NET
:
dotnet add package Rosidl.Runtime
To generate message classes, you’ll also need to install ros2cs
utility:
dotnet tool install -g ros2cs
Generating Messages
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
NuGet package is installed. -
AllowUnsafeBlocks
is set totrue
. This can be done by adding the following lines to the.csproj
file:
```xml
File truncated at 100 lines see the full file