ros2-dotnet/ros2_dotnet

How can use it in the unity under Linux?

Andor233 opened this issue · 4 comments

I'm a developer who is creating a simulation environment for Robot. Our robot is running under Linux, So How can use it in the unity under Linux?

You would need some additional effort for that. Assemblies and native libraries (dll and so files) built by this project need to be in proper Plugin directories of Unity. Then, there is some magic that needs to be done on Unity side (with environment variables) and scripts that wrap around the C# library in Unity-friendly way. Additionally, FastRTPS and UnityPlayer libraries conflict for current version, but you can make it work with CycloneDDS.

There is a couple of important things missing still, though the project is on a good way to fill the gaps (I am taking about array types in message generation such as you would want for PointCloud2 ros2 messages coming from your lidar).

Since we (Robotec.AI) are using such Unity plugin with full message support for quite a while already in our company, I could help you go through the process. Also, if you need a demo, just let me know. But also you can wait for us to release it open source along with our ros2 C# project that was built based on a fork of ros2_dotnet. I hope to contribute back to this project once we get a release, especially because it picked the pace and has a good leadership.

Edit: you can also take a look at this project: https://github.com/DynoRobotics/UnityRos2. We cooperated for some time before each going own way.

My unity version is 2020, and it doesn't conflict with FastRTPS. It seems like works fine.
By the way, how can I use custom message?

You need to run cs generator with these messages - easiest way is to drop the message package into build tree and add it to dependencies. The register hooks for the generator will take care of the rest

Dear @adamdbrw, there are updates on unity implementation of ros2_dotnet?