Skip to content
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

Adapt controller Reference/StateInterfaces to New Way of Exporting (variant support) #1689

Conversation

mamueluth
Copy link
Member

@mamueluth mamueluth commented Aug 16, 2024

This PR is the fith and last part of multiple breaking down #1240 in smaller changes. For an overview explanation and a lot of comments/discussion, please refer to #1240.
This PR adapts the controller interface to the new way of exporting Reference and StateInterfaces. ReferenceInterfaces now are created as shared_ptr and shared to controller manager as shared_ptr. The memory is still allocated in the controller (old way) but a unordered_map for the interfaces is added.

NOTE: Everything is fully backward compatible at this point. At this point variant supports only double at this point.

@mamueluth mamueluth changed the title adapt reference interfaces and stateInterfaces of controllers new way of Adapt controller Reference/StateInterfaces to New Way of Exporting (variant support) Aug 16, 2024
Copy link
Contributor

mergify bot commented Sep 11, 2024

This pull request is in conflict. Could you fix it @mamueluth?

@bmagyar bmagyar force-pushed the controller_interface_variant_support_base branch from 21296d7 to 7e72ae2 Compare October 5, 2024 12:27
@bmagyar
Copy link
Member

bmagyar commented Oct 5, 2024

Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 59.79381% with 39 lines in your changes missing coverage. Please review.

Project coverage is 86.95%. Comparing base (ce5c35a) to head (59530e2).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...r_interface/src/chainable_controller_interface.cpp 49.25% 30 Missing and 4 partials ⚠️
controller_manager/src/controller_manager.cpp 50.00% 4 Missing ⚠️
controller_interface/src/controller_interface.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1689      +/-   ##
==========================================
- Coverage   87.19%   86.95%   -0.24%     
==========================================
  Files         118      118              
  Lines       11369    11430      +61     
  Branches     1049     1051       +2     
==========================================
+ Hits         9913     9939      +26     
- Misses       1094     1125      +31     
- Partials      362      366       +4     
Flag Coverage Δ
unittests 86.95% <59.79%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...oller_interface/chainable_controller_interface.hpp 100.00% <ø> (ø)
...lude/controller_interface/controller_interface.hpp 100.00% <ø> (ø)
...controller_interface/controller_interface_base.hpp 90.00% <ø> (ø)
...rface/test/test_chainable_controller_interface.cpp 100.00% <100.00%> (ø)
...de/hardware_interface/loaned_command_interface.hpp 100.00% <100.00%> (ø)
...lude/hardware_interface/loaned_state_interface.hpp 75.00% <100.00%> (+8.33%) ⬆️
hardware_interface/src/resource_manager.cpp 73.39% <100.00%> (-0.27%) ⬇️
...e_interface_testing/test/test_resource_manager.cpp 99.32% <100.00%> (ø)
controller_interface/src/controller_interface.cpp 75.00% <50.00%> (ø)
controller_manager/src/controller_manager.cpp 77.31% <50.00%> (-0.17%) ⬇️
... and 1 more

@bmagyar bmagyar force-pushed the controller_interface_variant_support_base branch from a1d563b to f4ec3d6 Compare October 5, 2024 13:49
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the PR looks good to me. Thanks for the great work @mamueluth @bmagyar 👏🏾

I've found minor things to be addressed apart from the suggestion from this review, but I can open up a following PR to address them.

@bmagyar
Copy link
Member

bmagyar commented Oct 7, 2024

@saikishor separate PR please

@saikishor
Copy link
Member

saikishor commented Oct 7, 2024

@saikishor separate PR please

Sure, I will do that :)
I will open it once this is merged.

ref_interfaces = controller->export_reference_interfaces();
if (ref_interfaces.empty() && state_interfaces.empty())
{
// TODO(destogl): Add test for this!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add Test for this!

@destogl destogl merged commit 34d2b36 into ros-controls:master Oct 7, 2024
17 of 19 checks passed
@destogl destogl deleted the controller_interface_variant_support_base branch October 7, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants