-
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
[PR-1689] Follow-up PR of the controller interface variants integration #1779
[PR-1689] Follow-up PR of the controller interface variants integration #1779
Conversation
…ames_ and exported_state_interface_names_ list
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1779 +/- ##
==========================================
- Coverage 86.90% 86.85% -0.06%
==========================================
Files 118 118
Lines 11438 11447 +9
Branches 1051 1057 +6
==========================================
+ Hits 9940 9942 +2
- Misses 1131 1135 +4
- Partials 367 370 +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.
Overall looks good
// Only add to the list if it doesn't exist | ||
list.push_back(element); |
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.
when are we adding things multiple times?
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.
ros2_control/controller_interface/src/chainable_controller_interface.cpp
Lines 208 to 232 in a6e44ab
std::vector<hardware_interface::StateInterface> | |
ChainableControllerInterface::on_export_state_interfaces() | |
{ | |
state_interfaces_values_.resize(exported_state_interface_names_.size(), 0.0); | |
std::vector<hardware_interface::StateInterface> state_interfaces; | |
for (size_t i = 0; i < exported_state_interface_names_.size(); ++i) | |
{ | |
state_interfaces.emplace_back( | |
get_node()->get_name(), exported_state_interface_names_[i], &state_interfaces_values_[i]); | |
} | |
return state_interfaces; | |
} | |
std::vector<hardware_interface::CommandInterface> | |
ChainableControllerInterface::on_export_reference_interfaces() | |
{ | |
reference_interfaces_.resize(exported_reference_interface_names_.size(), 0.0); | |
std::vector<hardware_interface::CommandInterface> reference_interfaces; | |
for (size_t i = 0; i < exported_reference_interface_names_.size(); ++i) | |
{ | |
reference_interfaces.emplace_back(hardware_interface::CommandInterface( | |
get_node()->get_name(), exported_reference_interface_names_[i], &reference_interfaces_[i])); | |
} | |
return reference_interfaces; | |
} |
here we are creating the interfaces from the exported_state_interface_names_
and exported_reference_interface_names_
and later we are readding again to the same vector in the method. I think it is better to check and insert to not to have inconsistent sizes.
This will only happen if we use these variables to create and export the interfaces
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.
sounds good, thank you
// Only add to the list if it doesn't exist | ||
list.push_back(element); |
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.
sounds good, thank you
Hello!
This PR is a follow-up PR of #1689 the minor things that could be nice to be addressed
Thank you!