Conversation
f5e9b23 to
ae38b7a
Compare
rmw_connext_shared_cpp/src/node.cpp
Outdated
| participant_qos.user_data.value[sizeof(prefix) - 1 + name_length] = ';'; | ||
| } | ||
|
|
||
| // Setting the contentfilter_property_max_length to 1024 |
There was a problem hiding this comment.
Can you please modify the comment to describe why it's needed and how 1024 has been picked?
There was a problem hiding this comment.
Yes, I'm still investigating the exact number that should be used for the property, will update once I have a reasonable one.
There was a problem hiding this comment.
From the RTPS spec:
ContentFilterProperty_t: Mapping of the type
typedef string<256> String256;
typedef sequence<string> StringSequence;
struct ContentFilterProperty_t {
String256 contentFilteredTopicName;
String256 relatedTopicName;
String256 filterClassName;
string filterExpression;
StringSequence expressionParameters;
};
There was a problem hiding this comment.
@mikaelarguedas do you suggest putting the link in the code comment as well?
There was a problem hiding this comment.
yes I think it makes sense to have the link in the comment as well
| } | ||
|
|
||
| // Setting the contentfilter_property_max_length to 1024 | ||
| participant_qos.resource_limits.contentfilter_property_max_length = 1024; |
There was a problem hiding this comment.
As it been confirm that we can still talk to native connext participants if we modify this default value ?
There was a problem hiding this comment.
Still investigating that to confirm along with the exact length for the property.
There was a problem hiding this comment.
Should we place this back in progress then if you're still working on it ?
There was a problem hiding this comment.
I've checked native connext replier and requester, changed the contentfilter_property_max_length of requester to be 1024, replier to be 256 and vice-versa. The replier and requester worked as expected.
|
As we found out that the service length has to be shorter with Connext. Can you post here what the error message is if we pass a service name within "ROS maximum length" but too long for Connext? |
|
Here is the error message when I run |
|
regarding the check for the length of the service_name, I think It should be added in _process_service_name function, but still as of now what should the max limit for service_name in connext should be? When I checked the native connext Requester Replier example, the maximum service name that I was able to use was of 185 characters, If we have to impose a limit here I think it should be 185U - 8U (to account for the ros prefixes) |
|
Actually as the service length is not checked properly at the moment for any rmw implementation (we check the length before adding Request or Reply to the topic names and don't account for it), let's keep that for another set of PRs to make sure these ones get reviewed / merged in a timely manner. Can you open an issue on rmw to relocate the discussion there ? |
mikaelarguedas
left a comment
There was a problem hiding this comment.
lgtm, one question about adding the Request/Reply suffixes ourselves though
rmw_connext_cpp/src/rmw_client.cpp
Outdated
| @@ -129,12 +127,16 @@ rmw_create_client( | |||
| // This has to be evaluated whether or not to provide a | |||
| // Subscriber/Publisher object directly with preset partitions. | |||
There was a problem hiding this comment.
Nit: no preset partitions anymore
There was a problem hiding this comment.
@Karsten1987 this is a TODO, can it be removed or should it be modified?
| // concat the ros_service_*_prefix and Request/Reply suffixes with the service_name | ||
| char * request_concat_str = rcutils_format_string( | ||
| allocator, | ||
| "%s%s%s", ros_service_requester_prefix, service_name, "Request"); |
There was a problem hiding this comment.
hmmm Do we need to add Request and Reply ourselves now ? Isn't Connext adding them automatically when we call their service API ?
There was a problem hiding this comment.
Yes, There are two ways connext allows us to do this:
- if we use set service_name, then connext does add the Request and Reply for us.
- If we use set the request_topic_name and reply_topic_name, connext just uses whatever we give to it. (although it adds the GUID to Reply topic) see: here
Here we are not passing the service name but instead passing the request_topic_str and reply_topic_str directly
| char * response_concat_str = rcutils_format_string( | ||
| allocator, | ||
| "%s%s%s", ros_service_response_prefix, service_name, "Reply"); | ||
| if (!response_concat_str) { |
There was a problem hiding this comment.
i think request_concat_str is leaked here. If it was previously allocated, but response_concat_str fails here, only the request string will be deallocated.
There was a problem hiding this comment.
@Karsten1987 I think I got the logic wrong. So should it be if the response_concat_str fails here, the request_concat_str for which memory was allocated previously is deallocated? I see that's what was there previously
| } | ||
| *request_partition_str = DDS_String_dup(request_concat_str); | ||
| *response_partition_str = DDS_String_dup(response_concat_str); | ||
| if (!avoid_ros_namespace_conventions) { |
There was a problem hiding this comment.
Consider to simply set the ros prefix to an empty string and run the same logic when concatenating the topic string. Because if I understand your code correctly, the only difference is whether you append the ros prefix or not, right?
This makes the logic for cleaning up the allocated strings simpler.
string _ros_prefix = ros_prefix;
if (avoid_ros_namespace_conventions) {
_ros_prefix = "";
}
topic = (%s%s%s, _ros_prefix, topic_name, "[Request|Reply]"
58f06d4 to
89024a5
Compare
connects to ros2/ros2#476
To use the topic/service name directly without using the partitions.