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

[Handle] Add support for booleans in the handles #2065

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

Conversation

saikishor
Copy link
Member

This PR aims to add support for boolean types in the Handle using the internal variant. The data_type is selected using the InterfaceInfo information.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 80.32787% with 12 lines in your changes missing coverage. Please review.

Project coverage is 89.52%. Comparing base (bfbedd2) to head (9ed5294).

Files with missing lines Patch % Lines
...re_interface/include/hardware_interface/handle.hpp 83.78% 5 Missing and 1 partial ⚠️
...rface/include/hardware_interface/hardware_info.hpp 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2065      +/-   ##
==========================================
- Coverage   89.59%   89.52%   -0.07%     
==========================================
  Files         139      139              
  Lines       15222    15275      +53     
  Branches     1290     1292       +2     
==========================================
+ Hits        13638    13675      +37     
- Misses       1096     1109      +13     
- Partials      488      491       +3     
Flag Coverage Δ
unittests 89.52% <80.32%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
...ace/include/semantic_components/led_rgb_device.hpp 92.30% <100.00%> (ø)
hardware_interface/test/test_handle.cpp 100.00% <100.00%> (ø)
...e_interface_testing/test/test_resource_manager.cpp 99.48% <ø> (ø)
...re_interface/include/hardware_interface/handle.hpp 83.96% <83.78%> (-0.04%) ⬇️
...rface/include/hardware_interface/hardware_info.hpp 53.84% <0.00%> (-46.16%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 very nice! Is this ready to be used by hardware components now? how?

@saikishor
Copy link
Member Author

this looks very nice! Is this ready to be used by hardware components now? how?

@christophfroehlich Yes, it is ready to be used. When you export interfaces from your hardware, just create an Interface with the InterfaceDescription like in one of the example, and it is good to go.

However, the following Hardware component API needs to be refined. I added the discussion to the next WG meeting. If you can access the interface, then you should be able to set the data and retrieve the data.

void set_state(const std::string & interface_name, const double & value)
{
system_states_.at(interface_name)->set_value(value);
}
double get_state(const std::string & interface_name) const
{
return system_states_.at(interface_name)->get_value();
}
void set_command(const std::string & interface_name, const double & value)
{
system_commands_.at(interface_name)->set_value(value);
}
double get_command(const std::string & interface_name) const
{
return system_commands_.at(interface_name)->get_value();
}

@saikishor saikishor force-pushed the support/more_types/handles branch from 4f8dc58 to 9e27272 Compare February 26, 2025 23:32
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.

2 participants