RosSharpは、ROSのC#クライアントライブラリです。
ROS は Willow Garage の開発するRobot Operating Systemです。
- Author: zoetrope
- Source: https://github.com/zoetrope/RosSharp
- License: BSD License
- RosSharp is implemented based on Reactive Extensions
- NuGet installation support
- Create ROS Node
- Master/Slave/ParameterServer API XML-RPC Client
- Master/Slave/ParameterServer API XML-RPC Server
- Topic (TCPROS) Connection
- Service Connection
- RosOut (Logging Node)
- RosCore (Master Server & Parameter Server & RosOut Node)
- GenMsg (Code generation tool from .msg/.srv files)
- Remapping Arguments
- Graph Resource Names (supports only the global name)
- Clock Node
- roslang
- .NET Framework 4
- Reactive Extensions
- Common.Logging
- XML-RPC.NET
- NDesk.Options
- F# Runtime 2.0 (for GenMsg)
- FParsec (for GenMsg)
RosSharpをインストールするには、NuGet Package Manager Consoleから下記のコマンドを実行してください。(準備中) :
PM> Install-Package RosSharp
https://github.com/zoetrope/RosSharp/downloads
ROS.HostName = "192.168.1.11";
ROS.MasterUri = new Uri("http://192.168.1.10:11311");
ROS.TopicTimeout = 3000;
ROS.XmlRpcTimeout = 3000;
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="rossharp" type="RosSharp.ConfigurationSection, RosSharp"/>
</configSections>
<rossharp>
<ROS_MASTER_URI value="http://localhost:11311"/>
<ROS_HOSTNAME value="localhost"/>
<ROS_TOPIC_TIMEOUT value="1000"/>
<ROS_XMLRPC_TIMEOUT value="1000"/>
</rossharp>
</configuration>
- ROS_MASTER_URI
- ROS_HOSTNAME
- ROS_TOPIC_TIMEOUT
- ROS_XMLRPC_TIMEOUT
LogManager.Adapter = new RosOutLoggerFactoryAdapter(properties);
see the Common.Logging Documentation
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="RosSharp.RosOutLoggerFactoryAdapter, RosSharp">
<arg key="level" value="DEBUG" />
<arg key="showLogName" value="true" />
<arg key="showDataTime" value="true" />
<arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
</factoryAdapter>
</logging>
</common>
</configuration>
using RosSharp;
ROS.Initialize();
var node = ROS.CreateNode("Test");
var subscriber = node.CreateSubscriber<RosSharp.std_msgs.String>("/chatter");
subscriber.Subscribe(x => Console.WriteLine(x.data));
var publisher = node.CreatePublisher<RosSharp.std_msgs.String>("/chatter");
publisher.OnNext(new RosSharp.std_msgs.String {data = "test"});
node.RegisterService("/add_two_ints",new AddTwoInts(req => new AddTwoInts.Response {c = req.a + req.b})).Wait();
var proxy = node.CreateProxy<AddTwoInts>("/add_two_ints").Result;
var res = proxy.Invoke(new AddTwoInts.Request() {a = 1, b = 2});
Console.WriteLine(res.c);
var param = node.GetParameter<string>("rosversion");
Console.WriteLine(param.Value);
param.Value = "test";
param.Subscribe(x => Console.WriteLine(x));
RosCore is
- a ROS Master
- a ROS ParameterServer
- a rosout logging node
http://www.ros.org/wiki/roscore
> RosCore -p 11311
GenMsg is a tool that code generation from .msg / .srv format files.
> GenMsg -t msg -i "..msgroslib" "..msgroslibTime.msg"