-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
I am not sure about the changes since the pub / sub equivalent of the code does something different (especially after #88): Just from reading these two code parts it looks to me (on a first look) that they are contradicting each other. I know this is not directly related to this PR but since this PR adds similar stuff for the services as for pub/sub I think those should be similar (or even the same). |
I'm not sure what you mean when you say these sections of code contradict each other. These are the three differences I see:
|
The first code block sets the history depth of the writer to the requested value unconditionally (if The second block increases the history of the reader to the requested queue size. The two logics are significantly different in behavior and I think they should be considered to to the same conceptional thing instead. Currently the resulting behavior is not obvious and different for readers and writers. |
@@ -934,6 +934,47 @@ rmw_create_client( | |||
goto fail; | |||
} | |||
|
|||
// For now, use the default QoS profile for services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move this code to create_requester
(in srv__type_support.cpp.template
), pass a rmw_qos_profile_t
to rmw_create_client
and default it to rmw_qos_profile_services_default
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll make the necessary changes here and to rmw and rmw_opensplice. I'll leave the work to propagating the QoS profile to rclcpp until after this set gets merged, if that's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, we can split work and I can deal with rclcpp
if you're ok with that.
Oh, I see, Dirk is talking about lines 269-282 (create_publisher) and 599-612 (create_subscription). https://github.com/ros2/rmw_connext/blob/master/rmw_connext_cpp/src/functions.cpp#L269 https://github.com/ros2/rmw_connext/blob/master/rmw_connext_cpp/src/functions.cpp#L599 It looks to me like the existing behavior is the same for readers and writers, and I need to change my initialization of the service/client readers and writers to match. I'm still not sure why the "ensure history depth is at least the requested size" block is needed though; why isn't the first part (lines 265-267) sufficient? |
I was not referring to any difference between |
Is this discrepancy covered by ros2/rmw#13? |
I've rebased on top of master and ran the tests in |
Regarding the discussion about how depth is set: can we table the discussion for now and merge these PRs, since they fix several issues with parameters and services? |
DDS_DataWriterQos datawriter_qos; | ||
|
||
if (!get_datareader_qos(participant, datareader_qos)) { | ||
RMW_SET_ERROR_MSG("Unable to initialize datareader QoS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these error messages are being overwritten afterwards if the function return NULL.
I think it needs to be unified one way or the other before merging this, but I don't care which way it is unified. The discussion of which way they both should be can be tabled. |
#include <rosidl_typesupport_connext_cpp/dds_utilities.hpp> | ||
|
||
bool | ||
get_datareader_qos(DDSDomainParticipant * participant, DDS_DataReaderQos & datareader_qos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving / copying these functions from rmw into the rosidl package looks weird to me. It implies that every compiled message package embeds this logic. I would prefer if this stays in rmw and if the typesupport needs its somehow gets its passed as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is compiled into the library for this package, not into each message library:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be true that it should be in rmw_connext_cpp instead though. The question is where is it used from. If it is used from the message specific code, then it would need to be here or as you suggested moved to rmw and used there, passing the result to the message specific code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - I didn't notice that. Before the type support library only contained the identifier.
Without this change the reader / write qos was determined within rmw so it should be possible to keep it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are used in `srv__type_support.cpp.template, line 71:
https://github.com/ros2/rmw_connext/pull/100/files#diff-a2cb81bcab4593a61a1d8ad7a7308f25R71
I could change this function to take a DDSDataWriterQos struct and a DDSDataReaderQos struct, instead of an rmw_qos_profile, and initialize the DDS QoS structs in the rmw implementation before create_requester
is called. Then the get_datareader/writer_qos functions would not need to be in the typesupport library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a good way to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The diff is much simpler now. Not sure what I was doing before; I think I was trying to make this implementation match the OpenSplice typesupport library.
4095789
to
da37f81
Compare
} | ||
datareader_qos.history.depth = static_cast<DDS_Long>(qos_profile.depth); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to move all this code into the get_datareader_qos
/ get_datawriter_qos
functions where all the other qos properties are set? That would also avoid have the same ~60 lines in four locations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, that would be a big improvement. Done in 65a3d43
LGTM. Let's spin some CI jobs. |
+1 |
…and share code for setting DataReader/Writer QoS.
4409bac
to
287e7ee
Compare
Fix default QoS settings for services
Connects to #96
See ros2/rmw_opensplice/pull/82 for description.