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

Add API to set next sensor update time #196

Merged
merged 2 commits into from
Feb 25, 2022
Merged

Add API to set next sensor update time #196

merged 2 commits into from
Feb 25, 2022

Conversation

mjcarroll
Copy link
Contributor

🎉 API for setting next update time

Summary

This method allows external uers to set the next update time for a sensor.

One potential application:

  • Sensors that have irregular update times that don't follow a dt

This fixes two issues with time and sensors:

  • Large jumps forward in time will cause sensors to update too much to "catch up" to the current time, as the next time was only ever incremented by dt
  • Large jumps backward in time will cause sensors to stop updating until the reach "nextupdatetime"

Test it

See the unit tests for intended behaviors.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Michael Carroll <michael@openrobotics.org>
@mjcarroll mjcarroll requested a review from iche033 as a code owner February 22, 2022 18:18
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Feb 22, 2022
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #196 (eb44ac0) into main (b1f78a5) will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
+ Coverage   71.08%   71.26%   +0.17%     
==========================================
  Files          30       30              
  Lines        3092     3097       +5     
==========================================
+ Hits         2198     2207       +9     
+ Misses        894      890       -4     
Impacted Files Coverage Δ
src/Sensor.cc 91.46% <100.00%> (+2.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1f78a5...eb44ac0. Read the comment docs.

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM!

src/Sensor_TEST.cc Outdated Show resolved Hide resolved
src/Sensor_TEST.cc Outdated Show resolved Hide resolved
Signed-off-by: Michael Carroll <michael@openrobotics.org>

Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
@mjcarroll mjcarroll merged commit 1133ee0 into main Feb 25, 2022
@mjcarroll mjcarroll deleted the set_next_update branch February 25, 2022 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants