Hello everyone,
I’ve been struggling to establish communication between my HoloLens 2 and ROS (running on WSL) using ROS-TCP, and I would greatly appreciate any help or insights.
Setup:
- When I run my MR application in Unity on my laptop, everything works perfectly (ROS-TCP communication works between Unity and ROS), as Unity can communicate with ROS without issues.
- My laptop and HoloLens 2 are on the same local network, with valid IP addresses:
- Laptop IP:
192.168.x.xxx
- HoloLens 2 IP:
192.168.x.xxx
- ROS instance on WSL has an IP address of
172.25.xxx.xxx
.
- Laptop IP:
- I successfully set up and launched the ROS-TCP endpoint using
roslaunch ros_tcp_endpoint endpoint.launch
. The server starts and listens on port10000
. - I can’t ping the HoloLens 2 from my laptop or from ROS running on WSL.
- When testing the connection between HoloLens and WSL using
nc -zv 192.168.x.xxx 10000
from WSL, it fails. However, this command works fine for the laptop’s IP.
Problem explained based on my observation:
When I deploy the Unity application to the HoloLens 2, the connection with ROS does not work. The IP status on the configuration button in the HoloLens app does not update (I don’t see it turn green or red as it does in Unity on the laptop). Inputting the IP address using the number pad on the HoloLens app does not establish the connection.
Diagnostics and Observations:
- Despite being on the same network, my ROS instance in WSL always has the IP address
172.25.xxx.xxx
, even after changing the host network. Thus, I thought at first that this may be causing an issue, as this address is not in the same subnet as the HoloLens or laptop. Therefore, I tried the following:- I created a network bridge to forward traffic between the WSL IP (
172.25.xxx.xxx
) and my local network (192.168.x.x
) using port forwarding (netsh
commands). This allowed Unity on my laptop to communicate with ROS, but the HoloLens still could not connect. - I also tried using ROS bridge (another ROS communication that I was trying) instead of ROS-TCP, and same issue.
- I created a network bridge to forward traffic between the WSL IP (
- Thus, I think that the problem lies in the HoloLens’ ability to communicate with ROS or the WSL instance hosting ROS. After checking, I found out that I can’t disable the firewall on the HoloLens, as this is a part of the security. But I know that this should not cause me a problem. For further diagnosing, I configured inbound and outbound rules for port 10000 on my laptop and ensured that all devices were on a private network. Even with these adjustments, the problem persists.
Other things that I’ve tried:
- Changing the HoloLens and laptop’s network to a mobile hotspot to ensure they are on the same subnet.
- Running diagnostics commands like
ping
,nc
, andipconfig
to verify connectivity. - Hardcoding the ROS IP address directly into the Unity ConnectIP script for testing purposes.
- Adjusting the HoloLens settings to allow communication, such as enabling developer mode and configuring the network profile.
- Using both ROS bridge and ROS-TCP to establish the connection.
I would appreciate any feedback or help!
- I can see from tutorials that other developers successfully established communication between the HoloLens and ROS using ROS-TCP or ROS bridge, so are there specific HoloLens, WSL, or network settings I should configure to allow communication through port
10000
? - Could the issue be related to WSL’s IP (
172.25.xxx.xxx
) not being in the same subnet as the HoloLens or laptop? - Are there known limitations or configurations required for the HoloLens to communicate with devices on the same network?
I’ve been troubleshooting this for weeks, and while I’ve narrowed down the problem to the HoloLens communication with ROS, I’m stuck and would appreciate any help or advice. If anyone has encountered a similar issue or has suggestions, please let me know.
Thank you for taking the time to read this, and I look forward to your responses!
Best Regards,