-
Notifications
You must be signed in to change notification settings - Fork 304
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
Fix spam of logs on failed hardware component initialization #1719
Fix spam of logs on failed hardware component initialization #1719
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1719 +/- ##
==========================================
- Coverage 86.78% 86.75% -0.04%
==========================================
Files 116 116
Lines 10693 10682 -11
Branches 978 983 +5
==========================================
- Hits 9280 9267 -13
+ Misses 1061 1059 -2
- Partials 352 356 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
hardware_interface/src/actuator.cpp
Outdated
if ( | ||
impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNKNOWN || | ||
impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED || | ||
impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED) |
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.
Might be a good idea to roll this into a method.
constexpr bool lifecycleStateRequiresNoAction(const lifecycle_msgs::msg::State::_id_type state)
{
return state == lifecycle_msgs::msg::State::PRIMARY_STATE_UNKNOWN ||
state == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED ||
state == lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED;
}
if (lifecycleStateRequiresNoAction(impl_->get_lifecycle_state().id()))
return return_type::OK;
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.
Sure. I like the idea
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.
Done
1bab232
to
fd1a50a
Compare
167e1b2
to
30fb971
Compare
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.
thank you!
When the hardware component fails, it continues to stay in the UNKNOWN lifecycle state, if the state is other than the UNCONFIGURED or FINALIZED the return_type is ERROR as default and then replaced by the outcome from read and write method. So, returning ERROR, makes it continuously spam with the following logs
ros2_control/controller_manager/src/controller_manager.cpp
Lines 2178 to 2181 in 8f7374f
ros2_control/controller_manager/src/controller_manager.cpp
Lines 2359 to 2363 in 8f7374f
This PR proposes fix for the above issue