Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .factorypath
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<factorypath>
<factorypathentry kind="EXTJAR" id="/home/robot/.gradle/caches/modules-2/files-2.1/edu.wpi.first.epilogue/epilogue-runtime-java/2025.3.2/11f91500d1f4abcd6931ff0c2cd39cf57e392b86/epilogue-runtime-java-2025.3.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="EXTJAR" id="/home/robot/.gradle/caches/modules-2/files-2.1/edu.wpi.first.epilogue/epilogue-processor-java/2025.3.2/1afff56c1e460907df3cc06e20ba7d3ea291d58e/epilogue-processor-java-2025.3.2.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
5 changes: 5 additions & 0 deletions generalChanges.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change the watchdog timer to be 0.02 instead of the larger one (The one that is flooding the roborio).
How to minimize the logging that is flooding the robo rio?
Add a way to delete the deploy directory on each upload (https://www.chiefdelphi.com/t/clearing-the-deploy-directory-on-a-roborio-running-commands-on-the-roborio/458273/5).
What is the overhead for sending shuffleboard periodics?
Make controllers not switch on the drive station.
2 changes: 1 addition & 1 deletion src/main/java/Team4450/Robot25/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,4 @@ public static final class NeoMotorConstants {
//-------------------- No student code above this line ------------------------------------------------------

}
;
;
23 changes: 16 additions & 7 deletions src/main/java/Team4450/Robot25/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,24 @@ public class Robot extends TimedRobot
public void robotInit()
{
try {
// ! Do I not understand Java or what is this for?
robot = this; // Stored in Constants.

// ! What is the LCD, just to definition does not work on it and I don't see the import.
LCD.clearAll();
LCD.printLine(LCD_1, "Mode: RobotInit");

// Set up our custom logger.

// ! What is the difference.
Util.CustomLogger.setup();

// ! If this is the difference it should be before the line of code not after.
// ! If we are overrunning the periodic should we not just make it less frequent.

// The wpilib classes that underlie this class generate a lot of warning
// messages that flood the Riolog and make it almost unusable. The warnings
// are about our code in the robotPeriodic() function taking longer than .02
// are about our code in the robotPeriodic() function taking longer than 0.02
// sec to execute. It's very hard to stay under this limit. So...copied classes
// from the wpilib name space to inside this project and modified them to allow
// us to control these warnings and log some of them to our log file. The warnings
Expand All @@ -62,15 +68,16 @@ public void robotInit()
// IterativeRobotBase and Watchdog have been modified. TimedRobot is needed to
// pull in these modified classes. Look for "4450" in the code for the mods.
//
// Note that the periodic function is called very .02 sec. If our code runs too
// Note that the periodic function is called very 0.02 sec. If our code runs too
// long that can lead to various control problems. But, it has proven hard to
// do anything useful and not exceed the .02 sec watchdogs, though we have made
// do anything useful and not exceed the 0.02 sec watchdogs, though we have made
// improvements to various functions to reduce execution time or used threading.
// We have trimmed the volume of overrun messages but they still occur.

enableWatchDogWarning(false);
enableWatchDogFlush(false);
this.setWatchDogTimeout(.04);
// ! What does this mean, does it mean that commands are ran at the top of every second?
CommandScheduler.getInstance().setPeriod(1.0);

// Set Java to catch any uncaught exceptions and record them in our log file.
Expand All @@ -93,13 +100,12 @@ public void uncaughtException(Thread t, Throwable e)

SendableVersion.INSTANCE.init(PROGRAM_NAME);

// Why will this information not be correct during simulation.
// Note: under simulation, this information will not be correct.
Util.consoleLog("%s compiled by %s at %s (branch=%s, commit=%s)", SendableVersion.INSTANCE.getProgramVersion(),
SendableVersion.INSTANCE.getUser(), SendableVersion.INSTANCE.getTime(), SendableVersion.INSTANCE.getBranch(),
SendableVersion.INSTANCE.getCommit());

//Util.consoleLog("manifest path=%s", SendableVersion.INSTANCE.getPath());

// Send program version to the dashboard.
SmartDashboard.putString("Program", PROGRAM_NAME);

Expand All @@ -108,6 +114,8 @@ public void uncaughtException(Thread t, Throwable e)
Util.consoleLog("Robot WPILib=%s Java=%s", WPILibVersion.Version, System.getProperty("java.version"));
Util.consoleLog("RobotLib=%s", LibraryVersion.version);

// ! Is there a way to fix this.

// Note: Any Sendables added to SmartDashboard or Shuffleboard are sent to the DS on every
// loop of a TimedRobot. In this case it means that the SendableVersion data would be sent
// to the DS every 20ms even though it does not change. Sendables must be added to the SDB
Expand All @@ -131,7 +139,8 @@ public void uncaughtException(Thread t, Throwable e)
Util.logException(e);
endCompetition();
}

// ! What is this?
// ! Is this just a number of '-' characters to split up the log.
Util.consoleLog(functionMarker);
}

Expand All @@ -147,7 +156,7 @@ public void uncaughtException(Thread t, Throwable e)
@Override
public void robotPeriodic()
{
// This function is called approx every .02 second.
// This function is called approx every 0.02 second.
// Runs the Scheduler. It is responsible for polling buttons, adding newly-scheduled
// commands, running already-scheduled commands, removing finished or interrupted commands,
// and running subsystem periodic() methods. Scheduler must be called from the robot's periodic
Expand Down
Loading