[examples] Update C++ examples to use CommandPtr (#5988)

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
ncorrea210
2023-12-04 00:39:29 -05:00
committed by GitHub
parent 9bc5fcf886
commit d32c10487c
26 changed files with 139 additions and 111 deletions

View File

@@ -4,6 +4,8 @@
#pragma once
#include <optional>
#include <frc/TimedRobot.h>
#include <frc2/command/Command.h>
@@ -24,7 +26,7 @@ class Robot : public frc::TimedRobot {
private:
// Have it null by default so that if testing teleop it
// doesn't have undefined behavior and potentially crash.
frc2::Command* m_autonomousCommand = nullptr;
std::optional<frc2::CommandPtr> m_autonomousCommand;
RobotContainer m_container;
};