-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
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]>
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); |
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.
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;
}
}
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.
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; |
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.
Nit: To be consistent with naming of other getters.
void get_gid(uint8_t gid[RMW_GID_STORAGE_SIZE]) const; | |
void gid(uint8_t gid[RMW_GID_STORAGE_SIZE]) const; |
I'm a little later here, but please see #290 (comment) for some of my thoughts. |
Closing in favor of #298 . |
Related with #290 and #148
This PR makes
test_node_interfaces__node_graph
from rclcpp to pass.