From some initial searching, I found this similar / related question about setting to use only a certain interface.
It looks like there is some configuration you can do in FastDDS where you whitelist specific interfaces.
Another link in the docs for configuration with ROS 2.
Obvious downside to this is that if the ethernet interface goes down then it will not by default try the wifi network.
Originally posted by 404RobotNotFound with karma: 331 on 2021-08-09
This answer was NOT ACCEPTED on the original site
Post score: 1
Original comments
Comment by Benjamin-Tan on 2021-08-09:
I followed this to create a custom xml file.
My command:
FASTRTPS_DEFAULT_PROFILES_FILE=./whitelist.xml RMW_FASTRTPS_USE_QOS_FROM_XML=1 ros2 run demo_nodes_cpp talker
and face the following error
terminate called after throwing an instance of 'eprosima::fastcdr::exception::NotEnoughMemoryException' what(): Not enough memory in the buffer stream
Comment by 404RobotNotFound on 2021-08-10:
Might be something similar to this question about action clients (sorta).
Might be worthwhile seeing if you can either
- build a different FastDDS to use differently / locally? Or, technically it comes from FastCDR (which I really don't know much about)
- see if you can configure something in cyclone dds as well? It seems that might not have the same issue based on the comments on the question I linked at the top
Comment by Benjamin-Tan on 2021-08-14:
I don't think by building a custom FastDDS locally will be a feasible solution. And this should be focusing at FastDDS (ROS2 Foxy Default Middleware) rather than CycloneDDS.
Nevertheless, I have figured this out at last.
RMW_FAST_USE_QOS_FROM_XML=1, will require your custom.xml to include the history memory policy. This configuration is causing the "Not enough memory in the buffer stream"
The default history memory policy of:
- RMW ROS2:
PREALLOCATED_WITH_REALLOC
- FastDDS:
PREALLOCATED_MEMORY_MODE
An example of the custom.xml that is working can be found here