-
Notifications
You must be signed in to change notification settings - Fork 163
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
a rosout publisher of a node might not exist #1115
a rosout publisher of a node might not exist #1115
Conversation
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 <lihui.chen@sony.com>
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 <lihui.chen@sony.com>
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.
lgtm
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@clalancette Could you please help review it? |
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.
I've left a couple of things I think we can improve here, but overall it looks good.
rcl/include/rcl/logging_rosout.h
Outdated
@@ -213,7 +213,7 @@ rcl_logging_rosout_output_handler( | |||
* \param[in] sublogger_name a sublogger name | |||
* \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 |
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.
* \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 |
rcl/include/rcl/logging_rosout.h
Outdated
@@ -242,6 +242,7 @@ rcl_logging_rosout_add_sublogger( | |||
* \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 |
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.
* \return #RCL_RET_NOT_FOUND if the sublogger not exists, or | |
* \return #RCL_RET_NOT_FOUND if the sublogger does not exist, or |
rcl/src/rcl/logging_rosout.c
Outdated
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; |
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.
I think we can make this easier to read with:
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 <clalancette@gmail.com> Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Thank you. Updated in b376e58. |
to fix ros2/rclpy#1195