forked from fairviewrobotics/2025-robot-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobot.java
More file actions
91 lines (71 loc) · 2.21 KB
/
Robot.java
File metadata and controls
91 lines (71 loc) · 2.21 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* Black Knights Robotics (C) 2025 */
package org.blackknights;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
public class Robot extends TimedRobot {
private Command autonomousCommand;
private final RobotContainer robotContainer;
public Robot() {
robotContainer = new RobotContainer();
}
@Override
public void robotInit() {
robotContainer.robotInit();
// Logger.recordMetadata("ProjectName", "2025_Robot");
//
// if (isReal()) {
// Logger.addDataReceiver(new NT4Publisher());
// new PowerDistribution(1, PowerDistribution.ModuleType.kRev);
// } else {
// setUseTiming(false);
// String logPath = LogFileUtil.findReplayLog();
// Logger.setReplaySource(new WPILOGReader(logPath));
// Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath,
// "_sim")));
// }
//
// Logger.start();
}
@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();
robotContainer.robotPeriodic();
}
@Override
public void disabledInit() {}
@Override
public void disabledPeriodic() {}
@Override
public void disabledExit() {}
@Override
public void autonomousInit() {
autonomousCommand = robotContainer.getAutonomousCommand().get();
if (autonomousCommand != null) {
autonomousCommand.schedule();
}
}
@Override
public void autonomousPeriodic() {}
@Override
public void autonomousExit() {}
@Override
public void teleopInit() {
if (autonomousCommand != null) {
autonomousCommand.cancel();
}
robotContainer.teleopInit();
}
@Override
public void teleopPeriodic() {}
@Override
public void teleopExit() {}
@Override
public void testInit() {
CommandScheduler.getInstance().cancelAll();
}
@Override
public void testPeriodic() {}
@Override
public void testExit() {}
}