From 17cae787e7100b4e85dd54e70982d990c141b75c Mon Sep 17 00:00:00 2001 From: Eric <2983879+bathtubed@users.noreply.github.com> Date: Sat, 3 May 2025 23:44:55 -0400 Subject: [PATCH] [commands] Mark CommandPtr class as [[nodiscard]] (#7803) This has the same effect but makes it so any user code returning CommandPtr can't discard a returned command. Signed-off-by: Eric Ward --- .../native/include/frc2/command/Command.h | 20 --------------- .../native/include/frc2/command/CommandPtr.h | 25 +++---------------- .../native/include/frc2/command/Commands.h | 25 ------------------- .../native/include/frc2/command/Subsystem.h | 6 ----- .../cpp/frc2/command/CommandPtrTest.cpp | 3 ++- .../include/subsystems/DriveSubsystem.h | 2 -- .../include/subsystems/Drive.h | 3 --- .../include/subsystems/Intake.h | 2 -- .../include/subsystems/Pneumatics.h | 1 - .../include/subsystems/Shooter.h | 1 - .../include/subsystems/Storage.h | 1 - 11 files changed, 5 insertions(+), 84 deletions(-) diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h index 4dea3eb1a5..79b6d75968 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h @@ -192,7 +192,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param duration the timeout duration * @return the command with the timeout added */ - [[nodiscard]] CommandPtr WithTimeout(units::second_t duration) &&; /** @@ -203,7 +202,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param condition the interrupt condition * @return the command with the interrupt condition added */ - [[nodiscard]] CommandPtr Until(std::function condition) &&; /** @@ -214,7 +212,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param condition the run condition * @return the command with the run condition added */ - [[nodiscard]] CommandPtr OnlyWhile(std::function condition) &&; /** @@ -224,7 +221,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param requirements the required subsystems * @return the decorated command */ - [[nodiscard]] CommandPtr BeforeStarting(std::function toRun, Requirements requirements = {}) &&; @@ -235,7 +231,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param before the command to run before this one * @return the decorated command */ - [[nodiscard]] CommandPtr BeforeStarting(CommandPtr&& before) &&; /** @@ -245,7 +240,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param requirements the required subsystems * @return the decorated command */ - [[nodiscard]] CommandPtr AndThen(std::function toRun, Requirements requirements = {}) &&; @@ -257,7 +251,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param next the commands to run next * @return the decorated command */ - [[nodiscard]] CommandPtr AndThen(CommandPtr&& next) &&; /** @@ -266,7 +259,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * * @return the decorated command */ - [[nodiscard]] CommandPtr Repeatedly() &&; /** @@ -282,7 +274,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @return the decorated command * @see ProxyCommand */ - [[nodiscard]] CommandPtr AsProxy() &&; /** @@ -294,7 +285,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param condition the condition that will prevent the command from running * @return the decorated command */ - [[nodiscard]] CommandPtr Unless(std::function condition) &&; /** @@ -306,7 +296,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param condition the condition that will allow the command to run * @return the decorated command */ - [[nodiscard]] CommandPtr OnlyIf(std::function condition) &&; /** @@ -330,7 +319,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @return the decorated command * @see WithDeadline */ - [[nodiscard]] CommandPtr DeadlineFor(CommandPtr&& parallel) &&; /** @@ -341,7 +329,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param parallel the commands to run in parallel * @return the decorated command */ - [[nodiscard]] CommandPtr AlongWith(CommandPtr&& parallel) &&; /** @@ -352,7 +339,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param parallel the commands to run in parallel * @return the decorated command */ - [[nodiscard]] CommandPtr RaceWith(CommandPtr&& parallel) &&; /** @@ -361,7 +347,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param doesRunWhenDisabled true to run when disabled. * @return the decorated command */ - [[nodiscard]] CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&; /** @@ -370,7 +355,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param interruptBehavior the desired interrupt behavior * @return the decorated command */ - [[nodiscard]] CommandPtr WithInterruptBehavior( Command::InterruptionBehavior interruptBehavior) &&; @@ -382,7 +366,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * command was interrupted. * @return the decorated command */ - [[nodiscard]] CommandPtr FinallyDo(std::function end) &&; /** @@ -394,7 +377,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * interrupted. * @return the decorated command */ - [[nodiscard]] CommandPtr FinallyDo(std::function end) &&; /** @@ -404,7 +386,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param handler a lambda to run when the command is interrupted * @return the decorated command */ - [[nodiscard]] CommandPtr HandleInterrupt(std::function handler) &&; /** @@ -413,7 +394,6 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { * @param name name * @return the decorated Command */ - [[nodiscard]] CommandPtr WithName(std::string_view name) &&; /** diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h index 81a255a9a7..fdd53c6425 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h @@ -25,7 +25,8 @@ namespace frc2 { * std::unique_ptr, use CommandPtr::Unwrap to convert. * CommandPtr::UnwrapVector does the same for vectors. */ -class CommandPtr final { +class [[nodiscard]] +CommandPtr final { public: explicit CommandPtr(std::unique_ptr&& command); @@ -46,7 +47,6 @@ class CommandPtr final { * * @return the decorated command */ - [[nodiscard]] CommandPtr Repeatedly() &&; /** @@ -60,7 +60,6 @@ class CommandPtr final { * @return the decorated command * @see ProxyCommand */ - [[nodiscard]] CommandPtr AsProxy() &&; /** @@ -69,7 +68,6 @@ class CommandPtr final { * @param doesRunWhenDisabled true to run when disabled * @return the decorated command */ - [[nodiscard]] CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&; /** @@ -78,7 +76,6 @@ class CommandPtr final { * @param interruptBehavior the desired interrupt behavior * @return the decorated command */ - [[nodiscard]] CommandPtr WithInterruptBehavior( Command::InterruptionBehavior interruptBehavior) &&; @@ -89,7 +86,6 @@ class CommandPtr final { * @param requirements the required subsystems * @return the decorated command */ - [[nodiscard]] CommandPtr AndThen(std::function toRun, Requirements requirements = {}) &&; @@ -101,7 +97,6 @@ class CommandPtr final { * @param next the commands to run next * @return the decorated command */ - [[nodiscard]] CommandPtr AndThen(CommandPtr&& next) &&; /** @@ -111,7 +106,6 @@ class CommandPtr final { * @param requirements the required subsystems * @return the decorated command */ - [[nodiscard]] CommandPtr BeforeStarting(std::function toRun, Requirements requirements = {}) &&; @@ -122,7 +116,6 @@ class CommandPtr final { * @param before the command to run before this one * @return the decorated command */ - [[nodiscard]] CommandPtr BeforeStarting(CommandPtr&& before) &&; /** @@ -133,7 +126,6 @@ class CommandPtr final { * @param duration the timeout duration * @return the command with the timeout added */ - [[nodiscard]] CommandPtr WithTimeout(units::second_t duration) &&; /** @@ -144,7 +136,6 @@ class CommandPtr final { * @param condition the interrupt condition * @return the command with the interrupt condition added */ - [[nodiscard]] CommandPtr Until(std::function condition) &&; /** @@ -155,7 +146,6 @@ class CommandPtr final { * @param condition the run condition * @return the command with the run condition added */ - [[nodiscard]] CommandPtr OnlyWhile(std::function condition) &&; /** @@ -167,7 +157,6 @@ class CommandPtr final { * @param condition the condition that will prevent the command from running * @return the decorated command */ - [[nodiscard]] CommandPtr Unless(std::function condition) &&; /** @@ -179,7 +168,6 @@ class CommandPtr final { * @param condition the condition that will allow the command to run * @return the decorated command */ - [[nodiscard]] CommandPtr OnlyIf(std::function condition) &&; /** @@ -201,7 +189,7 @@ class CommandPtr final { * @param parallel the commands to run in parallel * @return the decorated command */ - [[nodiscard]] [[deprecated("Replace with DeadlineFor")]] + [[deprecated("Replace with DeadlineFor")]] CommandPtr DeadlineWith(CommandPtr&& parallel) &&; /** @@ -214,7 +202,6 @@ class CommandPtr final { * will be interupted when the deadline command ends * @return the decorated command */ - [[nodiscard]] CommandPtr DeadlineFor(CommandPtr&& parallel) &&; /** * Decorates this command with a set of commands to run parallel to it, ending @@ -224,7 +211,6 @@ class CommandPtr final { * @param parallel the commands to run in parallel * @return the decorated command */ - [[nodiscard]] CommandPtr AlongWith(CommandPtr&& parallel) &&; /** @@ -235,7 +221,6 @@ class CommandPtr final { * @param parallel the commands to run in parallel * @return the decorated command */ - [[nodiscard]] CommandPtr RaceWith(CommandPtr&& parallel) &&; /** @@ -246,7 +231,6 @@ class CommandPtr final { * command was interrupted * @return the decorated command */ - [[nodiscard]] CommandPtr FinallyDo(std::function end) &&; /** @@ -258,7 +242,6 @@ class CommandPtr final { * interrupted. * @return the decorated command */ - [[nodiscard]] CommandPtr FinallyDo(std::function end) &&; /** @@ -268,7 +251,6 @@ class CommandPtr final { * @param handler a lambda to run when the command is interrupted * @return the decorated command */ - [[nodiscard]] CommandPtr HandleInterrupt(std::function handler) &&; /** @@ -278,7 +260,6 @@ class CommandPtr final { * @param name name * @return the decorated Command */ - [[nodiscard]] CommandPtr WithName(std::string_view name) &&; /** diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Commands.h b/wpilibNewCommands/src/main/native/include/frc2/command/Commands.h index b0dcda022f..9907a247fc 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Commands.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Commands.h @@ -29,7 +29,6 @@ namespace cmd { /** * Constructs a command that does nothing, finishing immediately. */ -[[nodiscard]] CommandPtr None(); /** @@ -38,7 +37,6 @@ CommandPtr None(); * @param requirements Subsystems to require * @return the command */ -[[nodiscard]] CommandPtr Idle(Requirements requirements = {}); // Action Commands @@ -49,7 +47,6 @@ CommandPtr Idle(Requirements requirements = {}); * @param action the action to run * @param requirements subsystems the action requires */ -[[nodiscard]] CommandPtr RunOnce(std::function action, Requirements requirements = {}); @@ -59,7 +56,6 @@ CommandPtr RunOnce(std::function action, * @param action the action to run * @param requirements subsystems the action requires */ -[[nodiscard]] CommandPtr Run(std::function action, Requirements requirements = {}); /** @@ -70,7 +66,6 @@ CommandPtr Run(std::function action, Requirements requirements = {}); * @param end the action to run on interrupt * @param requirements subsystems the action requires */ -[[nodiscard]] CommandPtr StartEnd(std::function start, std::function end, Requirements requirements = {}); @@ -82,7 +77,6 @@ CommandPtr StartEnd(std::function start, std::function end, * @param end the action to run on interrupt * @param requirements subsystems the action requires */ -[[nodiscard]] CommandPtr RunEnd(std::function run, std::function end, Requirements requirements = {}); @@ -94,7 +88,6 @@ CommandPtr RunEnd(std::function run, std::function end, * @param run the action to run every iteration * @param requirements subsystems the action requires */ -[[nodiscard]] CommandPtr StartRun(std::function start, std::function run, Requirements requirements = {}); @@ -103,7 +96,6 @@ CommandPtr StartRun(std::function start, std::function run, * * @param msg the message to print */ -[[nodiscard]] CommandPtr Print(std::string_view msg); // Idling Commands @@ -113,7 +105,6 @@ CommandPtr Print(std::string_view msg); * * @param duration after how long the command finishes */ -[[nodiscard]] CommandPtr Wait(units::second_t duration); /** @@ -122,7 +113,6 @@ CommandPtr Wait(units::second_t duration); * * @param condition the condition */ -[[nodiscard]] CommandPtr WaitUntil(std::function condition); // Selector Commands @@ -134,7 +124,6 @@ CommandPtr WaitUntil(std::function condition); * @param onFalse the command to run if the selector function returns false * @param selector the selector function */ -[[nodiscard]] CommandPtr Either(CommandPtr&& onTrue, CommandPtr&& onFalse, std::function selector); @@ -145,7 +134,6 @@ CommandPtr Either(CommandPtr&& onTrue, CommandPtr&& onFalse, * @param commands map of commands to select from */ template ... CommandPtrs> -[[nodiscard]] CommandPtr Select(std::function selector, std::pair&&... commands) { std::vector>> vec; @@ -162,7 +150,6 @@ CommandPtr Select(std::function selector, * @param supplier the command supplier * @param requirements the set of requirements for this command */ -[[nodiscard]] CommandPtr Defer(wpi::unique_function supplier, Requirements requirements); @@ -173,7 +160,6 @@ CommandPtr Defer(wpi::unique_function supplier, * * @param supplier the command supplier */ -[[nodiscard]] CommandPtr DeferredProxy(wpi::unique_function supplier); /** @@ -183,7 +169,6 @@ CommandPtr DeferredProxy(wpi::unique_function supplier); * * @param supplier the command supplier */ -[[nodiscard]] CommandPtr DeferredProxy(wpi::unique_function supplier); // Command Groups @@ -205,14 +190,12 @@ std::vector MakeVector(Args&&... args) { /** * Runs a group of commands in series, one after the other. */ -[[nodiscard]] CommandPtr Sequence(std::vector&& commands); /** * Runs a group of commands in series, one after the other. */ template ... CommandPtrs> -[[nodiscard]] CommandPtr Sequence(CommandPtrs&&... commands) { return Sequence(impl::MakeVector(std::forward(commands)...)); } @@ -221,7 +204,6 @@ CommandPtr Sequence(CommandPtrs&&... commands) { * Runs a group of commands in series, one after the other. Once the last * command ends, the group is restarted. */ -[[nodiscard]] CommandPtr RepeatingSequence(std::vector&& commands); /** @@ -229,7 +211,6 @@ CommandPtr RepeatingSequence(std::vector&& commands); * command ends, the group is restarted. */ template ... CommandPtrs> -[[nodiscard]] CommandPtr RepeatingSequence(CommandPtrs&&... commands) { return RepeatingSequence( impl::MakeVector(std::forward(commands)...)); @@ -239,7 +220,6 @@ CommandPtr RepeatingSequence(CommandPtrs&&... commands) { * Runs a group of commands at the same time. Ends once all commands in the * group finish. */ -[[nodiscard]] CommandPtr Parallel(std::vector&& commands); /** @@ -247,7 +227,6 @@ CommandPtr Parallel(std::vector&& commands); * group finish. */ template ... CommandPtrs> -[[nodiscard]] CommandPtr Parallel(CommandPtrs&&... commands) { return Parallel(impl::MakeVector(std::forward(commands)...)); } @@ -256,7 +235,6 @@ CommandPtr Parallel(CommandPtrs&&... commands) { * Runs a group of commands at the same time. Ends once any command in the group * finishes, and cancels the others. */ -[[nodiscard]] CommandPtr Race(std::vector&& commands); /** @@ -264,7 +242,6 @@ CommandPtr Race(std::vector&& commands); * finishes, and cancels the others. */ template ... CommandPtrs> -[[nodiscard]] CommandPtr Race(CommandPtrs&&... commands) { return Race(impl::MakeVector(std::forward(commands)...)); } @@ -273,7 +250,6 @@ CommandPtr Race(CommandPtrs&&... commands) { * Runs a group of commands at the same time. Ends once a specific command * finishes, and cancels the others. */ -[[nodiscard]] CommandPtr Deadline(CommandPtr&& deadline, std::vector&& others); /** @@ -281,7 +257,6 @@ CommandPtr Deadline(CommandPtr&& deadline, std::vector&& others); * finishes, and cancels the others. */ template ... CommandPtrs> -[[nodiscard]] CommandPtr Deadline(CommandPtr&& deadline, CommandPtrs&&... commands) { return Deadline(std::move(deadline), impl::MakeVector(std::forward(commands)...)); diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Subsystem.h b/wpilibNewCommands/src/main/native/include/frc2/command/Subsystem.h index d62f69ca35..ea7fbb7591 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Subsystem.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Subsystem.h @@ -127,7 +127,6 @@ class Subsystem { * * @param action the action to run */ - [[nodiscard]] CommandPtr RunOnce(std::function action); /** @@ -136,7 +135,6 @@ class Subsystem { * * @param action the action to run */ - [[nodiscard]] CommandPtr Run(std::function action); /** @@ -146,7 +144,6 @@ class Subsystem { * @param start the action to run on start * @param end the action to run on interrupt */ - [[nodiscard]] CommandPtr StartEnd(std::function start, std::function end); /** @@ -156,7 +153,6 @@ class Subsystem { * @param run the action to run every iteration * @param end the action to run on interrupt */ - [[nodiscard]] CommandPtr RunEnd(std::function run, std::function end); /** @@ -166,7 +162,6 @@ class Subsystem { * @param start the action to run on start * @param run the action to run every iteration */ - [[nodiscard]] CommandPtr StartRun(std::function start, std::function run); /** @@ -176,7 +171,6 @@ class Subsystem { * @param supplier the command supplier. * @return the command. */ - [[nodiscard]] CommandPtr Defer(wpi::unique_function supplier); }; } // namespace frc2 diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp index 1dae951bea..85853d24ed 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp @@ -38,5 +38,6 @@ TEST_F(CommandPtrTest, MovedFrom) { } TEST_F(CommandPtrTest, NullInitialization) { - EXPECT_THROW(CommandPtr{std::unique_ptr{}}, frc::RuntimeError); + EXPECT_THROW(auto cmd = CommandPtr{std::unique_ptr{}}, + frc::RuntimeError); } diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.h b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.h index 09e59dd83b..162a2abe4c 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.h +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.h @@ -82,7 +82,6 @@ class DriveSubsystem : public frc2::SubsystemBase { * @param distance The distance to drive forward. * @return A command. */ - [[nodiscard]] frc2::CommandPtr ProfiledDriveDistance(units::meter_t distance); /** @@ -92,7 +91,6 @@ class DriveSubsystem : public frc2::SubsystemBase { * @param distance The distance to drive forward. * @return A command. */ - [[nodiscard]] frc2::CommandPtr DynamicProfiledDriveDistance(units::meter_t distance); private: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.h b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.h index 6a9c32b978..ca308ccf47 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.h +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.h @@ -28,7 +28,6 @@ class Drive : public frc2::SubsystemBase { * @param fwd the commanded forward movement * @param rot the commanded rotation */ - [[nodiscard]] frc2::CommandPtr ArcadeDriveCommand(std::function fwd, std::function rot); @@ -39,7 +38,6 @@ class Drive : public frc2::SubsystemBase { * @param distance The distance to drive forward in meters * @param speed The fraction of max speed at which to drive */ - [[nodiscard]] frc2::CommandPtr DriveDistanceCommand(units::meter_t distance, double speed); /** @@ -48,7 +46,6 @@ class Drive : public frc2::SubsystemBase { * * @param angle The angle to turn to */ - [[nodiscard]] frc2::CommandPtr TurnToAngleCommand(units::degree_t angle); private: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.h b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.h index 111353a0f5..bcd94f9bba 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.h +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.h @@ -19,11 +19,9 @@ class Intake : public frc2::SubsystemBase { /** Returns a command that deploys the intake, and then runs the intake motor * indefinitely. */ - [[nodiscard]] frc2::CommandPtr IntakeCommand(); /** Returns a command that turns off and retracts the intake. */ - [[nodiscard]] frc2::CommandPtr RetractCommand(); private: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.h b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.h index 0c1fee92a9..9ef1e9fea2 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.h +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.h @@ -17,7 +17,6 @@ class Pneumatics : frc2::SubsystemBase { public: Pneumatics(); /** Returns a command that disables the compressor indefinitely. */ - [[nodiscard]] frc2::CommandPtr DisableCompressorCommand(); /** diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.h b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.h index 2e9b580bb2..14fdc73612 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.h +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.h @@ -28,7 +28,6 @@ class Shooter : public frc2::SubsystemBase { * * @param setpointRotationsPerSecond The desired shooter velocity */ - [[nodiscard]] frc2::CommandPtr ShootCommand(units::turns_per_second_t setpoint); private: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.h b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.h index ec99118d60..5ea8ac7779 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.h +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.h @@ -16,7 +16,6 @@ class Storage : frc2::SubsystemBase { public: Storage(); /** Returns a command that runs the storage motor indefinitely. */ - [[nodiscard]] frc2::CommandPtr RunCommand(); /** Whether the ball storage is full. */