-
Notifications
You must be signed in to change notification settings - Fork 310
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 multiple calls of cleanup when system is unconfigured #1279
Fix multiple calls of cleanup when system is unconfigured #1279
Conversation
- fix system components - fix other components
…figured_components
Co-authored-by: Dr. Denis <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1279 +/- ##
==========================================
+ Coverage 47.87% 47.90% +0.03%
==========================================
Files 41 41
Lines 3453 3463 +10
Branches 1878 1883 +5
==========================================
+ Hits 1653 1659 +6
- Misses 444 445 +1
- Partials 1356 1359 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Should we also return OK in PRIMARY_STATE_FINALIZED
? This would maybe fix #1103, see the last point of the instructions in ros-controls/ros2_control_demos#417
Oh, yes, will do tomorrow morning. :) |
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. Thank you @destogl.
One question, why don't we use return type OK by default, but when we enter the INACTIVE and ACTIVE state we set it the ERROR at the beginning after the condition, in such a way we don't have to code OK for every lifecycle state.
(or)
Something as simple as if and else and by default we return OK in else
if (
impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE ||
impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
{
return_type result = impl_->read(time, period);
if (result == return_type::ERROR)
{
error();
}
return result;
}
else
{
return return_type::OK;
}
}
What do you think?
In any case, the current changes look fine to me. :)
@saikishor, I see your point here. This is definitely a simpler code, but I would like to have it rather explicit. Any unplanned thing should end up in error and |
Make sense. I agree with you. Thanks for the explanation. 👍 |
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.
Now it fixes #1103 too, thanks!
…of finalized (#1279) --------- Co-authored-by: Andrea Scipione <[email protected]> Co-authored-by: Bence Magyar <[email protected]> Co-authored-by: Dr. Denis <[email protected]> (cherry picked from commit acbeeea)
…of finalized (#1279) --------- Co-authored-by: Andrea Scipione <[email protected]> Co-authored-by: Bence Magyar <[email protected]> Co-authored-by: Dr. Denis <[email protected]> (cherry picked from commit acbeeea)
…of finalized (#1279) (#1287) --------- Co-authored-by: Andrea Scipione <[email protected]> Co-authored-by: Bence Magyar <[email protected]> Co-authored-by: Dr. Denis <[email protected]> (cherry picked from commit acbeeea) Co-authored-by: Dr. Denis <[email protected]>
…of finalized (#1279) (#1286) --------- Co-authored-by: Andrea Scipione <[email protected]> Co-authored-by: Bence Magyar <[email protected]> Co-authored-by: Dr. Denis <[email protected]> (cherry picked from commit acbeeea) Co-authored-by: Dr. Denis <[email protected]>
Replaces #1175