[wpilib] IterativeRobotBase: Provide function to print watchdog epochs (#6581)

This commit is contained in:
Isaac Turner
2024-05-05 01:19:36 +08:00
committed by GitHub
parent 27babe5584
commit d3060d8eba
3 changed files with 14 additions and 0 deletions

View File

@@ -232,3 +232,7 @@ void IterativeRobotBase::LoopFunc() {
void IterativeRobotBase::PrintLoopOverrunMessage() {
FRC_ReportError(err::Error, "Loop time of {:.6f}s overrun", m_period.value());
}
void IterativeRobotBase::PrintWatchdogEpochs() {
m_watchdog.PrintEpochs();
}

View File

@@ -230,6 +230,11 @@ class IterativeRobotBase : public RobotBase {
*/
units::second_t GetPeriod() const;
/**
* Prints list of epochs added so far and their times.
*/
void PrintWatchdogEpochs();
/**
* Constructor for IterativeRobotBase.
*

View File

@@ -408,6 +408,11 @@ public abstract class IterativeRobotBase extends RobotBase {
}
}
/** Prints list of epochs added so far and their times. */
public void printWatchdogEpochs() {
m_watchdog.printEpochs();
}
private void printLoopOverrunMessage() {
DriverStation.reportWarning("Loop time of " + m_period + "s overrun\n", false);
}