forked from SteelRidgeRobotics/2024MetalMelody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot.py
53 lines (38 loc) · 1.57 KB
/
robot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from commands.control_swerve_speed import ControlSwerveSpeed
import commands2
from commands2.timedcommandrobot import seconds
from phoenix6.signal_logger import SignalLogger
from wpilib import TimedRobot
from robotcontainer import RobotContainer
from wpilib import DriverStation, RobotBase
from wpilib.cameraserver import CameraServer
class MetalMelody(commands2.TimedCommandRobot):
def __init__(self, period: float = TimedRobot.kDefaultPeriod / 1000) -> None:
super().__init__(period)
def robotInit(self):
DriverStation.silenceJoystickConnectionWarning(True)
SignalLogger.enable_auto_logging(False)
self.container = RobotContainer()
#if RobotBase.isReal():
#CameraServer.launch()
def robotPeriodic(self) -> None:
self.container.updateMatchTime()
def _simulationPeriodic(self) -> None:
pass
def disabledInit(self) -> None:
pass
def disabledPeriodic(self) -> None:
pass
def autonomousInit(self) -> None:
self.container.swerve.navx.reset()
self.container.runSelectedAutoCommand()
def autonomousPeriodic(self) -> None:
pass
def teleopInit(self) -> None:
commands2.CommandScheduler.getInstance().schedule(ControlSwerveSpeed(self.container.lift, self.container.swerve, self.container.driverController.getLeftBumper))
def teleopPeriodic(self) -> None:
pass
def testInit(self) -> None:
pass
def testExit(self) -> None:
SignalLogger.stop()