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

[Feature] Choose different read and write rate for the hardware components #1570

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

Conversation

saikishor
Copy link
Member

Hello!

This PR helps to obtain different read and write update rates rather than having the same update rate as of the controller manager. With these changes, each and every component can run at their own chosen rate and they update the State and Command interfaces according to that rate. This is very useful for system with different communication layers such as EtherCAT, CAN and Serial. Hope this helps the community.

Thank you

Copy link

codecov bot commented Jun 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.51%. Comparing base (465b58f) to head (ca62a0b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1570      +/-   ##
==========================================
+ Coverage   87.30%   87.51%   +0.20%     
==========================================
  Files         108      108              
  Lines        9866    10020     +154     
  Branches      890      898       +8     
==========================================
+ Hits         8614     8769     +155     
  Misses        929      929              
+ Partials      323      322       -1     
Flag Coverage Δ
unittests 87.51% <100.00%> (+0.20%) ⬆️

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

Files Coverage Δ
..._interface/include/hardware_interface/actuator.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/sensor.hpp 75.00% <ø> (+8.33%) ⬆️
...re_interface/include/hardware_interface/system.hpp 100.00% <ø> (ø)
hardware_interface/src/actuator.cpp 76.22% <100.00%> (+1.22%) ⬆️
hardware_interface/src/component_parser.cpp 94.35% <100.00%> (+0.22%) ⬆️
hardware_interface/src/resource_manager.cpp 74.27% <100.00%> (+1.02%) ⬆️
hardware_interface/src/sensor.cpp 71.28% <100.00%> (+0.87%) ⬆️
hardware_interface/src/system.cpp 76.22% <100.00%> (+1.22%) ⬆️
hardware_interface/test/test_component_parser.cpp 98.73% <100.00%> (+0.08%) ⬆️
...rface_testing/test/test_components/test_system.cpp 89.58% <100.00%> (+0.22%) ⬆️
... and 1 more

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.

Great addition 👍

Why not just use update_rate as attribute name (same as for controller_manager or the controllers)

Please update the docs and add also a paragraph to the release notes.

@saikishor
Copy link
Member Author

Great addition 👍

Why not just use update_rate as attribute name (same as for controller_manager or the controllers)

Please update the docs and add also a paragraph to the release notes.

Sure. I forgot about the docs. I'll update it tomorrow at the earliest. Thanks for reminding me.

Well regarding the parameter name, I thought of using different because, we have update_rate for the update callback of the controllers and for the hardware I wanted to use the appropriate one, so I used rw_rate to specify the read/write_rate. How the changes are done, in future we can also have different read and write rates if needed, with just changing the parsing part. I'm open to the discussion on the parameter naming part.

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.

Thanks for the docs 👍

hardware_interface/src/resource_manager.cpp Outdated Show resolved Hide resolved
hardware_interface/src/resource_manager.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

mergify bot commented Jun 25, 2024

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

@saikishor
Copy link
Member Author

Resolved conflicts!

Copy link
Contributor

mergify bot commented Jul 3, 2024

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

@saikishor
Copy link
Member Author

@christophfroehlich I've just fixed the conflicts after your merged PR on deprecating mimic stuff

Copy link
Contributor

mergify bot commented Jul 8, 2024

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

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.

None yet

2 participants