-
Notifications
You must be signed in to change notification settings - Fork 299
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
[Feature] Fallback controllers #1789
[Feature] Fallback controllers #1789
Conversation
add fallback controllers list to the ControllerInterfaceBase do not activate the controller if it's fallback controllers are not found or not in inactive state add formatting changes added the first logic of switching to the fallback controller upon error Added a method to get the active controllers that use the command interfaces of the given controller Compute the complete list of active controllers that already use the command interfaces needed by the fallback controllers added fixes for the compilation retouch for the new structure
…es_of_controller method
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1789 +/- ##
==========================================
+ Coverage 86.83% 87.29% +0.45%
==========================================
Files 121 121
Lines 11542 12093 +551
Branches 1054 1079 +25
==========================================
+ Hits 10023 10557 +534
- Misses 1144 1148 +4
- Partials 375 388 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…g interface to activate
…g state interface to activate
controller_manager/include/controller_manager/controller_manager.hpp
Outdated
Show resolved
Hide resolved
std::string controllers_string; | ||
controllers_string.reserve(500); |
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.
quite interesting that there isn't a pre-reserve constructor for strings...
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.
Yes it sucks. I want to optimize all of these sooner in the following PRs
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 pre-reserve all of this?
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.
Looks good. We should proceed and then optimize the vector and string initialization part.
std::string failed_controllers; | ||
const auto FALLBACK_STACK_MAX_SIZE = 500; | ||
std::vector<std::string> active_controllers_using_interfaces(failed_controllers_list); | ||
active_controllers_using_interfaces.reserve(FALLBACK_STACK_MAX_SIZE); |
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 are here in update, can we pre-reserve this?
This can be also done in a follow-up PR, but we should make sure that it is resolved.
std::string controllers_string; | ||
controllers_string.reserve(500); |
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 pre-reserve all of this?
Merging this as discussed with @bmagyar. We should then optimize the memory allocation |
We already introduced the necessary information for setting up the fallback controllers via (#1499 and #1503). This PR aims to complete the Fallback controllers feature (When a controller is returning ERROR in the update cycle, it will be deactivated and any fallback controllers linked to this controller will be activated)
This PR has the main logic to have the fallback controllers working, pending some tests
Closes #1468