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 update period for the first update after activation #1551

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented May 24, 2024

The issue was that the period argument of the controller's first update() call after activation was basically time->now().
This wasn't covered by the test because there the time argument was counting from zero on.

I fixed the initialization to be done before calculating the period, now it gets the exact value of controller_period at the first call.

Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.71%. Comparing base (9f1007b) to head (28fb945).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1551      +/-   ##
==========================================
+ Coverage   87.70%   87.71%   +0.01%     
==========================================
  Files         102      102              
  Lines        8702     8703       +1     
  Branches      780      780              
==========================================
+ Hits         7632     7634       +2     
+ Misses        790      789       -1     
  Partials      280      280              
Flag Coverage Δ
unittests 87.71% <100.00%> (+0.01%) ⬆️

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

Files Coverage Δ
controller_manager/src/controller_manager.cpp 74.63% <100.00%> (+0.07%) ⬆️
...r_manager/test/test_controller/test_controller.cpp 94.73% <100.00%> (ø)
...r_manager/test/test_controller/test_controller.hpp 100.00% <ø> (ø)
...ontroller_manager/test/test_controller_manager.cpp 93.50% <100.00%> (+0.08%) ⬆️

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

The logic and the rest look good to me.

Thanks for fixing it.

One minor comment on the debug print

controller_manager/src/controller_manager.cpp Outdated Show resolved Hide resolved
@bmagyar bmagyar merged commit 1ed61ef into master Jun 3, 2024
16 of 18 checks passed
@bmagyar bmagyar deleted the fix_period_after_activation branch June 3, 2024 11:09
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