-
Notifications
You must be signed in to change notification settings - Fork 345
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
Cleanup wrong lifecycle transitions in tests and unnecessary checks #1534
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1534 +/- ##
==========================================
+ Coverage 84.27% 84.49% +0.21%
==========================================
Files 123 123
Lines 11359 11297 -62
Branches 961 950 -11
==========================================
- Hits 9573 9545 -28
+ Misses 1470 1446 -24
+ Partials 316 306 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -101,15 +101,6 @@ controller_interface::return_type DiffDriveController::update_reference_from_sub | |||
const rclcpp::Time & time, const rclcpp::Duration & /*period*/) | |||
{ | |||
auto logger = get_node()->get_logger(); | |||
if (get_lifecycle_state().id() == State::PRIMARY_STATE_INACTIVE) | |||
{ | |||
if (!is_halted) |
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.
Do we also need to remove the is_halted variable, if it is a member variable?
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.
we use it in on_deactivate() transition
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.
Can't we simply call halt in the deactivate method always, instead of using this is_halted variable?
What do you think?
I can recheck the code later and get back to you
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 could, sure.
if (!is_halted) | ||
{ | ||
halt(); | ||
is_halted = true; | ||
} |
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.
@christophfroehlich why do we need this here?
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.
to stop the vehicle in deactivate transition
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.
Same as above, can't we simply call halt without any check in the deactivate method?
Closes #417 and closes #405 and closes #1501