-
Notifications
You must be signed in to change notification settings - Fork 479
Clearer warning message, the old one lacked information and was perhaps misleading #2924
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
Clearer warning message, the old one lacked information and was perhaps misleading #2924
Conversation
e0a7f8a to
8b8b72a
Compare
… misleading Signed-off-by: Peter Mitrano (AR) <[email protected]>
8b8b72a to
5adf12c
Compare
| if (original_transition) { | ||
| RCLCPP_WARN( | ||
| node_logging_interface_->get_logger(), | ||
| "Callback returned ERROR during the transition: %s", original_transition->label); | ||
| } |
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.
thanks for bringing up this question with PR.
i believe this error message is meant to be the error during error handling callback, which is not related to the original transition. so i think original message Error occurred while doing error handling. is appropriate to print here.
btw i thinks error handling is missing some functionalities such as ros2/rcl_interfaces#97
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 believe this error message is meant to be the error during error handling callback
This would be the on_error callback, right? It looks to me like that happens later and has not happened yet. This warning is printed regardless of whether on_error is successful or not.
so i think original message
Error occurred while doing error handling.is appropriate
So if a user callback returns ERROR, but on_error has not been called yet, does this message really make sense? I don't think so.
I tested this just to confirm on_error is called after this warning is printed:
[ros2_control_node] [ERROR] [...]: Non-zero gain pd_gains.trans_x.p=1 ...
[ros2_control_node] [WARN] [...]: Callback returned ERROR during the transition: configure
[ros2_control_node] [WARN] [...]: on_error called in lookat controller.
Here is my on-error for testing, as you can see it returns SUCCESS.
CallbackReturn CartesianLookAtController::on_error(const rclcpp_lifecycle::State& previous_state)
{
RCLCPP_WARN(get_node()->get_logger(), "on_error called in lookat controller.");
return CallbackReturn::SUCCESS;
}
But perhaps I still not understanding the code? Thank you for you prompt reply and for pointing out that error handling is still missing some things!
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.
Ah, sorry you are right. i was the confused here.... thanks for pointing that out!
on_error is not yet called here, transition callback returned error. that said, i agree with you that the error message here is not appropriate. and the later, it will call the on_error callback to see if it can clean up the error state for this transition.
fujitatomoya
left a comment
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 with green CI.
| if (original_transition) { | ||
| RCLCPP_WARN( | ||
| node_logging_interface_->get_logger(), | ||
| "Callback returned ERROR during the transition: %s", original_transition->label); | ||
| } |
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.
Ah, sorry you are right. i was the confused here.... thanks for pointing that out!
on_error is not yet called here, transition callback returned error. that said, i agree with you that the error message here is not appropriate. and the later, it will call the on_error callback to see if it can clean up the error state for this transition.
|
@peter-mitrano-ar as you suggested, can you target this PR against rolling? and then we can do the backports for the downstream distros. |
|
@fujitatomoya Yes I will change this to be for rolling |
|
Pulls: #2924 |
|
I think this can be merged, we already merged the ones for Rolling and Kilted. Looks like Jazzy might be ready also? |
Description
The old error said "Error occurred while doing error handling." but I don't think that's accurate, or is at least confusing. To be honest I'm not sure we need any warning here at all, but if we do, my hope is that this is clearer.
I encountered this with ros2 control, so here's an example:
BEFORE
AFTER
But maybe I misunderstand, and this change does not make sense.
If this looks good, I can also make a PR to
rolling, but I currently usehumbleso this is where I started.Is this user-facing behavior change?
Changes the log they see, hopefully for the better.
Did you use Generative AI?
No.