-
Notifications
You must be signed in to change notification settings - Fork 287
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
Add additional checks for non existing and not available interfaces. #1218
Add additional checks for non existing and not available interfaces. #1218
Conversation
19199ac
to
37e64a8
Compare
Rethinking this in the context of #1098 - I would change #1098, but then we don't have nicely shown all three states... (if this is needed at all) If we go with #1098 then the check in the Resource Manage will become much more complex. I am not sure if I want to go that route because I think that we gain nothing having this complexity. The available interface in the context of controller doesn't make much sense. So I propose that we have the following case: New behavior:
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1218 +/- ##
==========================================
+ Coverage 47.85% 48.02% +0.17%
==========================================
Files 41 41
Lines 3477 3525 +48
Branches 1889 1912 +23
==========================================
+ Hits 1664 1693 +29
+ Misses 446 442 -4
- Partials 1367 1390 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@destogl I'm not sure about this convention. IMO the available interface does make sense in the context of the controllers as well. For instance, until the controller is active they are not exported to the Resource manager and also it doesn't make sense to export them on configure as the controller is not ready yet and you cannot start chaining them. I believe they should be available only upon activation and unavailable upon deactivation. |
This pull request is in conflict. Could you fix it @destogl? |
37e64a8
to
485b25f
Compare
…in inactive state." This reverts commit 485b25f.
@saikishor you are right. I will adjust this PR if needed. I would expect that I need adjustments, but the tests are passing. Let me today test in a real-world scenario if everything works, we can also start merging this :) Thanks for your support and patience! (the feature is quite tricky and I am careful to not break anything - so writing many tests...) |
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.
Looks fine to me. Test it and let us know
hardware_interface/test/test_resource_manager_prepare_perform_switch.cpp
Show resolved
Hide resolved
hardware_interface/test/test_resource_manager_prepare_perform_switch.cpp
Show resolved
Hide resolved
This works on the HW, so we can move one with it, if all are happy. |
@destogl can you rebase the PR? |
…existing-and-available-interfaces
Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
This pull request is in conflict. Could you fix it @destogl? |
hardware_interface/include/hardware_interface/resource_manager.hpp
Outdated
Show resolved
Hide resolved
…existing-and-available-interfaces
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.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.
The changes itself look good to me @destogl
Great job 👏
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com> Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
…existing-and-available-interfaces
…existing-and-available-interfaces
…existing-and-available-interfaces
…(backport #1218) (#1291) * Add additional checks for non-existing and not available interfaces. (#1218) (cherry picked from commit 8c34ab6) * Resolve conflicts for backport. * Make tests to use hardware description in tests to be able to activate controllers. * Fix variable name for clarity. --------- Co-authored-by: Dr. Denis <denis@stoglrobotics.de>
…(backport #1218) (#1292) * Add additional checks for non-existing and not available interfaces. (#1218) (cherry picked from commit 8c34ab6) * Resolve conflicts for backport. * Make tests to use hardware description in tests to be able to activate controllers. --------- Co-authored-by: Dr. Denis <denis@stoglrobotics.de> Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Fixing issues where controllers "prepare" and "perform" switch might be called even if HW is not configured which could lead to crashes.
Now only calls with all existing and available interface are allowed and on HW that is in inactive of active state.