DeepBlueRobotics / lib199

Code that we reuse in different projects/years.
Other
2 stars 0 forks source link

Create a `RobotPath.HeadingSupplier.stop()` Method #53

Closed CoolSpy3 closed 1 year ago

CoolSpy3 commented 1 year ago

As mentioned in the lib199 tour, in RobotPath.createPathCommand, hs.reset() should be called as part of an InstantCommand appended to the beginning of the returned path group. This would fix a bug where (because the heading supplier's time does not get stopped after the path completes), the timer continues running between the call to hs.reset() and the start of the path if the path is re-run, leading to incorrect headings. A better option is to do the above as well as create a HeadingSupplier.stop() method which stops the timer and calls HeadingSupplier.reset().