RobotecAI / ros2-for-unity

High-performance ROS2 solution for Unity3D
Apache License 2.0
448 stars 58 forks source link

running my Unity software on Windows and ROS2 foxy on Linux(virtualbox) #59

Closed jitliang closed 1 year ago

jitliang commented 1 year ago

Hi, I have been trying to connect my Unity project to ROS2 by following the tutorial here . However, I have been unsuccessful. Currently, I am running my Unity software on Windows and ROS2 foxy on Linux(virtualbox). This means both Unity and ROS2 are running in the same PC, however under different OS. May I know which pre-built releases should I download? Under such setup, can your module still work? Thanks!

Describe the bug

/chatter is not detected at ROS2.

Desktop (please complete the following information):

OS : Ubuntu20.04 ros2 distro : foxy ros2-for-unity version : 1.2.0 Release ros2cs version : 1.2.0 Release ros2 dds middleware : fast-dds ros2 environment setup : single pc, local network Unity editor version : 2020.3.26f1

pijaro commented 1 year ago

Can you confirm the ROS2 communication between Windows (host machine) and Ubuntu (virtualbox) works well? Often the virtualbox OSes are behind NAT and the communication might be blocked.

Try to check:

  1. run ros2 topic pub /test std_msgs/String "data: test" in one OS and tos2 topic echo /test on the other,
  2. check ros2 multicast receive on one, and ros2 multicast send on the second.

You should be able to see the topic, and the multicast should succeed. If it is not the case, most probably you have to fix your network interface in virtualbox.

cuhde commented 1 year ago

I have the same issue with a separate PC running Ubuntu 20.04 and ROS2 Foxy. ros2-for-unity 1.2.0 release for Win10 x64 in Unity 2021.3.18f I can receive chatter in both directions using bash and cmd. I can even receive chatter from the Win cmd into Unity. But As soon as I publish a String topic on the ubuntu machine, I don't receive anything.

cuhde commented 1 year ago

Okay, in my case it was the windows firewall. By disabling it I am now able to receive data from the Ubuntu PC in the local network.

adamdbrw commented 1 year ago

I am glad this worked for you, closing the issue!