{"id":13676687,"url":"https://github.com/ros2-dotnet/ros2_dotnet","last_synced_at":"2025-04-29T07:33:10.201Z","repository":{"id":12467936,"uuid":"71452375","full_name":"ros2-dotnet/ros2_dotnet","owner":"ros2-dotnet","description":".NET bindings for ROS2","archived":false,"fork":false,"pushed_at":"2024-12-03T14:07:30.000Z","size":395,"stargazers_count":157,"open_issues_count":42,"forks_count":60,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-20T05:48:59.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ros2-dotnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-20T10:31:22.000Z","updated_at":"2025-04-16T20:22:06.000Z","dependencies_parsed_at":"2024-01-05T20:58:22.965Z","dependency_job_id":"9cd02ed9-10ee-482e-b6de-b299bcdd6c6f","html_url":"https://github.com/ros2-dotnet/ros2_dotnet","commit_stats":null,"previous_names":["esteve/ros2_dotnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2-dotnet%2Fros2_dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2-dotnet%2Fros2_dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2-dotnet%2Fros2_dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2-dotnet%2Fros2_dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ros2-dotnet","download_url":"https://codeload.github.com/ros2-dotnet/ros2_dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251456057,"owners_count":21592285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:00:31.393Z","updated_at":"2025-04-29T07:33:05.176Z","avatar_url":"https://github.com/ros2-dotnet.png","language":"C#","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"ROS2 for .NET\n=============\n\n| Target | Status |\n|----------|--------|\n| **Linux** | [![Build (Linux)](https://github.com/ros2-dotnet/ros2_dotnet/actions/workflows/build_linux.yml/badge.svg)](https://github.com/ros2-dotnet/ros2_dotnet/actions/workflows/build_linux.yml) |\n| **Windows Desktop** | [![Build (Desktop)](https://github.com/ros2-dotnet/ros2_dotnet/actions/workflows/build_desktop.yml/badge.svg)](https://github.com/ros2-dotnet/ros2_dotnet/actions/workflows/build_desktop.yml) |\n\n_Windows UWP CI Builds are currently disabled, see [this issue](https://github.com/ros2-dotnet/ros2_dotnet/issues/92) for more information._\n\nIntroduction\n------------\n\nThis is a collection of projects (bindings, code generator, examples and more) for writing ROS2\napplications for .NET Core and .NET Standard.\n\nFeatures\n--------\n\nThe current set of features include:\n- Generation of all builtin ROS types\n- Support for publishers and subscriptions\n- Support for clients and services\n- Support action clients and servers\n- Cross-platform support (Linux, Windows, Windows IoT Core, UWP)\n\nWhat's missing?\n---------------\n\nLots of things!\n- Unicode types\n- String constants (specifically BoundedString)\n- Component nodes\n- Tests\n- Documentation\n- More examples (e.g. IoT, VB, UWP, HoloLens, etc.)\n\nSounds great, how can I try this out?\n-------------------------------------\n\nFirst of all install the standard ROS2 dependencies for your operating system\nof choice (**NOTE**: only do this if building Windows Desktop or Linux. For UWP,\nsee the relevant section below): https://github.com/ros2/ros2/wiki/Installation#building-from-source\n\nNext make sure you've either installed .Net Core (preferred)\nhttps://www.microsoft.com/net/learn/get-started or Mono\nhttps://www.mono-project.com/. (**NOTE**: For building unit tests, .NET 6 is\nrequired).\n\nFor running on Linux or Windows Desktop, one can build `ros2_dotnet` (along with\nall desired packages containing interface definitions) as an overlay on top\nof an existing ROS2 installation. The `ros2_dotnet_foxy.repos` contains all\nnecessary repositories to build the core `ros2_dotnet` project along with all\nstandard ROS2 interface packages. If you are using other packages which provide\ninterface definitions, those must also be included in the `ros2_dotnet` workspace\nin order for .NET bindings to be generated. (NOTE: if you wish to build the\ncore of ROS2 from source, everything through the `rcl` layer is required.)\n\nFor running within UWP (Universal Windows Platform) applications, the entire\ncore of ROS2 must be compiled for UWP compatibility.\n\nWindows (Desktop)\n-----------------\nAssuming you've installed ROS2 (pre-built binary packages) to the directory\nc:\\dev\\ros2_foxy per the official [installation instructions](https://index.ros.org/doc/ros2/Installation/Foxy/Windows-Install-Binary/),\nrun the following from an Administrator Visual Studio 2019 Developer Command\nPrompt:\n\n(**NOTE**: Building as an overlay on top of *binary* distributions of ROS2 has\npresented some challenges. As of this writing, you may also need to include the\n`rosidl` package due to some unicode/locale compatibility problems.\nThis is done for you below in the line preceding `colcon build`. This step\ncan/should be omitted if building on top of a built-from-source ROS2 workspace)\n\n```\ncall \\dev\\ros2_foxy\\local_setup.bat\nmd \\dev\\ros2_dotnet_ws\\src\ncd \\dev\\ros2_dotnet_ws\ncurl -sk https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/main/ros2_dotnet_foxy.repos -o ros2_dotnet_foxy.repos\nvcs import \\dev\\ros2_dotnet_ws\\src \u003c ros2_dotnet_foxy.repos\ngit clone --branch foxy https://github.com/ros2/rosidl src\\ros2\\rosidl\ncolcon build --merge-install\n```\n\n\nLinux\n-----\nAssuming ROS2 foxy installed to the standard location, run the following commands:\n```\nsource /opt/ros/foxy/setup.bash\nmkdir -p ~/ros2_dotnet_ws/src\ncd ~/ros2_dotnet_ws\nwget https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/main/ros2_dotnet_foxy.repos\nvcs import ~/ros2_dotnet_ws/src \u003c ros2_dotnet_foxy.repos\ncolcon build\n```\n\nUniversal Windows Platform (Win32, Win64)\n----------------------------------------------\nWe'll build this in two steps, first `ament` (the build system) and related tools\nwhich will run natively on the host, followed by ROS2 itself, built for UWP and\nthe target architecture.\n\nIf you have previously installed ROS2 dependencies (OpenSSL, tinyxml, log4cxx,\netc) it is strongly recommended to uninstall those dependencies before building\nto avoid any non-UWP binaries getting pulled into the build.\n\nament\n-----\n\n```\nmd \\dev\\ament\\src\ncd \\dev\\ament\ncurl -sk https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/main/ament_dotnet_uwp.repos -o ament_dotnet_uwp.repos\nvcs import src \u003c ament_dotnet_uwp.repos\ncolcon build --merge-install\ncall install\\local_setup.bat\n```\n\nUWP\n---\n\nReplace `%TARGET_ARCH%` with Win32 or x64\n\n```\nmd \\dev\\ros2\\src\ncd \\dev\\ros2\ncurl -sk https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/main/ros2_dotnet_uwp.repos -o ros2_dotnet_uwp.repos\nvcs import src \u003c ros2_dotnet_uwp.repos\ncd \\dev\\ament\ncall install\\local_setup.bat\ncd \\dev\\ros2\ncolcon build --merge-install --packages-ignore rmw_fastrtps_dynamic_cpp rcl_logging_log4cxx rcl_logging_spdlog ros2trace tracetools_launch tracetools_read tracetools_test tracetools_trace --cmake-args -A \"%TARGET_ARCH%\" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.17763 -DTHIRDPARTY=ON -DINSTALL_EXAMPLES=OFF -DBUILD_TESTING=OFF -DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop\n```\n\nNow you can just run a bunch of examples.\n\n### Publisher and subscriber\n\nPublisher:\n\nWindows\n-------\n\n```\ncall \\dev\\ros2_dotnet_ws\\install\\local_setup.bat\n\nros2 run rcldotnet_examples rcldotnet_talker\n```\n\nLinux\n-----\n\n```\n. ~/ros2_dotnet_ws/install/local_setup.sh\n\nros2 run rcldotnet_examples rcldotnet_talker\n```\n\nSubscriber:\n\nWindows\n-------\n\n```\ncall \\dev\\ros2_dotnet_ws\\install\\local_setup.bat\n\nros2 run rcldotnet_examples rcldotnet_listener\n```\n\nLinux\n-----\n\n```\n. ~/ros2_dotnet_ws/install/local_setup.sh\n\nros2 run rcldotnet_examples rcldotnet_listener\n```\n\nEnjoy!\n\n## Using generated DLLs in your UWP application from Visual Studio\n\nCreate a new Visual Studio project (Visual C# - Windows Universal - Empty app).\n\nIn Solution Explorer panel:\n```\nright click on Universal Windows project - Add - Existing item...\n```\nand include every DLL file from `{your_ros2_uwp_ws}\\install\\bin`. Now select all of these files in Solution Explorer and check/set the properties:\n```\nBuild action: Content\nCopy to output directory: Copy always\n```\nThis allows you to retrieve the files in the same directory as the assembly.\n\nNext step, in Solution Explorer panel:\n```\nright click on References - Add reference...\n```\nand include `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_assemblies.dll`, `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_common.dll` and `{your_ros2_uwp_ws}\\install\\lib\\std_msgs\\dotnet\\std_msgs_assemblies.dll`.\n\nNow you can include your ROS2 code in MainPage.xaml.cs script, compile your project and run it on HoloLens Emulator or HoloLens physical device.\n\n## Using generated DLLs in your UWP application from Unity\n**NOTE: _Tested on `Unity 2018.2.8f1`_**\n\nCreate a new Unity project and set up the following editor properties.\n\n### Build Settings\nSet your target platform properly:\n```\nFile - Build Settings - Universal Windows Platform - Switch Platform\n```\nthen set UWP build settings:\n```\nTarget Device: HoloLens\nBuild Type: D3D\nSDK: Latest installed\nVisual Studio Version: Latest installed\nBuild and Run on: Local Machine and Windows Phone\nBuild Configuration: Release\n```\nand let unchecked the rest.\n\n### Player Settings\n\n- Other Settings\n\n  **Configuration**\n  ```\n  Scripting Runtime Version: .NET 4.x Equivalent\n  Scripting Backend: .NET\n  Api Compatibility Level: .NET 4.x\n  ```\n\n- Publishing Settings\n\n  **Capabilities**\n  - [x] InternetClient\n  - [x] InternetClientServer\n  - [x] PrivateNetworkClientServer\n\n- XR Settings\n  - [x] Virtual Reality Supported\n\n  Virtual Reality SDKs\n    \u003e Windows Mixed Reality\n\n### Add files\nCreate Assets/Plugins and Assets/Scripts folders.\n\nIn Plugins folder include every DLL file from `{your_ros2_uwp_ws}\\install\\bin`. Also include `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_assemblies.dll`, `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_common.dll` and `{your_ros2_uwp_ws}\\install\\lib\\std_msgs\\dotnet\\std_msgs_assemblies.dll`.\n\nIn Scripts folder create your C# scripts and attach them to a scene GameObject to execute them when the app starts.\n\nFinally, build your project to generate a Visual Studio solution.\n```\nFile - Build Settings - Build\n```\n\n### Unity generated Visual Studio solution\nOpen the VS solution generated after building your Unity project.\nIn Solution Explorer panel:\n```\nright click on Universal Windows project - Add - Existing item...\n```\nand include every DLL file from `{your_ros2_uwp_ws}\\install\\bin`. Now select all of these files in Solution Explorer and check/set the properties:\n```\nBuild action: Content\nCopy to output directory: Copy always\n```\nThis allows you to retrieve the files in the same directory as the assembly.\n\nNext step, in Solution Explorer panel:\n```\nright click on References - Add reference...\n```\nand include `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_assemblies.dll`, `{your_ros2_uwp_ws}\\install\\lib\\rcldotnet\\dotnet\\rcldotnet_common.dll` and `{your_ros2_uwp_ws}\\install\\lib\\std_msgs\\dotnet\\std_msgs_assemblies.dll`.\n\nFinally compile your project for UWP (32 bits) and run it on HoloLens Emulator or HoloLens physical device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fros2-dotnet%2Fros2_dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fros2-dotnet%2Fros2_dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fros2-dotnet%2Fros2_dotnet/lists"}