[commands] Deprecate Command.schedule() (#7072)

It's only syntactic sugar over the CommandScheduler's schedule method and creates a footgun because it’s too obvious to try to use in incorrect places.

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
Gold856
2025-07-02 16:46:59 -04:00
committed by GitHub
parent a3ce880334
commit 26771e38fb
42 changed files with 77 additions and 66 deletions

View File

@@ -65,7 +65,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -67,7 +67,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -74,7 +74,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -65,7 +65,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -63,7 +63,7 @@ public class Robot extends TimedRobot {
m_autonomousCommand = m_robot.getAutonomousCommand();
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -58,7 +58,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -65,7 +65,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -65,7 +65,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -55,7 +55,7 @@ public class Robot extends TimedRobot {
m_autonomousCommand = m_robot.getAutonomousCommand();
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -58,7 +58,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -58,7 +58,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -36,7 +36,7 @@ public class Robot extends TimedRobot {
m_autonomousCommand = m_robotContainer.getAutonomousCommand();
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -58,7 +58,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}

View File

@@ -58,7 +58,7 @@ public class Robot extends TimedRobot {
// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
CommandScheduler.getInstance().schedule(m_autonomousCommand);
}
}