-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publisher GID in message info of taken message does not match GID of source publisher #377
Comments
I added a test to
The publisher's GID is printed after it's created. The publisher GID from the message info data is printed in the subscription callback. These two should match. We run each test-case with Steps:
Conclusion: it's fine when pub/sub is within the same process (or node), but the publisher GIDs do not match in normal interprocess communications. |
I agree it is fair to call this discrepancy a bug, though prior to Feb 10 2020 you wouldn't have been able to observe this because originally there was nothing in the ROS 2 interface that required a globally unique identifier and everything in the Cyclone DDS RMW layer used the same identifier that you see here. That identifier is what is called the "instance handle" for the DDS DataWriter as it is visible in the DDS discovery topics by taking a subscription to to the DCPSPublication topic, and what is made available to the data reader in the "publication_handle" of the The GUID is not in the standardised fields of this |
Thanks for the explanation!
Looks like most of this exists already:
Implementation-wise, is the mapping from
|
The size changed from 24 to 16 bytes in ros2/rmw#345. The same size is defined in `tracetools`, and it was never updated. In practice, reading 24-16=8 random extra bytes didn't change much, since nothing is currently relying on the GID values, at least not relying on getting the same GID for the same object from two different systems, because it doesn't work with `rmw_cyclonedds`, see ros2/rmw_cyclonedds#377. Signed-off-by: Christophe Bedard <[email protected]>
The size changed from 24 to 16 bytes in ros2/rmw#345. The same size is defined in `tracetools`, and it was never updated. In practice, reading 24-16=8 random extra bytes didn't change much, since nothing is currently relying on the GID values, at least not relying on getting the same GID for the same object from two different systems, because it doesn't work with `rmw_cyclonedds`, see ros2/rmw_cyclonedds#377. Signed-off-by: Christophe Bedard <[email protected]>
Bug report
Required Info:
ros2.repos
file atmaster
Steps to reproduce issue
Have a publisher that publishes a message, and have a subscription that receives that message.
Normal inter-process setup, no shared memory or anything.
Expected behavior
These two are equal:
rmw
message info struct when the subscription takes a messagermw
publisher (and underlying DDS writer GID/GUID; the conversion is trivial) that sent the message that gets taken by the subscriptionwhen it's the same publisher.
Actual behavior
Publisher GIDs do not match.
Additional information
The GID of a publisher is recorded here in
rmw_create_publisher()
:rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp
Line 2457 in 35bdd1e
I'm recording the source publisher GID here in
rmw_take()
:rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp
Lines 3132 to 3137 in 35bdd1e
Less than 10 lines above that, it's copying
publication_handle
from thedds_sample_info_t
struct into intomessage_info->publisher_gid
. I'm not sure whether that's actually a GID:rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp
Line 3116 in 35bdd1e
I tried to do
get_entity_gid(info.publication_handle, message_info->publisher_gid);
instead of simply copying the values, but the GIDs don't seem to match either.Note that I don't think this behaviour is tested anywhere in ROS 2. However, publisher GIDs seem to match correctly with
rmw_fastrtps_cpp
.The text was updated successfully, but these errors were encountered: