From 32842404d1119acdde767260c4b277b52907440c Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Sat, 27 Jul 2024 22:37:24 +0800 Subject: [PATCH 1/2] Remove robotInit in favour of Robot constructor See https://github.com/wpilibsuite/allwpilib/issues/6845 --- src/main/resources/export/java/RobotTemplate.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/resources/export/java/RobotTemplate.java b/src/main/resources/export/java/RobotTemplate.java index ecb23be3..a96ab789 100644 --- a/src/main/resources/export/java/RobotTemplate.java +++ b/src/main/resources/export/java/RobotTemplate.java @@ -14,7 +14,7 @@ * The VM is configured to automatically run this class, and to call the * functions corresponding to each mode, as described in the TimedRobot * documentation. If you change the name of this class or the package after - * creating this project, you must also update the build.properties file in + * creating this project, you must also update the build.properties file in * the project. */ public class Robot extends TimedRobot { @@ -27,8 +27,7 @@ public class Robot extends TimedRobot { * This function is run when the robot is first started up and should be * used for any initialization code. */ - @Override - public void robotInit() { + public Robot() { // Instantiate our RobotContainer. This will perform all our button bindings, and put our // autonomous chooser on the dashboard. m_robotContainer = RobotContainer.getInstance(); @@ -115,4 +114,4 @@ public void testInit() { public void testPeriodic() { } -} \ No newline at end of file +} From 39dc022ae8157e1793a7aa8da37013381b371517 Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Mon, 29 Jul 2024 08:56:02 +0800 Subject: [PATCH 2/2] cpp --- src/main/resources/export/cpp/CommandBasedRobot.cpp | 2 +- src/main/resources/export/cpp/CommandBasedRobot.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/export/cpp/CommandBasedRobot.cpp b/src/main/resources/export/cpp/CommandBasedRobot.cpp index c9541bc0..79ab1bfb 100644 --- a/src/main/resources/export/cpp/CommandBasedRobot.cpp +++ b/src/main/resources/export/cpp/CommandBasedRobot.cpp @@ -8,7 +8,7 @@ \#include \#include -void Robot::RobotInit() { +Robot::Robot() { EnableLiveWindowInTest(true); HAL_Report(HALUsageReporting::kResourceType_Framework, HALUsageReporting::kFramework_RobotBuilder); diff --git a/src/main/resources/export/cpp/CommandBasedRobot.h b/src/main/resources/export/cpp/CommandBasedRobot.h index a114a92e..5d46640a 100644 --- a/src/main/resources/export/cpp/CommandBasedRobot.h +++ b/src/main/resources/export/cpp/CommandBasedRobot.h @@ -9,7 +9,7 @@ class Robot : public frc::TimedRobot { public: - void RobotInit() override; + Robot(); void RobotPeriodic() override; void DisabledInit() override; void DisabledPeriodic() override;