Skip to content

a rosout publisher of a node might not exist - #1115

Merged
clalancette merged 4 commits into
ros2:rollingfrom
iuhilnehc-ynos:topic-rosout-publisher-logger-entry-not-exist
Nov 15, 2023
Merged

clalancette merged 4 commits into
ros2:rollingfrom
iuhilnehc-ynos:topic-rosout-publisher-logger-entry-not-exist

Conversation

@iuhilnehc-ynos

@iuhilnehc-ynos iuhilnehc-ynos commented Nov 3, 2023 •

Copy link
Copy Markdown
Collaborator

to return OK if add/remove sublogger if the rosout publisher not exist
rather than using a new `get` function.

Signed-off-by: Chen Lihui <[email protected]>
@iuhilnehc-ynos

Copy link
Copy Markdown
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Comment thread rcl/src/rcl/logging_rosout.c Resolved
Comment thread rcl/src/rcl/logging_rosout.c Resolved
@sea-bass

sea-bass commented Nov 5, 2023

Copy link
Copy Markdown

Thanks for looking at this fix so quickly!

Just leaving a comment here that this should also be backported to Iron.

Signed-off-by: Chen Lihui <[email protected]>
@iuhilnehc-ynos

Copy link
Copy Markdown
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@fujitatomoya fujitatomoya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

Comment thread rcl/include/rcl/logging_rosout.h Resolved
@iuhilnehc-ynos

Copy link
Copy Markdown
Collaborator Author

@clalancette Could you please help review it?

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've left a couple of things I think we can improve here, but overall it looks good.

Comment thread rcl/include/rcl/logging_rosout.h Outdated
* \return #RCL_RET_OK if the subordinate logger was created successfully, or
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
* \return #RCL_RET_SUBLOGGER_ALREADY_EXIST if the subordinate logger already exists, or
* \return #RCL_RET_NOT_FOUND if the parent logger not exists, or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* \return #RCL_RET_NOT_FOUND if the parent logger not exists, or
* \return #RCL_RET_NOT_FOUND if the parent logger does not exist, or

Comment thread rcl/include/rcl/logging_rosout.h Outdated
* \param[in] sublogger_name a sublogger name
* \return #RCL_RET_OK if the subordinate logger was finalized successfully, or
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
* \return #RCL_RET_NOT_FOUND if the sublogger not exists, or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* \return #RCL_RET_NOT_FOUND if the sublogger not exists, or
* \return #RCL_RET_NOT_FOUND if the sublogger does not exist, or

Comment thread rcl/src/rcl/logging_rosout.c Outdated
Comment on lines +445 to +449
if (RCL_RET_OK != (status = rcl_convert_rcutils_ret_to_rcl_ret(rcutils_ret))) {
if (RCL_RET_NOT_FOUND == status) {
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING("Failed to get logger entry for '%s'.", logger_name);
}
return status;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can make this easier to read with:

Suggested change
if (RCL_RET_OK != (status = rcl_convert_rcutils_ret_to_rcl_ret(rcutils_ret))) {
if (RCL_RET_NOT_FOUND == status) {
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING("Failed to get logger entry for '%s'.", logger_name);
}
return status;
if (RCUTILS_RET_OK != rcutils_ret) {
if (RCUTILS_RET_NOT_FOUND == status) {
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING("Failed to get logger entry for '%s'.", logger_name);
}
return rcl_convert_rcutils_ret_to_rcl_ret(rcutils_ret);

Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Chen Lihui <[email protected]>
@iuhilnehc-ynos

Copy link
Copy Markdown
Collaborator Author

I've left a couple of things I think we can improve here, but overall it looks good.

Thank you. Updated in b376e58.

@iuhilnehc-ynos

iuhilnehc-ynos commented Nov 14, 2023 •

Copy link
Copy Markdown
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

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.

Exception when instantiating ActionServer as part of ROS package tests

5 participants