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

Robocup bug fix of Thunderloop clock #3317

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

mkhlb
Copy link
Contributor

@mkhlb mkhlb commented Sep 24, 2024

Please fill out the following before requesting review on this PR

Description

next_shot is supposed to be an absolute time at which the next thunderloop iteration is supposed to run. Thus to maintain a constant interval inbetween iterations it should be incremented by a constant amount. Before this PR thunderloop would run at shorter intervals if it took longer to run the current iteration.

The fix done in 5828d4e was different, changing the entire Thunderloop clock to use a relative sleep. Feel free to comment if you believe that was a better fix than this.

Testing Done

No on robot testing done yet, but Thunderloop builds fine.

Resolved Issues

Length Justification and Key Files to Review

It is not long.

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

Again compare with 5828d4e as that has an alternative fix with an equivalent effect.

williamckha
williamckha previously approved these changes Sep 25, 2024
Copy link

Thunderloop clock fix

Mr-Anyone
Mr-Anyone previously approved these changes Oct 14, 2024
williamckha
williamckha previously approved these changes Oct 15, 2024
Copy link
Contributor

@williamckha williamckha left a comment

Choose a reason for hiding this comment

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

Side note, we should consider using std::chrono::steady_clock and std::this_thread::sleep_for instead of the libc functions. Then we could also get rid of the helper functions for converting timespec to milliseconds/nanoseconds and just use the std::chrono API

@williamckha williamckha dismissed stale reviews from Mr-Anyone and themself via f4aded5 November 4, 2024 23:48
williamckha
williamckha previously approved these changes Nov 4, 2024
williamckha
williamckha previously approved these changes Nov 5, 2024
Mr-Anyone
Mr-Anyone previously approved these changes Nov 5, 2024
Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

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

looks good, pending CI

@williamckha williamckha dismissed stale reviews from Mr-Anyone and themself via 507eb1b November 12, 2024 06:21
@itsarune itsarune merged commit 87b422f into UBC-Thunderbots:master Nov 12, 2024
7 checks passed
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.

4 participants