Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection problem between ROS2 in WSL2 and Unity in Windows(In ros2-for-unity) #107

Open
sdyby2006 opened this issue May 17, 2024 · 1 comment

Comments

@sdyby2006
Copy link

Hello! Thank you for your outstanding work.

I am trying to build a system, which includes using ROS2 robots and some of its tools.

However, I don't want to install ROS2 on Windows, as it doesn't meet my actual needs, so I installed ROS2 in WSL2 and have modified the system to RMW=rmw_cyclonedds_cppROS_DOMAIN_ID=42.

On Windows, I have installed Unity and used the standalone version of R2FU, and through the system environment, I have modified the system to RMW=rmw_cyclonedds_cpp, ROS_DOMAIN_ID=42.

But when the Unity project is running, it can't connect to the ROS2 system in WSL2.

I'm sorry, I don't know if there is any special instruction or setting to enable it.

I don't know where to write this request, so I decided to write it as a question.

Thank you for your help.

@s-m-asjad
Copy link

s-m-asjad commented Jun 21, 2024

This is not a problem with Unity - WSL2. Apparently, if one installs ROS2 on Windows and WSL2 on the same machine, the two are not able to communicate. This has something to do with the communication/firewall settings of WSL2 and windows.

The best you may achieve is seeing topic names being listed on WSL2 when you run a node on Windows but nothing more.

I had to install husarnet on both my Windows and WSL2 system to get around this issue. I also had a standalone build in Unity of R2FU for unrelated reasons, and the only way ROS2 nodes in Unity were able to talk to the ROS2 nodes in WSL2/any other machine was via husarnet.

P.S. I am not sure if it works without an explicit installation of ROS2 on Windows as well but you can give it a try since you now know that there is a limitation outside of Unity 😄

Edit:
fixing grammar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants