[commands] Update Command documentation (NFC) (#3881)

Add reference to which VendorDep the class is included in.
Add missing OldCommands C++ Documentation (copied from Java).
This commit is contained in:
sciencewhiz
2022-01-08 11:11:34 -08:00
committed by GitHub
parent b3707cca0b
commit 8ac45f20bb
146 changed files with 413 additions and 25 deletions

View File

@@ -42,6 +42,8 @@ class ProxyScheduleCommand;
* <p>Note: ALWAYS create a subclass by extending CommandHelper<Base, Subclass>,
* or decorators will not function!
*
* This class is provided by the NewCommands VendorDep
*
* @see CommandScheduler
* @see CommandHelper
*/

View File

@@ -18,6 +18,8 @@
namespace frc2 {
/**
* A Sendable base class for Commands.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandBase : public Command,
public wpi::Sendable,

View File

@@ -18,6 +18,8 @@ namespace frc2 {
* A base for CommandGroups. Statically tracks commands that have been
* allocated to groups to ensure those commands are not also used independently,
* which can result in inconsistent command state and unpredictable execution.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandGroupBase : public CommandBase {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
*
* <p>Note: ALWAYS create a subclass by extending CommandHelper<Base, Subclass>,
* or decorators will not function!
*
* This class is provided by the NewCommands VendorDep
*/
template <typename Base, typename CRTP,
typename = std::enable_if_t<std::is_base_of_v<Command, Base>>>

View File

@@ -26,6 +26,8 @@ class Subsystem;
* commands synchronously from the main loop. Subsystems should be registered
* with the scheduler using RegisterSubsystem() in order for their Periodic()
* methods to be called and for their default commands to be scheduled.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandScheduler final : public nt::NTSendable,
public wpi::SendableHelper<CommandScheduler> {

View File

@@ -10,6 +10,8 @@ namespace frc2 {
/**
* Class that holds scheduling state for a command. Used internally by the
* CommandScheduler
*
* This class is provided by the NewCommands VendorDep
*/
class CommandState final {
public:

View File

@@ -29,6 +29,8 @@ namespace frc2 {
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*
* @see ScheduleCommand
*/
class ConditionalCommand

View File

@@ -19,6 +19,8 @@ namespace frc2 {
* complex commands - note, however, that if a command is beyond a certain
* complexity it is usually better practice to write a proper class for it than
* to inline it.
*
* This class is provided by the NewCommands VendorDep
*/
class FunctionalCommand : public CommandHelper<CommandBase, FunctionalCommand> {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* A Command that runs instantly; it will initialize, execute once, and end on
* the same iteration of the scheduler. Users can either pass in a Runnable and
* a set of requirements, or else subclass this command if desired.
*
* This class is provided by the NewCommands VendorDep
*/
class InstantCommand : public CommandHelper<CommandBase, InstantCommand> {
public:

View File

@@ -47,6 +47,8 @@ namespace frc2 {
* <p>The robot angle controller does not follow the angle given by
* the trajectory but rather goes to the angle given in the final state of the
* trajectory.
*
* This class is provided by the NewCommands VendorDep
*/
class MecanumControllerCommand
: public CommandHelper<CommandBase, MecanumControllerCommand> {

View File

@@ -24,6 +24,8 @@ namespace frc2 {
* <p>WARNING: Do not use this class unless you are confident in your ability to
* make the executed code thread-safe. If you do not know what "thread-safe"
* means, that is a good sign that you should not use this class.
*
* This class is provided by the NewCommands VendorDep
*/
class NotifierCommand : public CommandHelper<CommandBase, NotifierCommand> {
public:

View File

@@ -20,6 +20,8 @@ namespace frc2 {
* The controller calculation and output are performed synchronously in the
* command's execute() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see PIDController
*/
class PIDCommand : public CommandHelper<CommandBase, PIDCommand> {

View File

@@ -13,6 +13,8 @@ namespace frc2 {
* A subsystem that uses a PIDController to control an output. The controller
* is run synchronously from the subsystem's periodic() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see PIDController
*/
class PIDSubsystem : public SubsystemBase {

View File

@@ -23,6 +23,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelCommandGroup
: public CommandHelper<CommandGroupBase, ParallelCommandGroup> {

View File

@@ -24,6 +24,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelDeadlineGroup
: public CommandHelper<CommandGroupBase, ParallelDeadlineGroup> {

View File

@@ -23,6 +23,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelRaceGroup
: public CommandHelper<CommandGroupBase, ParallelRaceGroup> {

View File

@@ -26,6 +26,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class PerpetualCommand : public CommandHelper<CommandBase, PerpetualCommand> {
public:

View File

@@ -12,6 +12,8 @@
namespace frc2 {
/**
* A command that prints a string when initialized.
*
* This class is provided by the NewCommands VendorDep
*/
class PrintCommand : public CommandHelper<InstantCommand, PrintCommand> {
public:

View File

@@ -22,6 +22,8 @@ namespace frc2 {
* class. The controller calculation and output are performed synchronously in
* the command's execute() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see ProfiledPIDController<Distance>
*/
template <class Distance>

View File

@@ -14,6 +14,8 @@ namespace frc2 {
* A subsystem that uses a ProfiledPIDController to control an output. The
* controller is run synchronously from the subsystem's periodic() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see ProfiledPIDController
*/
template <class Distance>

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* all the commands are no longer scheduled. Useful for forking off from
* CommandGroups. If this command is interrupted, it will cancel all of the
* commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ProxyScheduleCommand
: public CommandHelper<CommandBase, ProxyScheduleCommand> {

View File

@@ -37,6 +37,8 @@ namespace frc2 {
* secondary constructor that omits the PID and feedforward functionality,
* returning only the raw wheel speeds from the RAMSETE controller.
*
* This class is provided by the NewCommands VendorDep
*
* @see RamseteController
* @see Trajectory
*/

View File

@@ -18,6 +18,8 @@ namespace frc2 {
* either subclass it or use Command.WithTimeout() or
* Command.WithInterrupt() to give it one. If you only wish
* to execute a Runnable once, use InstantCommand.
*
* This class is provided by the NewCommands VendorDep
*/
class RunCommand : public CommandHelper<CommandBase, RunCommand> {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* forking off from CommandGroups. Note that if run from a CommandGroup, the
* group will not know about the status of the scheduled commands, and will
* treat this command as finishing instantly.
*
* This class is provided by the NewCommands VendorDep
*/
class ScheduleCommand : public CommandHelper<CommandBase, ScheduleCommand> {
public:

View File

@@ -35,6 +35,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
template <typename Key>
class SelectCommand : public CommandHelper<CommandBase, SelectCommand<Key>> {

View File

@@ -29,6 +29,8 @@ const size_t invalid_index = std::numeric_limits<size_t>::max();
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class SequentialCommandGroup
: public CommandHelper<CommandGroupBase, SequentialCommandGroup> {

View File

@@ -19,6 +19,8 @@ namespace frc2 {
* extending and then retracting a solenoid. Has no end condition as-is; either
* subclass it or use Command.WithTimeout() or Command.WithInterrupt() to give
* it one.
*
* This class is provided by the NewCommands VendorDep
*/
class StartEndCommand : public CommandHelper<CommandBase, StartEndCommand> {
public:

View File

@@ -29,6 +29,8 @@ class Command;
* SubsystemBase class offers a simple base for user implementations
* that handles this.
*
* This class is provided by the NewCommands VendorDep
*
* @see Command
* @see CommandScheduler
* @see SubsystemBase

View File

@@ -16,6 +16,8 @@ namespace frc2 {
/**
* A base for subsystems that handles registration in the constructor, and
* provides a more intuitive method for setting the default command.
*
* This class is provided by the NewCommands VendorDep
*/
class SubsystemBase : public Subsystem,
public wpi::Sendable,

View File

@@ -46,6 +46,8 @@ namespace frc2 {
* <p>The robot angle controller does not follow the angle given by
* the trajectory but rather goes to the angle given in the final state of the
* trajectory.
*
* This class is provided by the NewCommands VendorDep
*/
template <size_t NumModules>
class SwerveControllerCommand

View File

@@ -19,6 +19,8 @@ namespace frc2 {
* A command that runs a TrapezoidProfile. Useful for smoothly controlling
* mechanism motion.
*
* This class is provided by the NewCommands VendorDep
*
* @see TrapezoidProfile
*/
template <class Distance>

View File

@@ -14,6 +14,8 @@ namespace frc2 {
* A subsystem that generates and runs trapezoidal motion profiles
* automatically. The user specifies how to use the current state of the motion
* profile by overriding the `UseState` method.
*
* This class is provided by the NewCommands VendorDep
*/
template <class Distance>
class TrapezoidProfileSubsystem : public SubsystemBase {

View File

@@ -15,6 +15,8 @@ namespace frc2 {
* A command that does nothing but takes a specified amount of time to finish.
* Useful for CommandGroups. Can also be subclassed to make a command with an
* internal timer.
*
* This class is provided by the NewCommands VendorDep
*/
class WaitCommand : public CommandHelper<CommandBase, WaitCommand> {
public:

View File

@@ -15,6 +15,8 @@ namespace frc2 {
/**
* A command that does nothing but ends after a specified match time or
* condition. Useful for CommandGroups.
*
* This class is provided by the NewCommands VendorDep
*/
class WaitUntilCommand : public CommandHelper<CommandBase, WaitUntilCommand> {
public:

View File

@@ -18,6 +18,8 @@ class Command;
* A class used to bind command scheduling to button presses. Can be composed
* with other buttons with the operators in Trigger.
*
* This class is provided by the NewCommands VendorDep
*
* @see Trigger
*/
class Button : public Trigger {

View File

@@ -12,6 +12,8 @@ namespace frc2 {
* A class used to bind command scheduling to joystick button presses. Can be
* composed with other buttons with the operators in Trigger.
*
* This class is provided by the NewCommands VendorDep
*
* @see Trigger
*/
class JoystickButton : public Button {

View File

@@ -15,6 +15,8 @@
namespace frc2 {
/**
* A Button that uses a NetworkTable boolean field.
*
* This class is provided by the NewCommands VendorDep
*/
class NetworkButton : public Button {
public:

View File

@@ -12,6 +12,8 @@ namespace frc2 {
* A class used to bind command scheduling to joystick POV presses. Can be
* composed with other buttons with the operators in Trigger.
*
* This class is provided by the NewCommands VendorDep
*
* @see Trigger
*/
class POVButton : public Button {

View File

@@ -24,6 +24,8 @@ class Command;
* methods are named fairly abstractly; for purpose-specific wrappers, see
* Button.
*
* This class is provided by the NewCommands VendorDep
*
* @see Button
*/
class Trigger {