From 81498e6af9159372b85143c1ec650761cf7b644f Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Thu, 4 Oct 2018 01:02:07 -0700 Subject: [PATCH] Deprecate IterativeRobot in favor of TimedRobot (#1341) Since https://github.com/wpilibsuite/allwpilib/issues/786 has been closed as not a legitimate concern, there is now no reason to use IterativeRobot over TimedRobot. It's a drop-in replacement that's strictly an improvement in terms of execution jitter. To migrate, one simply has to replace the IterativeRobot subclass in their robot code with TimedRobot. --- wpilibc/src/main/native/include/frc/IterativeRobot.h | 3 +++ .../src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/wpilibc/src/main/native/include/frc/IterativeRobot.h b/wpilibc/src/main/native/include/frc/IterativeRobot.h index c38aa31a0e..8ce63563d0 100644 --- a/wpilibc/src/main/native/include/frc/IterativeRobot.h +++ b/wpilibc/src/main/native/include/frc/IterativeRobot.h @@ -22,6 +22,9 @@ namespace frc { */ class IterativeRobot : public IterativeRobotBase { public: + WPI_DEPRECATED( + "Use TimedRobot instead. It's a drop-in replacement that provides more " + "regular execution periods.") IterativeRobot(); virtual ~IterativeRobot() = default; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java index e5bc4b69e1..e72033edae 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java @@ -18,7 +18,11 @@ import edu.wpi.first.hal.HAL; * *

periodic() functions from the base class are called each time a new packet is received from * the driver station. + * + * @deprecated Use TimedRobot instead. It's a drop-in replacement that provides more regular + * execution periods. */ +@Deprecated public class IterativeRobot extends IterativeRobotBase { private static final double kPacketPeriod = 0.02;