diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp index 6541648966..7c73600509 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp @@ -19,6 +19,16 @@ void Robot::RobotInit() { frc::SmartDashboard::PutData("Auto Modes", &m_chooser); } +/** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ +void Robot::RobotPeriodic() {} + /** * This function is called once each time the robot enters Disabled mode. You * can use it to reset any subsystem information you want to clear when the diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.h b/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.h index ee87a84933..1a246cf6f8 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.h +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.h @@ -22,6 +22,7 @@ class Robot : public frc::TimedRobot { static OI m_oi; void RobotInit() override; + void RobotPeriodic() override; void DisabledInit() override; void DisabledPeriodic() override; void AutonomousInit() override; diff --git a/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp index d1450a4c82..22731e64c1 100644 --- a/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp @@ -17,6 +17,16 @@ void Robot::RobotInit() { frc::SmartDashboard::PutData("Auto Modes", &m_chooser); } +/** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ +void Robot::RobotPeriodic() {} + /** * This autonomous (along with the chooser code above) shows how to select * between different autonomous modes using the dashboard. The sendable chooser diff --git a/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h b/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h index 6d6302e168..05e233c526 100644 --- a/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h +++ b/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h @@ -15,6 +15,7 @@ class Robot : public frc::IterativeRobot { public: void RobotInit() override; + void RobotPeriodic() override; void AutonomousInit() override; void AutonomousPeriodic() override; void TeleopInit() override; diff --git a/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp index 9544e613fc..ff6f86a3fd 100644 --- a/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp @@ -17,6 +17,16 @@ void Robot::RobotInit() { frc::SmartDashboard::PutData("Auto Modes", &m_chooser); } +/** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ +void Robot::RobotPeriodic() {} + /** * This autonomous (along with the chooser code above) shows how to select * between different autonomous modes using the dashboard. The sendable chooser diff --git a/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.h b/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.h index 6d63f312ce..e78d66f121 100644 --- a/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.h +++ b/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.h @@ -15,6 +15,7 @@ class Robot : public frc::TimedRobot { public: void RobotInit() override; + void RobotPeriodic() override; void AutonomousInit() override; void AutonomousPeriodic() override; void TeleopInit() override; diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java index 8116b70286..935074871b 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java @@ -41,6 +41,18 @@ public class Robot extends TimedRobot { SmartDashboard.putData("Auto mode", m_chooser); } + /** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ + @Override + public void robotPeriodic() { + } + /** * This function is called once each time the robot enters Disabled mode. * You can use it to reset any subsystem information you want to clear when diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java index ece6edbd9f..80a2e17ba9 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java @@ -35,6 +35,18 @@ public class Robot extends IterativeRobot { SmartDashboard.putData("Auto choices", m_chooser); } + /** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ + @Override + public void robotPeriodic() { + } + /** * This autonomous (along with the chooser code above) shows how to select * between different autonomous modes using the dashboard. The sendable diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java index 7167f7099c..d2109a28fb 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java @@ -35,6 +35,18 @@ public class Robot extends TimedRobot { SmartDashboard.putData("Auto choices", m_chooser); } + /** + * This function is called every robot packet, no matter the mode. Use + * this for items like diagnostics that you want ran during disabled, + * autonomous, teleoperated and test. + * + *

This runs after the mode specific periodic functions, but before + * LiveWindow and SmartDashboard integrated updating. + */ + @Override + public void robotPeriodic() { + } + /** * This autonomous (along with the chooser code above) shows how to select * between different autonomous modes using the dashboard. The sendable