-
Couldn't load subscription status.
- Fork 372
Fixing Hardware components logging spam in tests #2692
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
base: master
Are you sure you want to change the base?
Conversation
|
This Fixes #2662 partly
Executor is not available....But I was questioning should we also take care of `status_publish_rate` is set to 0.0, hardware status publisher will not be created.As that message is not printed when we actually start up the publishers, do we want that to happen for every test? |
Do we have a test in actually checking the status_publish_rate behavior? |
We can remove the print and simply document it that unless a |
this also works, it is already documented at ros2_control/hardware_interface/doc/writing_new_hardware_component.rst Lines 215 to 225 in 6cbb5f0
|
| "`status_publish_rate` is set to 0.0, hardware status publisher will not be created."); | ||
| } | ||
| else | ||
| if (publish_rate != 0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we avoid comparison with zero?
| if (publish_rate != 0.0) | |
| if (publish_rate < std::numeric_limits<T>::epsilon()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was also considering not going down that route but since it is zero specifically (either assigned manually by us when user hasnt provided a value, or direct from config, so should not have any floating point issues) it seemed fine. but its more standard to go by the route you suggested. maybe ill add an fabs on publish rate too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually here particularly it might be better to just do
if (publish_rate > 0.0)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, the "lower" comparison was wrong anyways. And a negative value would also be valid parameter, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to be a floating point? Can't it be an integer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also true, we can just move to integer
ah, the "lower" comparison was wrong anyways. And a negative value would also be valid parameter, right?
yes, even for integers, will just add a seperate condition for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think that users might want to configure sub-Hz rate? there is no harm in using a double here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean 0.1Hz for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats also true, I convinced myself by saying who would want the choice between 50hz and 50.5hz :), but yes the 0-1hz might be in need of granuality.
no strong opinion here, which one should I go for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with the current double approach
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2692 +/- ##
==========================================
+ Coverage 89.46% 89.48% +0.02%
==========================================
Files 152 152
Lines 17307 17344 +37
Branches 1434 1436 +2
==========================================
+ Hits 15483 15521 +38
+ Misses 1246 1244 -2
- Partials 578 579 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@soham2560 is this ready for review? |
|
This pull request is in conflict. Could you fix it @soham2560? |
b4437ab to
2382f22
Compare
having trouble with some tests, will let you know once done |
5b7066e to
1cabf60
Compare
Brief
In this PR
This Fixes #2662 partly (details at #2692 (comment))