-
Notifications
You must be signed in to change notification settings - Fork 778
Description
Each supported RMW implementation (e.g. rmw_connext_cpp
, rmw_fastrtps_cpp
, rmw_opensplice_cpp
) has its own vendor-specific implementation of rmw_get_node_names
.
rmw_get_node_names
is called from rcl_get_node_names
, which is what all client libraries (c++, python, etc) use.
"Pure" non-ROS DDS participants will be detected by some vendors in rmw_get_node_names
, and the current approach for implementing rmw_get_node_names
returns a list that contains these empty names.
The objective of this ticket is instead to have rmw_get_node_names
in the rmw implementations only return names of participants that are non-empty.
After that has happened, we can revert these PRs that work-around the potential for empty names in the list:
- handle node names which are null rclcpp#435
- handle node names which are null rclpy#177
- update doc for rmw_get_node_names to mention potential null values rcl#214
- ignore empty or None node names ros2cli#76
The only behaviour that needs to be changed is:
-
rmw_fastrtps_cpp
already ignores participants without a name -
rmw_opensplice_cpp
already skips participants without a name in the userdata (opensplice only supports participants being named via the user data: store node name in participant user_data #438).
The recommendation for implementing the change is to:
- over-allocate the array for the potential number of names,
- populate the first elements of the array with valid names encountered,
- down-size the string array.
rmw_opensplice_cpp
currently does step 3 by coping the data into a smaller-sized array. To avoid this step the recommendation is to add a new function for string arrays that allows the unused portion of the array to be deallocated. More details in this thread.