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

Fix bug in rate_limiter filter and add more tests #237

Open
wants to merge 7 commits into
base: ros2-master
Choose a base branch
from

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Nov 20, 2024

I ran in the same issue as was solved with diff_drive_controller already ros-controls/ros2_controllers#252
I added some tests, and furthermore improved the generate_parameter_library parameter declaration file.

@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.69%. Comparing base (641c929) to head (a617a42).

Files with missing lines Patch % Lines
test/control_filters/test_rate_limiter.hpp 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           ros2-master     #237      +/-   ##
===============================================
+ Coverage        71.05%   74.69%   +3.63%     
===============================================
  Files               20       22       +2     
  Lines             1040     1071      +31     
  Branches            84       85       +1     
===============================================
+ Hits               739      800      +61     
+ Misses             255      223      -32     
- Partials            46       48       +2     
Flag Coverage Δ
unittests 74.69% <97.61%> (+3.63%) ⬆️

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

Files with missing lines Coverage Δ
include/control_filters/rate_limiter.hpp 73.07% <100.00%> (+73.07%) ⬆️
include/control_toolbox/rate_limiter.hpp 71.42% <ø> (+3.17%) ⬆️
test/control_filters/test_load_rate_limiter.cpp 100.00% <ø> (ø)
test/control_filters/test_rate_limiter.cpp 100.00% <100.00%> (ø)
test/control_filters/test_rate_limiter.hpp 92.30% <92.30%> (ø)
---- 🚨 Try these New Features:

Comment on lines 11 to +15
default_value: .NAN,
description: "Maximum value, e.g. [m/s]",
validation: {
"control_filters::gt_eq_or_nan<>": [0.0]
},
Copy link
Member

Choose a reason for hiding this comment

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

Is infinite a better default value here? Or Nan is better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in principle you are right, and it would already work setting it + or -infinite. However, NaN is the default value of the diff_drive_controller. And the logic of "copying the positive value if negative is not given" would not work because infinite is a valid limit 🤔

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.

3 participants