Git Product home page Git Product logo

ros-sharp's Introduction

ROS#

ROS# is a set of open source software libraries and tools in C# for communicating with ROS from .NET applications, in particular Unity.

Here are some showcases illustrating what can be done with ROS#. Community provided a variety of other application examples for ROS# here. Please don't hesitate to post yours!

UWP / HoloLens

Notes On This Fork

This fork has some changes to allow ROS# to be used in UWP projects, such as the Microsoft HoloLens (1 & 2 - tested and deployed successfully). Like the main ROS# branch, use 2019.x or later.

How to get started

Step 1: Clone this project

Step 2, Option 1: Open the Demo Project and copy its content. It is setup in a way, that it is buildable for UWP applications and should work right out of the box.

Step 2, Option 2: Follow these instructions:

  • Create a new Unity Project or use an existing one
  • Copy the RosSharp folder into the Assets Folder of your project
  • Configure the RosBridgeClientUWP.dll to be used for the WSA platform and disable it for all other platforms
  • Configure the RosBridgeClient.dll to be excluded for the WSA platform.
  • Copy the NewtonSoft AOT version into your project (e.g. Assets/Plugins) You don't have to configure any targetplatforms as with the RosBridgeclient(UWP) dlls, since they should be configured correctly. The original source of this is here

It is important that the link.xml file is somewhere within the /Assets/ folder of the Unity Project. The reasons for that are described here. Basically, Unity's IL2CPP compiler strips away unused code. Since RosSharp works with classes that are never really used but only serialized to be sent via WebSockets, many of these "unused" fields and properties are removed, resulting in (almost) empty json-strings. The link.xml file tells Unity's IL2CPP compiler to not strip any code from the specified assemblies.

With this setup your project should work in Editor Mode and in UWP-Mode.

The simple Demo-App subscribes to the /clock topic and displays the values received. This was successfully deployed to HoloLens 2 deployed RosSharp UWP to HoloLens2

How it works

There are four main changes to the original Ros-Sharp repository

  1. AOT compilability The original RosSharp uses reflection and the normal NewtonSoft Json library, which are not AOT compilable and fail to work after Unity's IL2CPP compiler process the files. There were some changes made to the library to not use reflection, and also a AOT compilable version of NewtonSoft Json is included in the Demo-Project
  2. Websockets Prev. another than the default version for Websockets was needed, but the newer version of WebSocketSharp works fine for UWP projecst
  3. UWP DLL The DLL was created by creating a UWP class library project, and then linking all folders from the original library. The including part is done in the project file. Obj, Bin and Properties folders were of course excluded.
  4. Compiler constants / defines Some parts of the library and Unity Scripts needed some platform specific code, which was done with the "WINDOWS_UWP" compiler constant.

Compatibile With Mixed Reality Toolkit

This branch is compatible with Microsoft's Mixed Reality Toolkit. Tested with v. 2.4 and 2.3

Please see the Wiki, especially Section 3.2, for an explanation of how to use the new framework.

Contents

Licensing

ROS# is open source under the Apache 2.0 license and is free for commercial use.

External Dependencies

RosBridgeClient and UWP requires:

Further Info


© Siemens AG, 2017-2020

Author: Dr. Martin Bischoff ([email protected])

ros-sharp's People

Contributors

martinbischoff avatar ericvoll avatar dwhit avatar roehrlverena avatar jeremyfix avatar luchspeter avatar berkayalpcakal avatar reitdan avatar sye8 avatar suzannahsmith1 avatar suzannahsmith avatar nicolas-schreiber avatar odydoum avatar gris-martin avatar flonou avatar akirayou avatar awesome-manuel avatar ooeygui avatar tarukosu avatar matthewberg avatar erdenbatuhan avatar dmitterberger avatar zchen24 avatar reinbert avatar rwarrier243 avatar nicolapiccinelli avatar nlamprian avatar mischaro avatar lukaskern avatar 65usami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.