forked from AlphaKnights/2025RobotPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobot.py
More file actions
36 lines (26 loc) · 1.04 KB
/
Copy pathrobot.py
File metadata and controls
36 lines (26 loc) · 1.04 KB
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
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#
import commands2
import wpilib
from robotcontainer import RobotContainer
class MyRobot(commands2.TimedCommandRobot):
def robotInit(self) -> None:
# Instantiate our RobotContainer. This will perform all our button bindings, and put our
# autonomous chooser on the dashboard.
self.container = RobotContainer()
self.autonomousCommand = None
# def autonomousInit(self) -> None:
# self.autonomousCommand = self.container.getAutonomousCommand()
# if self.autonomousCommand:
# self.autonomousCommand.schedule()
def teleopInit(self) -> None:
if self.autonomousCommand:
self.autonomousCommand.cancel()
def testInit(self) -> None:
commands2.CommandScheduler.getInstance().cancelAll()
if __name__ == "__main__":
wpilib.run(MyRobot)