Skip to content
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

Align on Transport GID and Liveliness GUID #291

Closed
wants to merge 3 commits into from

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Oct 4, 2024

Related with #290 and #148

This PR makes test_node_interfaces__node_graph from rclcpp to pass.

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Comment on lines +1211 to +1220
liveliness::ConstEntityPtr entity;
if (entity_type == EntityType::Publisher) {
entity = (*topic_data->pubs_.begin());
} else {
entity = (*topic_data->subs_.begin());
}

if (entity) {
uint8_t gid[RMW_GID_STORAGE_SIZE];
entity->get_gid(gid);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we iterate though all the Entity ptrs in the EnittySet?

const auto & entity_set = entity_type == EntityType::Publisher? topic_data->pubs_ : topic_data->subs_;
for (auto entity_it = entity_set.begin(); entity_it != entity_set.end(); ++entity_it) {
   uint8_t gid[RMW_GID_STORAGE_SIZE];
   entity->get_gid(gid);
    ret = rmw_topic_endpoint_info_set_gid(
        &endpoint_info,
        gid,
        RMW_GID_STORAGE_SIZE
     );
     if (RMW_RET_OK != ret) {
        return ret;
          }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we iterate over the list, then it will override the gid value (if there is more than one).

// The size of guid is std::size_t. It can vary depending on the platform and architecture.
// On most 32-bit systems, it is usually 32 bits, while on 64-bit systems,
// it is typically 64 bits. It fit in the RMW_GID_STORAGE_SIZE.
void get_gid(uint8_t gid[RMW_GID_STORAGE_SIZE]) const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: To be consistent with naming of other getters.

Suggested change
void get_gid(uint8_t gid[RMW_GID_STORAGE_SIZE]) const;
void gid(uint8_t gid[RMW_GID_STORAGE_SIZE]) const;

@clalancette
Copy link
Collaborator

I'm a little later here, but please see #290 (comment) for some of my thoughts.

@clalancette
Copy link
Collaborator

Closing in favor of #298 .

@clalancette clalancette deleted the ahcorde/rolling/gid branch October 15, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants