Use RosBridgeClient to connect .NET to ROS
masterrosbridge_suite. It acts as a client for the Rosbridge protocol, allowing you to interact with ROS topics, services, and parameters from a .NET environment.repository·master·Indexed 22 days ago
https://github.com/siemens/ros-sharpAn open-source set of C# libraries and tools enabling communication between .NET applications, specifically Unity, and the Robot Operating System (ROS). Version 2.2.0 provides a ROS bridge via RosBridgeClient, a URDF parser, and the MessageGeneration library and ConsoleTool for creating strongly-typed C# classes from ROS messages, services, and actions. It is available as a Unity Package Manager (UPM) package or via NuGet for standalone .NET projects.
rosbridge_suite. It acts as a client for the Rosbridge protocol, allowing you to interact with ROS topics, services, and parameters from a .NET environment.The ROS# .NET solution (RosSharp.sln) is composed of several specialized libraries that enable communication and data handling between .NET applications and ROS:
rosbridge_suite.UrdfImporter library provides a parser for URDF (Unified Robot Description Format) files designed for use in .NET applications. It allows developers to load and interpret robot descriptions defined in URDF format within a .NET environment.The MessageGenerationConsoleTool is a command-line utility used to generate C# source code for ROS messages, services, and actions. This allows you to use custom ROS definitions within your ROS# enabled Unity projects.
For detailed instructions on handling new message types, refer to the official ROS# Wiki.
The MessageGeneration library is a .NET library designed to automate the creation of C# source code that represents ROS message, service, and action types. This allows Unity or other .NET applications to communicate with ROS using strongly-typed C# classes instead of raw byte streams.
For detailed instructions on how to handle new or custom message types, refer to the official ROS# Wiki page on New Message Types.
The repository is organized into distinct areas depending on whether you are working in Unity or a pure .NET environment:
com.siemens.ros-sharp/)This directory contains the UPM package.
Runtime/: Core ROS# .NET scripts and components for Unity.Editor/: Unity editor scripts for UI extensions.Plugins/: External dependencies with specific versions.Samples~/: Example scenes and code (must be imported via the Package Manager window).Libraries/)Contains the underlying .NET logic used by both Unity and standalone .NET projects.
RosBridgeClient/: Core library for communicating with ROS via WebSockets.MessageGeneration/: Tools to generate C# classes from ROS message definitions (supports ROS1 and ROS2).Urdf/: Library for parsing URDF files and creating Unity GameObjects.PostBuildEvents/: OS-specific scripts for post-build processes.ROS Packages/)Contains ROS packages used for tutorials, testing, and demonstrations.
If you are upgrading from an older version of ROS# (prior to 2.0.0), note the change in how libraries are distributed:
MessageGeneration.dll, RosBridgeClient.dll, and UrdfImporter.dll) to be placed in the Unity Plugins/ folder.In current versions, Unity generates the necessary DLLs itself using the assembly definition files included within the Unity package, ensuring better compatibility with the Unity editor's build system.
For non-Unity .NET applications, you can install the required ROS# packages individually from the NuGet Gallery. This allows you to use ROS# libraries in any compatible .NET environment.
https://www.nuget.org/profiles/MartinBischoffTo integrate ROS# into a Unity project, use the Unity Package Manager (UPM) to add the package directly from the Git repository. This method installs the custom Unity UPM package located in the com.siemens.ros-sharp directory, which includes the .NET solution, Unity-specific scripts, and samples.
https://github.com/siemens/ros-sharp.git?path=/com.siemens.ros-sharphttps://github.com/siemens/ros-sharp.git?path=/com.siemens.ros-sharpThe File Server package allows for transferring URDF (Unified Robot Description Format) files between ROS and Unity. This is useful for synchronizing robot models across different simulation environments.
Key tasks include:
The ROS# package includes example scenes and reference code located in the Samples~ directory. These are not automatically added to your project assets to avoid clutter. To use them:
Assets folder.