Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove robotInit in favour of Robot constructor #607

Merged
merged 2 commits into from
Jul 29, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/CommandBasedRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
\#include <frc/smartdashboard/SmartDashboard.h>
\#include <frc2/command/CommandScheduler.h>

void Robot::RobotInit() {
Robot::Robot() {
EnableLiveWindowInTest(true);
HAL_Report(HALUsageReporting::kResourceType_Framework,
HALUsageReporting::kFramework_RobotBuilder);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/CommandBasedRobot.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Robot : public frc::TimedRobot {
public:
void RobotInit() override;
Robot();
void RobotPeriodic() override;
void DisabledInit() override;
void DisabledPeriodic() override;
Expand Down
7 changes: 3 additions & 4 deletions src/main/resources/export/java/RobotTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.properties was with the old (old) Ant build system. It would be nice to update this but not necessarily in this PR

* the project.
*/
public class Robot extends TimedRobot {
Expand All @@ -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();
Expand Down Expand Up @@ -115,4 +114,4 @@ public void testInit() {
public void testPeriodic() {
}

}
}