From 8c8d94d9f7bacc7d1873f875224de00f09ff7b6c Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Tue, 17 Sep 2024 19:42:50 -0400 Subject: [PATCH] Replace most usages of schedule() --- .../wpi/first/wpilibj2/command/ProxyCommand.java | 2 +- .../first/wpilibj2/command/ScheduleCommand.java | 2 +- .../wpi/first/wpilibj2/command/button/Trigger.java | 14 +++++++------- .../src/main/native/cpp/frc2/command/Command.cpp | 2 +- .../main/native/cpp/frc2/command/ProxyCommand.cpp | 2 +- .../native/cpp/frc2/command/ScheduleCommand.cpp | 2 +- .../native/cpp/frc2/command/button/Trigger.cpp | 14 +++++++------- .../command/CommandSendableButtonTest.java | 4 ++-- .../first/wpilibj2/command/ProxyCommandTest.java | 2 +- .../wpilibj2/command/ScheduleCommandTest.java | 4 ++-- .../wpilibj2/command/button/NetworkButtonTest.java | 4 ++-- .../first/wpilibj2/command/button/TriggerTest.java | 6 +++--- .../cpp/frc2/command/CommandSendableButtonTest.cpp | 4 ++-- .../examples/DriveDistanceOffboard/cpp/Robot.cpp | 2 +- .../cpp/examples/HatchbotInlined/cpp/Robot.cpp | 2 +- .../MecanumControllerCommand/cpp/Robot.cpp | 2 +- .../examples/RapidReactCommandBot/cpp/Robot.cpp | 2 +- .../main/cpp/examples/RomiReference/cpp/Robot.cpp | 2 +- .../main/cpp/examples/SelectCommand/cpp/Robot.cpp | 2 +- .../examples/SwerveControllerCommand/cpp/Robot.cpp | 2 +- .../src/main/cpp/examples/SysId/cpp/Robot.cpp | 2 +- .../main/cpp/examples/XRPReference/cpp/Robot.cpp | 2 +- .../main/cpp/templates/commandbased/cpp/Robot.cpp | 2 +- .../templates/commandbasedskeleton/cpp/Robot.cpp | 2 +- .../examples/drivedistanceoffboard/Robot.java | 2 +- .../wpilibj/examples/hatchbotinlined/Robot.java | 2 +- .../examples/hatchbottraditional/Robot.java | 2 +- .../examples/mecanumcontrollercommand/Robot.java | 2 +- .../examples/rapidreactcommandbot/Robot.java | 2 +- .../wpilibj/examples/romireference/Robot.java | 2 +- .../wpilibj/examples/selectcommand/Robot.java | 2 +- .../examples/swervecontrollercommand/Robot.java | 2 +- .../wpi/first/wpilibj/examples/sysid/Robot.java | 2 +- .../first/wpilibj/examples/xrpreference/Robot.java | 2 +- .../wpilibj/templates/commandbased/Robot.java | 2 +- .../templates/commandbasedskeleton/Robot.java | 2 +- .../wpilibj/templates/romicommandbased/Robot.java | 2 +- .../wpilibj/templates/xrpcommandbased/Robot.java | 2 +- 38 files changed, 56 insertions(+), 56 deletions(-) diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java index 7225dee1a97..838053f1748 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java @@ -59,7 +59,7 @@ public ProxyCommand(Command command) { @Override public void initialize() { m_command = m_supplier.get(); - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); } @Override diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java index cc2234119ea..788f6fc2b0a 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java @@ -28,7 +28,7 @@ public ScheduleCommand(Command... toSchedule) { @Override public void initialize() { for (Command command : m_toSchedule) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java index d7b1dd08937..84d1e1033ac 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java @@ -66,7 +66,7 @@ public void run() { boolean pressed = m_condition.getAsBoolean(); if (m_pressedLast != pressed) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } m_pressedLast = pressed; @@ -92,7 +92,7 @@ public void run() { boolean pressed = m_condition.getAsBoolean(); if (!m_pressedLast && pressed) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } m_pressedLast = pressed; @@ -118,7 +118,7 @@ public void run() { boolean pressed = m_condition.getAsBoolean(); if (m_pressedLast && !pressed) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } m_pressedLast = pressed; @@ -148,7 +148,7 @@ public void run() { boolean pressed = m_condition.getAsBoolean(); if (!m_pressedLast && pressed) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } else if (m_pressedLast && !pressed) { command.cancel(); } @@ -180,7 +180,7 @@ public void run() { boolean pressed = m_condition.getAsBoolean(); if (m_pressedLast && !pressed) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } else if (!m_pressedLast && pressed) { command.cancel(); } @@ -211,7 +211,7 @@ public void run() { if (command.isScheduled()) { command.cancel(); } else { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } @@ -241,7 +241,7 @@ public void run() { if (command.isScheduled()) { command.cancel(); } else { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp index ff5e8f6aa51..b0635c92bf5 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp @@ -200,7 +200,7 @@ void Command::InitSendable(wpi::SendableBuilder& builder) { [this](bool value) { bool isScheduled = IsScheduled(); if (value && !isScheduled) { - Schedule(); + CommandScheduler::GetInstance().Schedule(this); } else if (!value && isScheduled) { Cancel(); } diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp index fa72906b622..7ec5973138f 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp @@ -34,7 +34,7 @@ ProxyCommand::ProxyCommand(std::unique_ptr command) { void ProxyCommand::Initialize() { m_command = m_supplier(); - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command); } void ProxyCommand::End(bool interrupted) { diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp index c96f21835e5..e0ce85d2911 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp @@ -18,7 +18,7 @@ ScheduleCommand::ScheduleCommand(Command* toSchedule) { void ScheduleCommand::Initialize() { for (auto command : m_toSchedule) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp index 78fd0b3f769..8495bd08e16 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp @@ -19,7 +19,7 @@ Trigger Trigger::OnChange(Command* command) { bool current = condition(); if (previous != current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } previous = current; @@ -47,7 +47,7 @@ Trigger Trigger::OnTrue(Command* command) { bool current = condition(); if (!previous && current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } previous = current; @@ -75,7 +75,7 @@ Trigger Trigger::OnFalse(Command* command) { bool current = condition(); if (previous && !current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } previous = current; @@ -103,7 +103,7 @@ Trigger Trigger::WhileTrue(Command* command) { bool current = condition(); if (!previous && current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (previous && !current) { command->Cancel(); } @@ -135,7 +135,7 @@ Trigger Trigger::WhileFalse(Command* command) { bool current = condition(); if (previous && !current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (!previous && current) { command->Cancel(); } @@ -170,7 +170,7 @@ Trigger Trigger::ToggleOnTrue(Command* command) { if (command->IsScheduled()) { command->Cancel(); } else { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } @@ -206,7 +206,7 @@ Trigger Trigger::ToggleOnFalse(Command* command) { if (command->IsScheduled()) { command->Cancel(); } else { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java index c89ed7f7f3e..809044aeb03 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java @@ -55,7 +55,7 @@ void trueAndNotScheduledSchedules() { @Test void trueAndScheduledNoOp() { // Scheduled and true -> no-op - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); CommandScheduler.getInstance().run(); SmartDashboard.updateValues(); assertTrue(m_command.isScheduled()); @@ -90,7 +90,7 @@ void falseAndNotScheduledNoOp() { @Test void falseAndScheduledCancel() { // Scheduled and false -> cancel - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); CommandScheduler.getInstance().run(); SmartDashboard.updateValues(); assertTrue(m_command.isScheduled()); diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java index c4b43a609b7..59e7bd69d5f 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java @@ -22,7 +22,7 @@ void proxyCommandScheduleTest() { scheduler.schedule(scheduleCommand); - verify(command1).schedule(); + verify(command1).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java index 9014bc7b96e..eeaa9ee8c88 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java @@ -22,8 +22,8 @@ void scheduleCommandScheduleTest() { scheduler.schedule(scheduleCommand); - verify(command1).schedule(); - verify(command2).schedule(); + verify(command1).initialize(); + verify(command2).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java index b9adc1344c3..7b1de35046f 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java @@ -39,10 +39,10 @@ void setNetworkButtonTest() { pub.set(false); button.onTrue(command); scheduler.run(); - verify(command, never()).schedule(); + verify(command, never()).initialize(); pub.set(true); scheduler.run(); scheduler.run(); - verify(command).schedule(); + verify(command).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java index 8cd5fdea2f1..58406847eff 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java @@ -207,7 +207,7 @@ void cancelWhenActiveTest() { .until(button); button.setPressed(false); - command1.schedule(); + scheduler.schedule(command1); scheduler.run(); assertEquals(1, startCounter.get()); assertEquals(0, endCounter.get()); @@ -258,13 +258,13 @@ void debounceTest() { button.setPressed(true); scheduler.run(); - verify(command, never()).schedule(); + verify(command, never()).initialize(); SimHooks.stepTiming(0.3); button.setPressed(true); scheduler.run(); - verify(command).schedule(); + verify(command).initialize(); } @Test diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp index 08caa5cddaf..ae2a1098ed3 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp @@ -49,7 +49,7 @@ TEST_F(CommandSendableButtonTest, trueAndNotScheduledSchedules) { TEST_F(CommandSendableButtonTest, trueAndScheduledNoOp) { // Scheduled and true -> no-op - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command); GetScheduler().Run(); frc::SmartDashboard::UpdateValues(); EXPECT_TRUE(m_command->IsScheduled()); @@ -82,7 +82,7 @@ TEST_F(CommandSendableButtonTest, falseAndNotScheduledNoOp) { TEST_F(CommandSendableButtonTest, falseAndScheduledCancel) { // Scheduled and false -> cancel - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command); GetScheduler().Run(); frc::SmartDashboard::UpdateValues(); EXPECT_TRUE(m_command->IsScheduled()); diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp index 142d59fa6be..08952dfed1d 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp index d731edc1c90..fdd7a4941fc 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp @@ -47,7 +47,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp index 142d59fa6be..08952dfed1d 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp index d28c275f8ef..53b470bf35d 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp @@ -26,7 +26,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_robot.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp index 59163407357..904a39eb4f6 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp index 580decec83e..798be1ab1de 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp index 142d59fa6be..08952dfed1d 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp index 2ed3f804f55..494e73b9988 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp @@ -22,7 +22,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp index 59163407357..904a39eb4f6 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp index 6a1eb4beea5..6902d0217af 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp index 2ed3f804f55..494e73b9988 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp @@ -22,7 +22,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java index 208c6bc8f0e..0525a1d4f65 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java @@ -65,7 +65,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java index df9582e035e..faaa97ffd45 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java @@ -67,7 +67,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java index 39ea80d06a3..720316874b7 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java @@ -74,7 +74,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java index f4453a37e25..beec10031af 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java @@ -65,7 +65,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java index 463e1d6f3c8..c90dd0d18b6 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java @@ -63,7 +63,7 @@ public void autonomousInit() { m_autonomousCommand = m_robot.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java index 6ea9e353ed6..337a4782644 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java @@ -58,7 +58,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java index 8bcf44391b9..0e00fa479e9 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java @@ -65,7 +65,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java index 850fcfe71e2..94f7eecf724 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java @@ -65,7 +65,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysid/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysid/Robot.java index 3f9640ffed9..6a33ccdacb2 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysid/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysid/Robot.java @@ -55,7 +55,7 @@ public void autonomousInit() { m_autonomousCommand = m_robot.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java index bf3b76c13da..9bb81b3374b 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java @@ -58,7 +58,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } 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 3ea9a262699..053bd402fc5 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 @@ -58,7 +58,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java index 753f54f3623..45dc6fc8f26 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java @@ -36,7 +36,7 @@ public void autonomousInit() { m_autonomousCommand = m_robotContainer.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java index 3282138cf2c..6831a89e269 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java @@ -58,7 +58,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java index f9a51fec871..4196c275e28 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java @@ -58,7 +58,7 @@ public void autonomousInit() { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } }