-
Notifications
You must be signed in to change notification settings - Fork 310
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
Reset moving average #1984
base: master
Are you sure you want to change the base?
Reset moving average #1984
Conversation
Signed-off-by: Angsa Deployment Team <[email protected]>
Signed-off-by: Angsa Deployment Team <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Co-authored-by: Christoph Fröhlich <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
@@ -2322,6 +2322,10 @@ std::vector<std::string> ControllerManager::get_controller_names() | |||
|
|||
void ControllerManager::read(const rclcpp::Time & time, const rclcpp::Duration & period) | |||
{ | |||
if (periodicity_stats_.GetCount() >= 100) |
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.
the window size could be made configurable
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.
good point. Could you please add a param for that? I think 100 is a good default value for resetting
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 think it is better to leave it to the user to define it. If not defined, let it accumulate from the beginning.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1984 +/- ##
==========================================
- Coverage 89.26% 89.16% -0.10%
==========================================
Files 130 130
Lines 14493 14501 +8
Branches 1257 1258 +1
==========================================
- Hits 12937 12930 -7
- Misses 1088 1098 +10
- Partials 468 473 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thank you, this is pretty useful for diagnosing edge cases
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'm curious to know why your read cycle happened in 0.00001615 sec (61919,5044 Hz)? This doesn't make sense at all in my opinion. Can you share some information regarding your setup. That's the reason that it is reporting the issue.
For the first sample to be a valid one, this change was introduced. We have tests running in the CI with around 10-20% margin as it doesn't have a RT patch
rclcpp::Time previous_time = cm->now() - period; |
I would suggest to take a look at your setup and understand why your |
I fully agree, I just did not want to go through the pain of debugging why only one of the cycles is executed super quickly. I printed out the measurements and it's really just one that is "problematic". It really doesn't affect my application at all and it will be hard to debug. I suspect it's something to do with a CPU/Load spike of my system at startup. |
Then we will have to check with #1918, after this is merged. My idea is to add this info into it, so you can diagnose it at run time. Regarding the CPU/Load spike of my system at startup, it could cause the minimum periodicity, but the max might be coming from the first iteration |
See #1871 (comment)