mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[py][cmd2] Fix opmodes merge (#8473)
Looks like a build failure got lost in the landing order of python commands and the big opmode change. This makes it compile again, based on the java / C++ changes from the opmode PR.
This commit is contained in:
@@ -10,7 +10,7 @@ import hal
|
||||
from typing_extensions import Self
|
||||
from wpilib import (
|
||||
RobotBase,
|
||||
RobotState,
|
||||
DriverStation,
|
||||
TimedRobot,
|
||||
Watchdog,
|
||||
reportWarning,
|
||||
@@ -191,7 +191,7 @@ class CommandScheduler(Sendable):
|
||||
if self.isScheduled(command):
|
||||
return
|
||||
|
||||
if RobotState.isDisabled() and not command.runsWhenDisabled():
|
||||
if DriverStation.isDisabled() and not command.runsWhenDisabled():
|
||||
return
|
||||
|
||||
requirements = command.getRequirements()
|
||||
@@ -249,7 +249,7 @@ class CommandScheduler(Sendable):
|
||||
self._watchdog.addEpoch("buttons.run()")
|
||||
|
||||
self._inRunLoop = True
|
||||
isDisabled = RobotState.isDisabled()
|
||||
isDisabled = DriverStation.isDisabled()
|
||||
|
||||
# Run scheduled commands, remove finished commands.
|
||||
for command in self._scheduledCommands.copy():
|
||||
|
||||
@@ -7,7 +7,6 @@ if TYPE_CHECKING:
|
||||
from .util import *
|
||||
|
||||
import pytest
|
||||
from wpilib import RobotState
|
||||
|
||||
|
||||
def test_robotDisabledCommandCancel(scheduler: commands2.CommandScheduler):
|
||||
|
||||
Reference in New Issue
Block a user