Skip to content

Update get_node_names to never return empty values #489

@dhood

Description

@dhood

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:

The only behaviour that needs to be changed is:

The recommendation for implementing the change is to:

  1. over-allocate the array for the potential number of names,
  2. populate the first elements of the array with valid names encountered,
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions