Skip to content

Commit 83cac71

Browse files
committed
More fixes
1 parent 147b348 commit 83cac71

File tree

10 files changed

+12
-9
lines changed

10 files changed

+12
-9
lines changed

wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public void initSendable(SendableBuilder builder) {
596596
value -> {
597597
if (value) {
598598
if (!isScheduled()) {
599-
schedule();
599+
CommandScheduler.getInstance().schedule(this);
600600
}
601601
} else {
602602
if (isScheduled()) {

wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ class CommandPtr final {
286286

287287
/**
288288
* Schedules this command.
289+
*
290+
* @deprecated Use CommandScheduler::GetInstance().Schedule() instead
289291
*/
292+
[[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]]
290293
void Schedule() const&;
291294

292295
// Prevent calls on a temporary, as the returned pointer would be invalid

wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
3838
m_autonomousCommand = m_container.GetAutonomousCommand();
3939

4040
if (m_autonomousCommand) {
41-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
41+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
4242
}
4343
}
4444

wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void Robot::AutonomousInit() {
4747
m_autonomousCommand = m_container.GetAutonomousCommand();
4848

4949
if (m_autonomousCommand != nullptr) {
50-
m_autonomousCommand->Schedule();
50+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
5151
}
5252
}
5353

wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
3838
m_autonomousCommand = m_container.GetAutonomousCommand();
3939

4040
if (m_autonomousCommand) {
41-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
41+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
4242
}
4343
}
4444

wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void Robot::AutonomousInit() {
2626
m_autonomousCommand = m_robot.GetAutonomousCommand();
2727

2828
if (m_autonomousCommand) {
29-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
29+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
3030
}
3131
}
3232

wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
3838
m_autonomousCommand = m_container.GetAutonomousCommand();
3939

4040
if (m_autonomousCommand) {
41-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
41+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
4242
}
4343
}
4444

wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void Robot::AutonomousInit() {
2222
m_autonomousCommand = m_container.GetAutonomousCommand();
2323

2424
if (m_autonomousCommand) {
25-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
25+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
2626
}
2727
}
2828

wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void Robot::AutonomousInit() {
3737
m_autonomousCommand = m_container.GetAutonomousCommand();
3838

3939
if (m_autonomousCommand) {
40-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
40+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
4141
}
4242
}
4343

wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void Robot::AutonomousInit() {
2222
m_autonomousCommand = m_container.GetAutonomousCommand();
2323

2424
if (m_autonomousCommand) {
25-
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
25+
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
2626
}
2727
}
2828

0 commit comments

Comments
 (0)