mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[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:
@@ -14,6 +14,8 @@ import java.util.function.BooleanSupplier;
|
||||
*
|
||||
* <p>Commands are run synchronously from the main robot loop; no multithreading is used, unless
|
||||
* specified explicitly from the command implementation.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public interface Command {
|
||||
/** The initial subroutine of a command. Called once when the command is initially scheduled. */
|
||||
|
||||
@@ -10,7 +10,11 @@ import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/** A {@link Sendable} base class for {@link Command}s. */
|
||||
/**
|
||||
* A {@link Sendable} base class for {@link Command}s.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class CommandBase implements Sendable, Command {
|
||||
protected Set<Subsystem> m_requirements = new HashSet<>();
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.util.WeakHashMap;
|
||||
* 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class CommandGroupBase extends CommandBase {
|
||||
private static final Set<Command> m_groupedCommands =
|
||||
|
||||
@@ -33,6 +33,8 @@ import java.util.function.Consumer;
|
||||
* synchronously from the main loop. Subsystems should be registered with the scheduler using {@link
|
||||
* CommandScheduler#registerSubsystem(Subsystem...)} in order for their {@link Subsystem#periodic()}
|
||||
* methods to be called and for their default commands to be scheduled.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public final class CommandScheduler implements NTSendable, AutoCloseable {
|
||||
/** The Singleton Instance. */
|
||||
|
||||
@@ -8,6 +8,8 @@ import edu.wpi.first.wpilibj.Timer;
|
||||
|
||||
/**
|
||||
* Class that holds scheduling state for a command. Used internally by the {@link CommandScheduler}.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
class CommandState {
|
||||
// The time since this command was initialized.
|
||||
|
||||
@@ -21,6 +21,8 @@ import java.util.function.BooleanSupplier;
|
||||
* scheduled individually.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ConditionalCommand extends CommandBase {
|
||||
private final Command m_onTrue;
|
||||
|
||||
@@ -14,6 +14,8 @@ import java.util.function.Consumer;
|
||||
* the constructor. Useful for inline definitions of 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class FunctionalCommand extends CommandBase {
|
||||
protected final Runnable m_onInit;
|
||||
|
||||
@@ -10,6 +10,8 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
|
||||
* 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class InstantCommand extends CommandBase {
|
||||
private final Runnable m_toRun;
|
||||
|
||||
@@ -35,6 +35,8 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* <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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public class MecanumControllerCommand extends CommandBase {
|
||||
|
||||
@@ -14,6 +14,8 @@ import edu.wpi.first.wpilibj.Notifier;
|
||||
* <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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class NotifierCommand extends CommandBase {
|
||||
protected final Notifier m_notifier;
|
||||
|
||||
@@ -15,6 +15,8 @@ import java.util.function.DoubleSupplier;
|
||||
* A command that controls an output with a {@link PIDController}. Runs forever by default - to add
|
||||
* exit conditions and/or other behavior, subclass this class. The controller calculation and output
|
||||
* are performed synchronously in the command's execute() method.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class PIDCommand extends CommandBase {
|
||||
protected final PIDController m_controller;
|
||||
|
||||
@@ -11,6 +11,8 @@ import edu.wpi.first.math.controller.PIDController;
|
||||
/**
|
||||
* A subsystem that uses a {@link PIDController} to control an output. The controller is run
|
||||
* synchronously from the subsystem's periodic() method.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class PIDSubsystem extends SubsystemBase {
|
||||
protected final PIDController m_controller;
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.Map;
|
||||
* A CommandGroup that runs a set of commands in parallel, ending when the last command ends.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ParallelCommandGroup extends CommandGroupBase {
|
||||
// maps commands in this group to whether they are still running
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.util.Map;
|
||||
* "deadline") ends, interrupting all other commands that are still running at that point.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ParallelDeadlineGroup extends CommandGroupBase {
|
||||
// maps commands in this group to whether they are still running
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.util.Set;
|
||||
* and interrupting all the others.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ParallelRaceGroup extends CommandGroupBase {
|
||||
private final Set<Command> m_commands = new HashSet<>();
|
||||
|
||||
@@ -14,6 +14,8 @@ import static edu.wpi.first.wpilibj2.command.CommandGroupBase.requireUngrouped;
|
||||
* cannot be added to any other groups, or scheduled individually.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class PerpetualCommand extends CommandBase {
|
||||
protected final Command m_command;
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
package edu.wpi.first.wpilibj2.command;
|
||||
|
||||
/** A command that prints a string when initialized. */
|
||||
/**
|
||||
* A command that prints a string when initialized.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class PrintCommand extends InstantCommand {
|
||||
/**
|
||||
* Creates a new a PrintCommand.
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.util.function.Supplier;
|
||||
* A command that controls an output with a {@link ProfiledPIDController}. Runs forever by default -
|
||||
* to add exit conditions and/or other behavior, subclass this class. The controller calculation and
|
||||
* output are performed synchronously in the command's execute() method.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ProfiledPIDCommand extends CommandBase {
|
||||
protected final ProfiledPIDController m_controller;
|
||||
|
||||
@@ -13,6 +13,8 @@ import edu.wpi.first.math.trajectory.TrapezoidProfile;
|
||||
/**
|
||||
* A subsystem that uses a {@link ProfiledPIDController} to control an output. The controller is run
|
||||
* synchronously from the subsystem's periodic() method.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class ProfiledPIDSubsystem extends SubsystemBase {
|
||||
protected final ProfiledPIDController m_controller;
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.Set;
|
||||
* Schedules the given commands when this command is initialized, and ends when 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ProxyScheduleCommand extends CommandBase {
|
||||
private final Set<Command> m_toSchedule;
|
||||
|
||||
@@ -29,6 +29,8 @@ import java.util.function.Supplier;
|
||||
* <p>Advanced teams seeking more flexibility (for example, those who wish to use the onboard PID
|
||||
* functionality of a "smart" motor controller) may use the secondary constructor that omits the PID
|
||||
* and feedforward functionality, returning only the raw wheel speeds from the RAMSETE controller.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class RamseteCommand extends CommandBase {
|
||||
private final Timer m_timer = new Timer();
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.function.BooleanSupplier;
|
||||
* A command that runs a Runnable continuously. Has no end condition as-is; either subclass it or
|
||||
* use {@link Command#withTimeout(double)} or {@link Command#withInterrupt(BooleanSupplier)} to give
|
||||
* it one. If you only wish to execute a Runnable once, use {@link InstantCommand}.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class RunCommand extends CommandBase {
|
||||
protected final Runnable m_toRun;
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.Set;
|
||||
* Schedules the given commands when this command is initialized. Useful for 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class ScheduleCommand extends CommandBase {
|
||||
private final Set<Command> m_toSchedule;
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.function.Supplier;
|
||||
* scheduled individually.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class SelectCommand extends CommandBase {
|
||||
private final Map<Object, Command> m_commands;
|
||||
|
||||
@@ -11,6 +11,8 @@ import java.util.List;
|
||||
* A CommandGroups that runs a list of commands in sequence.
|
||||
*
|
||||
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class SequentialCommandGroup extends CommandGroupBase {
|
||||
private final List<Command> m_commands = new ArrayList<>();
|
||||
|
||||
@@ -11,6 +11,8 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
|
||||
* Useful for running and then stopping a motor, or extending and then retracting a solenoid. Has no
|
||||
* end condition as-is; either subclass it or use {@link Command#withTimeout(double)} or {@link
|
||||
* Command#withInterrupt(java.util.function.BooleanSupplier)} to give it one.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class StartEndCommand extends CommandBase {
|
||||
protected final Runnable m_onInit;
|
||||
|
||||
@@ -18,6 +18,8 @@ package edu.wpi.first.wpilibj2.command;
|
||||
* Subsystem#periodic()} method to be called. It is recommended that this method be called from the
|
||||
* constructor of users' Subsystem implementations. The {@link SubsystemBase} class offers a simple
|
||||
* base for user implementations that handles this.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public interface Subsystem {
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,8 @@ import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
/**
|
||||
* A base for subsystems that handles registration in the constructor, and provides a more intuitive
|
||||
* method for setting the default command.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class SubsystemBase implements Subsystem, Sendable {
|
||||
/** Constructor. */
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* <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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public class SwerveControllerCommand extends CommandBase {
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* A command that runs a {@link TrapezoidProfile}. Useful for smoothly controlling mechanism motion.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class TrapezoidProfileCommand extends CommandBase {
|
||||
private final TrapezoidProfile m_profile;
|
||||
|
||||
@@ -11,6 +11,8 @@ import edu.wpi.first.math.trajectory.TrapezoidProfile;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public abstract class TrapezoidProfileSubsystem extends SubsystemBase {
|
||||
private final double m_period;
|
||||
|
||||
@@ -10,6 +10,8 @@ import edu.wpi.first.wpilibj.Timer;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class WaitCommand extends CommandBase {
|
||||
protected Timer m_timer = new Timer();
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.function.BooleanSupplier;
|
||||
/**
|
||||
* A command that does nothing but ends after a specified match time or condition. Useful for
|
||||
* CommandGroups.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class WaitUntilCommand extends CommandBase {
|
||||
private final BooleanSupplier m_condition;
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.util.function.BooleanSupplier;
|
||||
* <p>This class represents a subclass of Trigger that is specifically aimed at buttons on an
|
||||
* operator interface as a common use case of the more generalized Trigger objects. This is a simple
|
||||
* wrapper around Trigger with the method names renamed to fit the Button object use.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class Button extends Trigger {
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,8 @@ package edu.wpi.first.wpilibj2.command.button;
|
||||
/**
|
||||
* This class is intended to be used within a program. The programmer can manually set its value.
|
||||
* Also includes a setting for whether or not it should invert its value.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class InternalButton extends Button {
|
||||
private boolean m_pressed;
|
||||
|
||||
@@ -8,7 +8,11 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
|
||||
|
||||
import edu.wpi.first.wpilibj.GenericHID;
|
||||
|
||||
/** A {@link Button} that gets its state from a {@link GenericHID}. */
|
||||
/**
|
||||
* A {@link Button} that gets its state from a {@link GenericHID}.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class JoystickButton extends Button {
|
||||
private final GenericHID m_joystick;
|
||||
private final int m_buttonNumber;
|
||||
|
||||
@@ -8,7 +8,11 @@ import edu.wpi.first.networktables.NetworkTable;
|
||||
import edu.wpi.first.networktables.NetworkTableEntry;
|
||||
import edu.wpi.first.networktables.NetworkTableInstance;
|
||||
|
||||
/** A {@link Button} that uses a {@link NetworkTable} boolean field. */
|
||||
/**
|
||||
* A {@link Button} that uses a {@link NetworkTable} boolean field.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class NetworkButton extends Button {
|
||||
private final NetworkTableEntry m_entry;
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
|
||||
|
||||
import edu.wpi.first.wpilibj.GenericHID;
|
||||
|
||||
/** A {@link Button} that gets its state from a POV on a {@link GenericHID}. */
|
||||
/**
|
||||
* A {@link Button} that gets its state from a POV on a {@link GenericHID}.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class POVButton extends Button {
|
||||
private final GenericHID m_joystick;
|
||||
private final int m_angle;
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.function.BooleanSupplier;
|
||||
* (for instance, if they want to react to the user holding a button while the robot is reading a
|
||||
* certain sensor input). For this, they only have to write the {@link Trigger#get()} method to get
|
||||
* the full functionality of the Trigger class.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
public class Trigger implements BooleanSupplier {
|
||||
private final BooleanSupplier m_isActive;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>>>
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -25,6 +25,8 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
* and derivative calculations. Therefore, the sample rate affects the controller's behavior for a
|
||||
* given set of PID constants.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @deprecated All APIs which use this have been deprecated.
|
||||
*/
|
||||
@Deprecated(since = "2020", forRemoval = true)
|
||||
|
||||
@@ -16,6 +16,8 @@ import edu.wpi.first.util.sendable.SendableBuilder;
|
||||
* and derivative calculations. Therefore, the sample rate affects the controller's behavior for a
|
||||
* given set of PID constants.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @deprecated Use {@link edu.wpi.first.math.controller.PIDController} instead.
|
||||
*/
|
||||
@Deprecated(since = "2020", forRemoval = true)
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
/**
|
||||
* Interface for PID Controller.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @deprecated All APIs which use this have been deprecated.
|
||||
*/
|
||||
@Deprecated(since = "2020", forRemoval = true)
|
||||
@SuppressWarnings("SummaryJavadoc")
|
||||
public interface PIDInterface {
|
||||
|
||||
@@ -7,6 +7,8 @@ package edu.wpi.first.wpilibj;
|
||||
/**
|
||||
* This interface allows PIDController to write it's results to its output.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @deprecated Use DoubleConsumer and new PIDController class.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
|
||||
@@ -7,6 +7,8 @@ package edu.wpi.first.wpilibj;
|
||||
/**
|
||||
* This interface allows for PIDController to automatically read from this object.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @deprecated Use DoubleSupplier and new PIDController class.
|
||||
*/
|
||||
@Deprecated(since = "2020", forRemoval = true)
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
/** A description for the type of output value to provide to a PIDController. */
|
||||
/**
|
||||
* A description for the type of output value to provide to a PIDController.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
@Deprecated(since = "2020", forRemoval = true)
|
||||
public enum PIDSourceType {
|
||||
kDisplacement,
|
||||
|
||||
@@ -15,6 +15,8 @@ import edu.wpi.first.wpilibj.command.Command;
|
||||
* <p>This class represents a subclass of Trigger that is specifically aimed at buttons on an
|
||||
* operator interface as a common use case of the more generalized Trigger objects. This is a simple
|
||||
* wrapper around Trigger with the method names renamed to fit the Button object use.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public abstract class Button extends Trigger {
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
package edu.wpi.first.wpilibj.buttons;
|
||||
|
||||
/**
|
||||
* This class is intended to be used within a program. The programmer can manually set its value.
|
||||
* Also includes a setting for whether or not it should invert its value.
|
||||
* This {@link Button} is intended to be used within a program. The programmer can manually set its
|
||||
* value. * Also includes a setting for whether or not it should invert its value.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class InternalButton extends Button {
|
||||
private boolean m_pressed;
|
||||
|
||||
@@ -6,7 +6,11 @@ package edu.wpi.first.wpilibj.buttons;
|
||||
|
||||
import edu.wpi.first.wpilibj.GenericHID;
|
||||
|
||||
/** A {@link Button} that gets its state from a {@link GenericHID}. */
|
||||
/**
|
||||
* A {@link Button} that gets its state from a {@link GenericHID}.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class JoystickButton extends Button {
|
||||
private final GenericHID m_joystick;
|
||||
private final int m_buttonNumber;
|
||||
|
||||
@@ -8,7 +8,11 @@ import edu.wpi.first.networktables.NetworkTable;
|
||||
import edu.wpi.first.networktables.NetworkTableEntry;
|
||||
import edu.wpi.first.networktables.NetworkTableInstance;
|
||||
|
||||
/** A {@link Button} that uses a {@link NetworkTable} boolean field. */
|
||||
/**
|
||||
* A {@link Button} that uses a {@link NetworkTable} boolean field.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class NetworkButton extends Button {
|
||||
private final NetworkTableEntry m_entry;
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@ package edu.wpi.first.wpilibj.buttons;
|
||||
|
||||
import edu.wpi.first.wpilibj.GenericHID;
|
||||
|
||||
/** A {@link Button} that gets its state from a POV on a {@link GenericHID}. */
|
||||
/**
|
||||
* A {@link Button} that gets its state from a POV on a {@link GenericHID}.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class POVButton extends Button {
|
||||
private final GenericHID m_joystick;
|
||||
private final int m_angle;
|
||||
|
||||
@@ -19,6 +19,8 @@ import edu.wpi.first.wpilibj.command.Scheduler;
|
||||
* (for instance, if they want to react to the user holding a button while the robot is reading a
|
||||
* certain sensor input). For this, they only have to write the {@link Trigger#get()} method to get
|
||||
* the full functionality of the Trigger class.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public abstract class Trigger implements Sendable {
|
||||
private volatile boolean m_sendablePressed;
|
||||
|
||||
@@ -32,6 +32,8 @@ import java.util.Enumeration;
|
||||
* active command is not interruptible, the other one will not even be started, and the active one
|
||||
* will continue functioning.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @see Subsystem
|
||||
* @see CommandGroup
|
||||
* @see IllegalUseOfCommandException
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.Vector;
|
||||
* <p>CommandGroups can also execute commands in parallel, simply by adding them using {@link
|
||||
* CommandGroup#addParallel(Command) addParallel(...)}.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @see Command
|
||||
* @see Subsystem
|
||||
* @see IllegalUseOfCommandException
|
||||
|
||||
@@ -22,6 +22,8 @@ import java.util.Enumeration;
|
||||
* <p>A ConditionalCommand will require the superset of subsystems of the onTrue and onFalse
|
||||
* commands.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @see Command
|
||||
* @see Scheduler
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ package edu.wpi.first.wpilibj.command;
|
||||
* <p>This exception should be thrown if (after a command has been locked) its requirements change,
|
||||
* it is put into multiple command groups, it is started from outside its command group, or it adds
|
||||
* a new child.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class IllegalUseOfCommandException extends RuntimeException {
|
||||
|
||||
@@ -9,6 +9,8 @@ package edu.wpi.first.wpilibj.command;
|
||||
*
|
||||
* <p>Subclassing {@link InstantCommand} is shorthand for returning true from {@link Command
|
||||
* isFinished}.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class InstantCommand extends Command {
|
||||
private Runnable m_func;
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.command;
|
||||
|
||||
/** An element that is in a LinkedList. */
|
||||
/**
|
||||
* An element that is in a LinkedList.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
class LinkedListElement {
|
||||
private LinkedListElement m_next;
|
||||
private LinkedListElement m_previous;
|
||||
|
||||
@@ -16,6 +16,8 @@ import edu.wpi.first.wpilibj.PIDSourceType;
|
||||
* <p>It provides some convenience methods to run an internal {@link PIDController} . It will also
|
||||
* start and stop said {@link PIDController} when the {@link PIDCommand} is first initialized and
|
||||
* ended/interrupted.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public abstract class PIDCommand extends Command {
|
||||
/** The internal {@link PIDController}. */
|
||||
|
||||
@@ -16,6 +16,8 @@ import edu.wpi.first.wpilibj.PIDSourceType;
|
||||
*
|
||||
* <p>It provides some convenience methods to run an internal {@link PIDController} . It also allows
|
||||
* access to the internal {@link PIDController} in order to give total control to the programmer.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public abstract class PIDSubsystem extends Subsystem {
|
||||
/** The internal {@link PIDController}. */
|
||||
|
||||
@@ -8,6 +8,8 @@ package edu.wpi.first.wpilibj.command;
|
||||
* A {@link PrintCommand} is a command which prints out a string when it is initialized, and then
|
||||
* immediately finishes. It is useful if you want a {@link CommandGroup} to print out a string when
|
||||
* it reaches a certain point.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*/
|
||||
public class PrintCommand extends InstantCommand {
|
||||
/** The message to print out. */
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.util.Vector;
|
||||
* Scheduler#run() run()} often to have {@link Command Commands} function correctly. However, this
|
||||
* is already done for you if you use the CommandBased Robot template.
|
||||
*
|
||||
* <p>This class is provided by the OldCommands VendorDep
|
||||
*
|
||||
* @see Command
|
||||
*/
|
||||
public final class Scheduler implements NTSendable, AutoCloseable {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user