mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
17 lines
405 B
Python
17 lines
405 B
Python
|
|
# notrack
|
||
|
|
from wpilib import TimedRobot
|
||
|
|
|
||
|
|
from .commandscheduler import CommandScheduler
|
||
|
|
|
||
|
|
seconds = float
|
||
|
|
|
||
|
|
|
||
|
|
class TimedCommandRobot(TimedRobot):
|
||
|
|
kSchedulerOffset = 0.005
|
||
|
|
|
||
|
|
def __init__(self, period: seconds = TimedRobot.kDefaultPeriod / 1000) -> None:
|
||
|
|
super().__init__(period)
|
||
|
|
self.addPeriodic(
|
||
|
|
CommandScheduler.getInstance().run, period, self.kSchedulerOffset
|
||
|
|
)
|