Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@mm318
Copy link
Member

@mm318 mm318 commented Jun 7, 2019

Currently, publishers have the get_actual_qos() feature/function. It would make sense for subscriptions to have them, too.

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Similar comment about avoiding duplicated code that here.

return RMW_RET_ERROR;
}

if (!data_reader) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this check needed? I think the one in L382 is enough. I know that the same was done in:

DDS::DataWriter * data_writer = info->topic_writer_;
if (!data_writer) {
RMW_SET_ERROR_MSG("publisher internal data writer is invalid");
return RMW_RET_ERROR;
}
DDS::DataWriterQos dds_qos;
DDS::ReturnCode_t status = data_writer->get_qos(dds_qos);
if (DDS::RETCODE_OK != status) {
RMW_SET_ERROR_MSG("publisher can't get data writer qos policies");
return RMW_RET_ERROR;
}
if (!data_writer) {
RMW_SET_ERROR_MSG("publisher internal dds publisher is invalid");
return RMW_RET_ERROR;
}

But I don't think it has sense. If you agree, delete the duplicated check in the publisher function too

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Miaofei <[email protected]>
@mm318
Copy link
Member Author

mm318 commented Jun 9, 2019

Refactored to avoid duplicate code. Thanks!

Signed-off-by: Miaofei <[email protected]>
@ivanpauno ivanpauno merged commit 9de4488 into ros2:master Jun 12, 2019
@ivanpauno
Copy link
Member

CI: ros2/rmw#177 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants