DDS-Router doesn't work once setting ROS_LOCALHOST_ONLY in Humble #488
-
I found DDS-Router doesn't work once setting ROS_LOCALHOST_ONLY in Humble. Test environment:
On terminal 2, run listener:
On terminal 3, run dds-router:
If I unset ROS_LOCALHOST_ONLY in terminal 1 and terminal 2, listener can receive messages from talker. In ros2, if ROS_LOCALHOST_ONLY is enable, it will do if (localhost_only) {
// In order to use the interface white list, we need to disable the default transport config
domainParticipantQos.transport().use_builtin_transports = false;
// Add a UDPv4 transport with only localhost enabled
auto udp_transport = std::make_shared<eprosima::fastdds::rtps::UDPv4TransportDescriptor>();
udp_transport->interfaceWhiteList.emplace_back("127.0.0.1");
domainParticipantQos.transport().user_transports.push_back(udp_transport);
// Add SHM transport if available
auto shm_transport = std::make_shared<eprosima::fastdds::rtps::SharedMemTransportDescriptor>();
domainParticipantQos.transport().user_transports.push_back(shm_transport);
} About transport, does the DDS-Router have any special configuration for this case ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @Barry-Xu-2018 , which version of DDS-Router are you using? And against which Fast-DDS version did you build? Are the three processes run in the same Docker container? |
Beta Was this translation helpful? Give feedback.
-
DDS-Router is v2.1.0 and Fast-DDS is v2.13.1.
Yes. |
Beta Was this translation helpful? Give feedback.
-
Hi @Barry-Xu-2018 , this is a known problem affecting older Fast-DDS versions (including v2.6 present in Humble). The explanation and fix was introduced here. If willing to enforce localhost communication in this case you would need to also add a whitelist to your local router participants, as shown here, i.e.:
|
Beta Was this translation helpful? Give feedback.
Hi @Barry-Xu-2018 , this is a known problem affecting older Fast-DDS versions (including v2.6 present in Humble). The explanation and fix was introduced here. If willing to enforce localhost communication in this case you would need to also add a whitelist to your local router participants, as shown here, i.e.: