ROS# on github.com/siemens/ros-sharp

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

ROS# consists of…

  • RosBridgeClient, a .NET API to ROS using rosbridge_suite on the ROS side.
  • UrdfImporter, a URDF file parser for .NET applications.
  • RosSharp.unitypackage, a Unity Asset package providing Unity-specific extensions to RosBridgeClient and UrdfImporter.

ROS# helps you to…

  • Communicate with ROS from within your Windows app:

    Subscribe and publish topics, call and advertize services, set and get parameters and use all features provided by rosbridge_suite. (See code example below.)

  • Import your robot’s URDF model as a Gameobject in Unity3D (video).

    Import the data either directly from the ROS system using the robot_description service or via a URDF file that you copied into your Unity Asset folder.

    UrdfImport

  • Control your real Robot via Unity3D (video)

    Teleoperation

  • Visualize your Robot’s actual state and sensor Data in Unity3D (video) (see image below).

  • Simulate your robot in Unity3D with the data provided by the URDF and without using a connection to ROS (see video and post below).

Beside visual components as meshes and textures, also Joint parameters and masses, CoMs, Inertia and Collider specifications of Rigidbodies are imported.

  • And much more! ROS# is useful for a wide variety of applications. Think about Machine Learning, Human-Machine Interaction, Tele-Engineering, Virtual Prototyping, Robot Fleet Operation, Gaming and Entertainment!

Got Interested?

Please do not hesitate to try it out yourself and to get in touch with us!
We are very interested in your feedback, applications, improvement suggestions, and contributions!


ROS# Development Team (ros-sharp.ct@siemens.com), Siemens AG, Corporate Technology, 2017

5 Likes

Code Example

A simple Publisher/Subscriber Example:

using System;
using RosSharp.RosBridgeClient;

// commands on ROS system:
// roscore
// rostopic echo /talker
// rostopic pub /listener std_msgs/String "World!"
// roslaunch rosbridge_server rosrbridge_websocket.launch

public class HelloWorld
{
    public static void Main(string[] args)
    {
        RosSocket rosSocket = new RosSocket("ws://192.168.0.101:9090");

        // Publication:
        int publication_id = rosSocket.Advertize("/talker", "std_msgs/String");

        StandardString message = new StandardString();
        message.data = "Hello!";
        rosSocket.Publish(publication_id, message);

        // Subscription Example:
        int subscription_id = rosSocket.Subscribe("/listener", "std_msgs/String", subscriptionHandler);

        Console.WriteLine("Press any key to close...");
        Console.ReadKey(true);
        rosSocket.Close();
    }
    private static void subscriptionHandler(Message message)
    {
        StandardString standardString = (StandardString)message;
        Console.WriteLine(standardString.data);
    }
}


1 Like

My post above was limited to 5 links and 2 pictures only :frowning_face:
…here is some additional media :

https://www.youtube.com/watch?v=cjp75A_HBSs

(2)
RVizUnity
(3)
Simulation

3 Likes

We get Texture2Ds in Unity which can be converted to Jpeg or Pngs and further base64 encodings. Can these video feed be transferred over RosBridge to convert it into an image topic?

Hi pushkalkatara,
you opened an issue on our Github project site with the same question yesterday. We already gave you an answer there: