0
$\begingroup$

I have raspberry pi 4B robot and host machine. I have install ros2 iron and was trying simple demo_node talker/listener to verify connectivity. Receiver doesn't get any messages from the talker node at all.

Observations/debugging so far

  1. ufw is inactive on both the machine
  2. I can ping from both machines to and fro successfully
  3. Verified that 4136 MULTICAST is enabled
  4. Tried changing RMW from fast-rtps to cyclonedds
  5. Tried using ros2 humble, but same issue.
  6. multicast send/receive is also not working

What else I can do debug/resolve this issue ?


Edit:

  1. Operating System: ubuntu 22 server on RPI 4B, host machine: ubuntu desktop 22
$\endgroup$
2
  • $\begingroup$ Multiple things could be the culprit here. Since you claim that the two machines can ping each other, I assume the network is configured correctly. Are you positive that both of the processes run and neither of tham has crashed? Does the talker actually publish anything? You can verify by running ros2 topic list or ros2 topic echo topicname on the side of the publisher. Does ros2 topic list show the topic you're publishing on on the listener side? Didn't you set different ROS_DOMAIN_ID environment variables on those two machines? Those wouldn't be able to communicate. $\endgroup$ Commented Oct 2, 2023 at 7:14
  • $\begingroup$ I added the solution. It will be helpful if you can review that. @StanislavSvědiroh $\endgroup$
    – zero
    Commented Oct 7, 2023 at 5:39

1 Answer 1

1
$\begingroup$

I found the root cause of the issue, but not the correct solution for it. At the end I will add workaround solution for people checking this.

Address range 224.x.x.x - 233.x.x.x acts as multicast address range.

I downloaded this repository https://github.com/troglobit/mtools/ on both the machines and compiled simple c programs using make.

  • Machine 1: ./msend -g 224.0.0.255 -p 22224
  • Machine 2: ./mreceive -g 224.0.0.255 -p 22224

I was able to receive the multicast messages. Now when I try to send the multicast messages using any multicast address other than following range then I multicast communication didn't happen working multicast range for my network is 224.0.0.0 -> 224.0.0.255

Using wireshark I found that Fast DDS sends the RTPS information on multicast address like 233.255.0.1 and this address was not working as multicast on my network (I am not sure how to resolve this)

I tried changing the mutlicast locators in Fast DDS to different address but attempt was unsuccessful. 2 Solutions exists for this issue

  1. Make 233.255.0.1 work as multicast address -> fix network setup somehow
  2. Change default address for RTPS protocol (from 233.255.0.1 to 224.0.0.x)

I could not find any solution to above in time constraints so I went with following workaround

--- host pc

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export FASTRTPS_DEFAULT_PROFILES_FILE=~/fast-rtps.xml
export ROS_STATIC_PEERS="localhost;192.168.29.79"

-- host pc : fast-rtps.xml ----

<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
   <participant profile_name="unicast_connection" is_default_profile="true">
       <rtps>
           <builtin>
               <metatrafficUnicastLocatorList>
                   <locator/>
               </metatrafficUnicastLocatorList>
               <initialPeersList>
                   <locator>
                       <udpv4>
                           <address>192.168.29.79</address>
                       </udpv4>
                   </locator>
               </initialPeersList>
           </builtin>
       </rtps>
   </participant>
</profiles>

--- raspi

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export FASTRTPS_DEFAULT_PROFILES_FILE=~/fast-rtps.xml
export ROS_STATIC_PEERS="localhost;192.168.29.91"

-- raspi : fast-rtps.xml ----

<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
   <participant profile_name="unicast_connection" is_default_profile="true">
       <rtps>
           <builtin>
               <metatrafficUnicastLocatorList>
                   <locator/>
               </metatrafficUnicastLocatorList>
               <initialPeersList>
                   <locator>
                       <udpv4>
                           <address>192.168.29.91</address>
                       </udpv4>
                   </locator>
               </initialPeersList>
           </builtin>
       </rtps>
   </participant>
</profiles>
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.