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 key-value-storage to the InterfaceInfo #1421

Merged

Conversation

mamueluth
Copy link
Member

@mamueluth mamueluth commented Feb 27, 2024

This PR adds the possibility to define custom parameters (key-value-storage) per Interface (Commad-/StateInterface). This is useful to define a .ros2_control.xacro for a hardware driver that uses for example Modbus for communication. In this case, you want to be able to define e.g. which register is used to retrieve/write the data for each Command-/StateInteface Individually.

Has been tested and works. Test have been added.

The exception as been altered as I did some mistake while defining the URDF and the thrown exception "invalid URDF passed in to robot parser" is not very useful at all. I would prefer this to be merged as it now gives some useful hint what was gone wrong. If i should move the two lines of code to an other PR as its not really related please let me know.

@bmagyar bmagyar changed the title Add key-value-storage to the IntefaceInfo Add key-value-storage to the InterfaceInfo Feb 27, 2024
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.

This looks valuable and the implementation is straight forward, thanks!

Just one usual comment from my side, please add this to the docs:

  • maybe here or create a new page.
  • into the release notes. If it get not merged soon, just comment here and I'll add that later.

@christophfroehlich
Copy link
Contributor

@mamueluth can you please rebase this on master to run the checks? (we can't do that because this PR comes from an organization)

@mamueluth mamueluth force-pushed the add_parameters_to_interface_info branch from 6b44a4d to ebe46cf Compare April 29, 2024 08:36
@christophfroehlich
Copy link
Contributor

Fyi, CI looks good but codecov needs #1504 and the other failures are already reported #1367 and not related imho.

@mamueluth mamueluth force-pushed the add_parameters_to_interface_info branch from ebe46cf to d8b9eb7 Compare May 22, 2024 08:00
@mamueluth
Copy link
Member Author

@christophfroehlich I added a overview to the docs. There the key-value storage is described in a generic example. We could explain the other xml tags there as well.
Release notes let me know if i should add.

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.82%. Comparing base (9e57adf) to head (b69068f).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1421      +/-   ##
==========================================
+ Coverage   86.81%   86.82%   +0.01%     
==========================================
  Files         116      116              
  Lines       10692    10688       -4     
  Branches      978      977       -1     
==========================================
- Hits         9282     9280       -2     
  Misses       1059     1059              
+ Partials      351      349       -2     
Flag Coverage Δ
unittests 86.82% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
...rface/include/hardware_interface/hardware_info.hpp 100.00% <ø> (ø)
hardware_interface/src/component_parser.cpp 94.42% <100.00%> (+0.04%) ⬆️
hardware_interface/test/test_component_parser.cpp 98.81% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

destogl
destogl previously approved these changes Aug 16, 2024
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

destogl
destogl previously approved these changes Aug 16, 2024
destogl
destogl previously approved these changes Aug 16, 2024
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.

Very nice!
Nice tests too!
Thanks for the nice work

destogl
destogl previously approved these changes Aug 26, 2024
destogl
destogl previously approved these changes Aug 28, 2024
bmagyar
bmagyar previously approved these changes Aug 28, 2024
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.

A short note in the release notes would be great 😇

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.

(sorry for being late, we can add the release notes in a follow-up PR as well).

@mamueluth
Copy link
Member Author

A short note in the release notes would be great 😇

done

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.

A minor detail

doc/release_notes.rst Outdated Show resolved Hide resolved
Co-authored-by: Sai Kishor Kothakota <[email protected]>
@destogl destogl merged commit f743bf4 into ros-controls:master Aug 28, 2024
21 checks passed
@destogl destogl deleted the add_parameters_to_interface_info branch August 28, 2024 17:08
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.

6 participants