mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[robotpy] Mirror robotpy's commands-v2 (#8369)
Project import generated by Copybara. GitOrigin-RevId: 715c8e8372d936f447f2937aab6b1a22dc619126
This commit is contained in:
16
commandsv2/src/main/python/commands2/timedcommandrobot.py
Normal file
16
commandsv2/src/main/python/commands2/timedcommandrobot.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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
|
||||
)
|
||||
Reference in New Issue
Block a user