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

add parse_state_interface_descriptions and parse_command_interface_description and reuse components #1768

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

As we discussed in yesterday's WG meeting, as the #1688 is merged, we would like to modify the import_state_interface_descriptions and import_command_interface_descriptions instead of parsing the hardware info to them, we parse the hardware_info_.joints and hardware_info_.sensors and it imports accordingly etc

Fixes: #1766

@saikishor saikishor force-pushed the cleanup/importing_component_interface_description branch from b185a02 to b3ea566 Compare September 26, 2024 19:35
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.92%. Comparing base (a6e44ab) to head (62e98b9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1768      +/-   ##
==========================================
+ Coverage   86.90%   86.92%   +0.01%     
==========================================
  Files         118      118              
  Lines       11438    11423      -15     
  Branches     1051     1047       -4     
==========================================
- Hits         9940     9929      -11     
+ Misses       1131     1129       -2     
+ Partials      367      365       -2     
Flag Coverage Δ
unittests 86.92% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
.../include/hardware_interface/actuator_interface.hpp 93.50% <100.00%> (-0.62%) ⬇️
...ce/include/hardware_interface/sensor_interface.hpp 93.18% <100.00%> (-0.57%) ⬇️
...ce/include/hardware_interface/system_interface.hpp 87.23% <100.00%> (-0.73%) ⬇️
hardware_interface/src/component_parser.cpp 94.60% <100.00%> (+0.17%) ⬆️

... and 1 file with indirect coverage changes

@saikishor saikishor marked this pull request as ready for review September 26, 2024 19:53
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +932 to +934
void parse_state_interface_descriptions(
const std::vector<ComponentInfo> & component_info,
std::unordered_map<std::string, InterfaceDescription> & state_interfaces_map)
Copy link
Member

Choose a reason for hiding this comment

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

In order to help with future-proofing this a little bit I am wondering if we could use a template for this function with some traits or concepts (or none if none works yet w this C++ version) to capture that we really only expect this to be an STL container, we aren't using any API specific to an unordered map

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean here std::unordered_map<std::string, InterfaceDescription> & state_interfaces_map ?

I'm not sure what traits can be used here. As both methods use the same set of arguments. If you have some ideas, please let me know :)

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.

Reuse import_state_interface_descriptions and import_command_interface_descriptions
3 participants