UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
53 stars 110 forks source link

Robocup bug fix of Thunderloop clock #3317

Open mkhlb opened 1 week ago

mkhlb commented 1 week ago

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 https://github.com/UBC-Thunderbots/Software/commit/5828d4ef6622a8a3b562a2da36d24954c1ad7f62 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

Again compare with https://github.com/UBC-Thunderbots/Software/commit/5828d4ef6622a8a3b562a2da36d24954c1ad7f62 as that has an alternative fix with an equivalent effect.