Closed ZhenshengLee closed 2 years ago
@ZhenshengLee
First, tag builtin
should be inside tag rtps
.
Second, in order to achieve what you intend, you'll need to configure maxInitialPeersRange
. See the note here
I've modified your XML with the necessary settings
<?xml version="1.0" encoding="UTF-8"?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<transport_descriptors>
<transport_descriptor>
<transport_id>UDP_transport</transport_id>
<type>UDPv4</type>
<maxInitialPeersRange>10</maxInitialPeersRange>
</transport_descriptor>
</transport_descriptors>
<participant profile_name="participant_profile_ros2" is_default_profile="true">
<rtps>
<name>profile_for_ros2_context</name>
<userTransports>
<transport_id>UDP_transport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
<builtin>
<metatrafficUnicastLocatorList>
<locator />
</metatrafficUnicastLocatorList>
<initialPeersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
</udpv4>
</locator>
</initialPeersList>
</builtin>
</rtps>
</participant>
<data_writer profile_name="default publisher profile" is_default_profile="true">
<qos>
<publishMode>
<kind>ASYNCHRONOUS</kind>
</publishMode>
<data_sharing>
<kind>AUTOMATIC</kind>
</data_sharing>
</qos>
<historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
</data_writer>
<data_reader profile_name="default subscription profile" is_default_profile="true">
<qos>
<data_sharing>
<kind>AUTOMATIC</kind>
</data_sharing>
</qos>
<historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
</data_reader>
</profiles>
@MiguelCompany Thanks for your fast reply!
First, tag
builtin
should be inside tagrtps
.
That's a typo in the issue page.
<name>profile_for_ros2_context</name> <userTransports> <transport_id>UDP_transport</transport_id> </userTransports> <useBuiltinTransports>false</useBuiltinTransports>
As in the docs, the data-sharing is a shared-memory-based function(but different from default shm transport) and is only available in intra-machine communication, so why should we use this config? Is data-sharing really working?
How to check if the data-sharing in working? I read from this the issue https://github.com/ros2/rmw_fastrtps/issues/579#issuecomment-1122709868
which suggest to check /dev/shm
to see the mem files. But the shm(which is the default) transport also creates mem files in the same path. Is there a better way to check data-sharing function?
why should we use this config?
In order for the <maxInitialPeersRange>
configuration to work, as it is configured as part of the transport.
How to check if the data-sharing in working?
Data-sharing related files start with prefix fast_datasharing, so ls /dev/shm/fast_datasharing*
should work
why should we use this config?
In order for the
<maxInitialPeersRange>
configuration to work, as it is configured as part of the transport.How to check if the data-sharing in working?
Data-sharing related files start with prefix _fastdatasharing, so
ls /dev/shm/fast_datasharing*
should work
with the config xml above
It's tested and confirmed in https://github.com/ZhenshengLee/ros2_shm_msgs/tree/humble Thank you!
Bug report
Required Info:
Steps to reproduce issue
the source code is in https://github.com/ZhenshengLee/ros2_shm_msgs/tree/humble
the fastdds xml is in the follow, which is not committed into the github reop, the xml is according https://fast-dds.docs.eprosima.com/en/latest/fastdds/ros2/ros2_configure.html#creating-ros-contexts-and-nodes https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/disabling_multicast.html#disabling-all-multicast-traffic https://discourse.ros.org/t/unconfigured-dds-considered-harmful-to-networks/25689/24
Expected behavior
actually the image_talker.launch.py creates 8 image publisher processes.
So the ros2 graph should containe 8 nodes and the ros2cli should display
Actual behavior
ros2 node list and ros2 topic list show the wrong info. the communication is abnormal
Additional information
the bug exist in galactic, in which the fastdds version is 2.3.2
Feature request
null
Implementation considerations
null