Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Sep 18, 2024
1 parent 147b348 commit 83cac71
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public void initSendable(SendableBuilder builder) {
value -> {
if (value) {
if (!isScheduled()) {
schedule();
CommandScheduler.getInstance().schedule(this);
}
} else {
if (isScheduled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ class CommandPtr final {

/**
* Schedules this command.
*
* @deprecated Use CommandScheduler::GetInstance().Schedule() instead
*/
[[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]]
void Schedule() const&;

// Prevent calls on a temporary, as the returned pointer would be invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_robot.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
2 changes: 1 addition & 1 deletion wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Robot::AutonomousInit() {
m_autonomousCommand = m_container.GetAutonomousCommand();

if (m_autonomousCommand) {
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand);
frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
}
}

Expand Down

0 comments on commit 83cac71

Please sign in to comment.