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().
As mentioned in the lib199 tour, in
RobotPath.createPathCommand
,hs.reset()
should be called as part of anInstantCommand
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 tohs.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 aHeadingSupplier.stop()
method which stops the timer and callsHeadingSupplier.reset()
.