Giter Site home page Giter Site logo

rosbridge_client_dot_net's Introduction

Note: This repository is archived as I no longer have an environment or up-to-date ROS/.NET knowledge to properly review PRs, add new features or fix bugs. Please fork the repository if you would like to add new features or fix bugs. -- Stefan


Rosbridge .NET Client

This is a .NET library which provides a client for the Rosbridge Suite.

Overview

The Visual Studio solution comes with three projects:

  • rosbridge_client_common : The common part of the library
  • rosbridge_client_socket_for_desktop : The WPF part of the library (for Windows desktop applications)
  • rosbridge_client_example_wpf : Windows desktop applications example

Current Status

Publishing and subscribing to a topic and calling a service are implemented:

using Rosbridge.Client;


// Start the message dispatcher
var md = new MessageDispatcher(new Socket(new Uri("ws://localhost:9090")), new MessageSerializerV2_0());
await md.StartAsync();


// Subscribe to a topic 
var subscriber = new Subscriber("/my_topic", "std_msgs/String", md);
subscriber.MessageReceived += (s, e) =>
            {
                dynamic message = e.Message;
                
                // A std_msgs/String message looks like { "msg" : { "data" : <content> } }
                string content = message.msg.data;
            };
await subscriber.SubscribeAsync();


// Publish to a topic
var publisher = new Publisher("/my_topic", "std_msgs/String", md);
await publisher.AdvertiseAsync();
await publisher.PublishAsync(new { data = "Hello World" });


// Call a service
var serviceClient = new ServiceClient("/add_two_ints", md);
List<dynamic> args = new List<dynamic>();
args.Add(10);
args.Add(2);
var result = serviceClient.Call(args);

// Clean-up
await subscriber.UnsubscribeAsync();
await publisher.UnadvertiseAsync();
await md.StopAsync();

rosbridge_client_dot_net's People

Contributors

zeltner avatar

Watchers

James Cloos 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.