0
$\begingroup$

Rosanswers logo

Hi all, i'm having a really bad time with ROS2 communication between 2 machines:

  1. my laptop where i run a VM with ubuntu focal ( ip 192.168.1.24)
  2. Raspi 4 with Ubuntu focal as well running ROS2 (ip 192.168.1.42) I set the ROS_DOMAIN_ID=5 on both machines. The problem is that when i try to make a communication between the 2, ie running a listener node on Raspi and a talker node on the VM, nothing happens! Neither when i run the ros2 multicast send / receive doesn't give any responses!! Surfing on internet, i found that it might be a UDB multicast communication problem, but unfortunately i didn't found any solutin!! Any ideas? Thanks.

This is the ip addr on the VM:

   andi@andi-vm:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:14:e4:9a brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
       valid_lft 86173sec preferred_lft 86173sec
    inet6 fe80::5ae5:7f99:50fa:1e8d/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

and this is on the Raspi:

andi@andi-raspi:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether dc:a6:32:e9:fa:20 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether dc:a6:32:e9:fa:21 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
       valid_lft 86228sec preferred_lft 86228sec
    inet6 2a02:8428:1d60:fc01:fc52:84a0:d7fd:e5c9/64 scope global dynamic noprefixroute 
       valid_lft 604783sec preferred_lft 604783sec
    inet6 fe80::4d6:4e0:eaf9:fbd7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Originally posted by andi on ROS Answers with karma: 26 on 2023-01-17

Post score: 0


Original comments

Comment by ryanf55 on 2023-01-18:
Can you show the network configuration (ip addr) on Linux, or similar on your OS? You need to make sure multicast is enabled on your network interface.

At the ROS level, the default settings already have it enabled.

Comment by andi on 2023-01-19:
I updated the question with this info.

Comment by ljaniec on 2023-01-19:
Can you ping the PC with VM and RPi normally? The addition of the VM layer could be to blame for the problem - what software are you using for VMs? Can you check if the VM config has the networking enabled/bridged?

Comment by andi on 2023-01-19:
Yes i can ping the Pc by both VM and Raspi. The VM has Ubuntu focal. The thing is that from the Raspi i cannot ping the VM ip which is 10.0.2.15 (the one assigned to the VM), but i do ping the PC (192.168.1.24). In the VM Network conf i have the Virtual-Box Host-Only Ethernet Adapter with address 192.168.56.1. So i guess that the problem is in the assignement of the VM ip address. I do not know that much on how does this work!

Comment by Andromeda on 2023-01-21:
Can you check, whether your ports (on both sides) are open or not? Check here: https://docs.ros.org/en/galactic/Concepts/About-Domain-ID.html which UDP ports should be open according to your ROS_DOMAIN_ID

Comment by Andromeda on 2023-01-21:
Which VM do you use? VirtualBox? If yes, check this document: https://nsrc.org/workshops/2014/sanog23-virtualization/raw-attachment/wiki/Agenda/ex-virtualbox-portforward-ssh.htm

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Ok, i solved the problem! Basically, since i was using a VM with NAT network, the VM wasn't seen as another device on the net. Hence i changed the VM network configuration to Net with Bridge and this assigns an IP to the VM as it was another computer. Now everything works fine!


Originally posted by andi with karma: 26 on 2023-01-25

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by ljaniec on 2023-01-26:
Nice to hear that it was just a VM configuration as it was suggested :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.