2828import org .littletonrobotics .junction .wpilog .WPILOGWriter ;
2929
3030/**
31- * The VM is configured to automatically run this class, and to call the
32- * functions corresponding to
33- * each mode, as described in the TimedRobot documentation. If you change the
34- * name of this class or
35- * the package after creating this project, you must also update the
36- * build.gradle file in the
31+ * The VM is configured to automatically run this class, and to call the functions corresponding to
32+ * each mode, as described in the TimedRobot documentation. If you change the name of this class or
33+ * the package after creating this project, you must also update the build.gradle file in the
3734 * project.
3835 */
3936public class Robot extends LoggedRobot implements Logged {
@@ -44,16 +41,15 @@ public class Robot extends LoggedRobot implements Logged {
4441 private double correctionAngle ;
4542
4643 /**
47- * This function is run when the robot is first started up and should be used
48- * for any
44+ * This function is run when the robot is first started up and should be used for any
4945 * initialization code.
5046 */
5147 @ Override
5248 public void robotInit () {
5349 System .out .println ("--Robot.robotInit()--" );
5450 RobotController .setBrownoutVoltage (
5551 4.75 ); // the "blackout" voltage is 4.5 // lowk if this bot dont work im setting this
56- // to
52+ // to
5753 // like 0
5854 configureAdvantageKit ();
5955 if (Constants .FeatureFlags .kMonologueEnabled ) {
@@ -64,15 +60,16 @@ public void robotInit() {
6460 m_robotContainer = new RobotContainer ();
6561
6662 Map <String , Integer > commandCounts = new HashMap <>();
67- BiConsumer <Command , Boolean > logCommandFunction = (Command command , Boolean active ) -> {
68- String name = command .getName ();
69- int count = commandCounts .getOrDefault (name , 0 ) + (active ? 1 : -1 );
70- commandCounts .put (name , count );
71-
72- Logger .recordOutput (
73- "CommandsUnique/" + name + "_" + Integer .toHexString (command .hashCode ()), active );
74- Logger .recordOutput ("CommandsAll/" + name , count > 0 );
75- };
63+ BiConsumer <Command , Boolean > logCommandFunction =
64+ (Command command , Boolean active ) -> {
65+ String name = command .getName ();
66+ int count = commandCounts .getOrDefault (name , 0 ) + (active ? 1 : -1 );
67+ commandCounts .put (name , count );
68+
69+ Logger .recordOutput (
70+ "CommandsUnique/" + name + "_" + Integer .toHexString (command .hashCode ()), active );
71+ Logger .recordOutput ("CommandsAll/" + name , count > 0 );
72+ };
7673 CommandScheduler .getInstance ()
7774 .onCommandInitialize (
7875 (Command command ) -> {
@@ -108,8 +105,9 @@ private void configureAdvantageKit() {
108105 } else {
109106 if (Constants .Logging .kAdvkitUseReplayLogs ) {
110107 setUseTiming (false ); // Run as fast as possible
111- String logPath = LogFileUtil
112- .findReplayLog (); // Pull the replay log from AdvantageScope (or prompt the user)
108+ String logPath =
109+ LogFileUtil
110+ .findReplayLog (); // Pull the replay log from AdvantageScope (or prompt the user)
113111 Logger .setReplaySource (new WPILOGReader (logPath )); // Read replay log
114112 // Save outputs to a new log
115113 Logger .addDataReceiver (new WPILOGWriter (LogFileUtil .addPathSuffix (logPath , "_sim" )));
@@ -166,13 +164,10 @@ private void configureMonologue() {
166164 }
167165
168166 /**
169- * This function is called every 20 ms, no matter the mode. Use this for items
170- * like diagnostics
167+ * This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
171168 * that you want ran during disabled, autonomous, teleoperated and test.
172169 *
173- * <p>
174- * This runs after the mode specific periodic functions, but before LiveWindow
175- * and
170+ * <p>This runs after the mode specific periodic functions, but before LiveWindow and
176171 * SmartDashboard integrated updating.
177172 */
178173 @ Override
@@ -204,17 +199,12 @@ public void robotPeriodic() {
204199
205200 /** This function is called once each time the robot enters Disabled mode. */
206201 @ Override
207- public void disabledInit () {
208- }
202+ public void disabledInit () {}
209203
210204 @ Override
211- public void disabledPeriodic () {
212- }
205+ public void disabledPeriodic () {}
213206
214- /**
215- * This autonomous runs the autonomous command selected by your
216- * {@link RobotContainer} class.
217- */
207+ /** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */
218208 @ Override
219209 public void autonomousInit () {
220210 m_autonomousCommand = m_robotContainer .getAutonomousCommand ();
@@ -227,8 +217,7 @@ public void autonomousInit() {
227217
228218 /** This function is called periodically during autonomous. */
229219 @ Override
230- public void autonomousPeriodic () {
231- }
220+ public void autonomousPeriodic () {}
232221
233222 @ Override
234223 public void teleopInit () {
@@ -243,8 +232,7 @@ public void teleopInit() {
243232
244233 /** This function is called periodically during operator control. */
245234 @ Override
246- public void teleopPeriodic () {
247- }
235+ public void teleopPeriodic () {}
248236
249237 @ Override
250238 public void testInit () {
@@ -254,8 +242,7 @@ public void testInit() {
254242
255243 /** This function is called periodically during test mode. */
256244 @ Override
257- public void testPeriodic () {
258- }
245+ public void testPeriodic () {}
259246
260247 @ Override
261248 public void driverStationConnected () {
@@ -275,11 +262,9 @@ public void driverStationConnected() {
275262
276263 /** This function is called once when the robot is first started up. */
277264 @ Override
278- public void simulationInit () {
279- }
265+ public void simulationInit () {}
280266
281267 /** This function is called periodically whilst in simulation. */
282268 @ Override
283- public void simulationPeriodic () {
284- }
269+ public void simulationPeriodic () {}
285270}
0 commit comments