ROS.NET+Unity HelloWorld

Well, since it first quietly hit github, people have inquired about ROS.NET and mono. It’s POSSIBLE, but presently requires pre-generating message code and/or precompiling DLLs on Windows.

Last week, I taught myself enough Unity to script a passable /tf visualizer.

ROS.NET_Unity

https://www.github.com/uml-robotics/ROS.NET_Unity (a wrapper around ROS.NET to facilitate precompilation/pregeneration forĀ use with Unity)

The current message generation implementation, is handled by a .NET executable that generates a C# project.

This wouldn’t be THAT much of a problem, but it presently assumes Windows filesystem paths work, that the system has msbuild.exe and .NET 3.5+ compatibility.

For the above proof of concept, I simply copy/pastad the dlls from the output directory of ROS.NET_UNity (after running buildme.bat) into …\Assets\Plugins\, and implemented a ros.net node in a unity script… ROS.Init, NodeHandle AND ALL!

To work cross-platform, the ROS_Comm, XmlRpc_Wrapper, and any other dependencies (tf.net, dynamic reconfigure, etc.) could be copied along with the generated Messages/ folderĀ INTO a unity project’s Assets directory, allowing them to be compiled by unity… but this requires previously generating the messages sources.

builds it with msbuild, then builds an intermediate project that modifies the generated source, and finally, plops a compiled Messages.dll into an output directory (a rough and sketchy first-stab with a few hundred fixes to deprecate cases, which deserves a reimplementation in an interpreted language at some point)