mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Merge CommandBase into Command and SubsystemBase into Subsystem (#5392)
Moves all CommandBase functionality into Command and deprecates CommandBase for removal. Moves all SubsystemBase functionality into Subsystem and deprecates SubsystemBase for removal. Adds a function to CommandScheduler to remove all registered Subsystems.
This commit is contained in:
@@ -4,18 +4,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
/**
|
||||
* An example command.
|
||||
*
|
||||
* <p>Note that this extends CommandHelper, rather extending CommandBase
|
||||
* <p>Note that this extends CommandHelper, rather extending Command
|
||||
* directly; this is crucially important, or else the decorator functions in
|
||||
* Command will *not* work!
|
||||
*/
|
||||
class ReplaceMeCommand2
|
||||
: public frc2::CommandHelper<frc2::CommandBase, ReplaceMeCommand2> {
|
||||
: public frc2::CommandHelper<frc2::Command, ReplaceMeCommand2> {
|
||||
public:
|
||||
ReplaceMeCommand2();
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
class ReplaceMeSubsystem2 : public frc2::SubsystemBase {
|
||||
class ReplaceMeSubsystem2 : public frc2::Subsystem {
|
||||
public:
|
||||
ReplaceMeSubsystem2();
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/Commands.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#include <frc/controller/SimpleMotorFeedforward.h>
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/trajectory/TrapezoidProfile.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "Constants.h"
|
||||
#include "ExampleSmartMotorController.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/Claw.h"
|
||||
@@ -12,7 +12,7 @@
|
||||
/**
|
||||
* Closes the claw until the limit switch is tripped.
|
||||
*/
|
||||
class CloseClaw : public frc2::CommandHelper<frc2::CommandBase, CloseClaw> {
|
||||
class CloseClaw : public frc2::CommandHelper<frc2::Command, CloseClaw> {
|
||||
public:
|
||||
explicit CloseClaw(Claw& claw);
|
||||
void Initialize() override;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/Elevator.h"
|
||||
@@ -17,7 +17,7 @@
|
||||
* commands using the elevator should make sure they disable PID!
|
||||
*/
|
||||
class SetElevatorSetpoint
|
||||
: public frc2::CommandHelper<frc2::CommandBase, SetElevatorSetpoint> {
|
||||
: public frc2::CommandHelper<frc2::Command, SetElevatorSetpoint> {
|
||||
public:
|
||||
explicit SetElevatorSetpoint(double setpoint, Elevator& elevator);
|
||||
void Initialize() override;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/Wrist.h"
|
||||
@@ -15,7 +15,7 @@
|
||||
* Other commands using the wrist should make sure they disable PID!
|
||||
*/
|
||||
class SetWristSetpoint
|
||||
: public frc2::CommandHelper<frc2::CommandBase, SetWristSetpoint> {
|
||||
: public frc2::CommandHelper<frc2::Command, SetWristSetpoint> {
|
||||
public:
|
||||
explicit SetWristSetpoint(double setpoint, Wrist& wrist);
|
||||
void Initialize() override;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
@@ -12,7 +12,7 @@
|
||||
/**
|
||||
* Have the robot drive tank style using the PS3 Joystick until interrupted.
|
||||
*/
|
||||
class TankDrive : public frc2::CommandHelper<frc2::CommandBase, TankDrive> {
|
||||
class TankDrive : public frc2::CommandHelper<frc2::Command, TankDrive> {
|
||||
public:
|
||||
TankDrive(std::function<double()> left, std::function<double()> right,
|
||||
Drivetrain& drivetrain);
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
#include <frc/DigitalInput.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
/**
|
||||
* The claw subsystem is a simple system with a motor for opening and closing.
|
||||
* If using stronger motors, you should probably use a sensor so that the
|
||||
* motors don't stall.
|
||||
*/
|
||||
class Claw : public frc2::SubsystemBase {
|
||||
class Claw : public frc2::Subsystem {
|
||||
public:
|
||||
Claw();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
namespace frc {
|
||||
class Joystick;
|
||||
@@ -21,7 +21,7 @@ class Joystick;
|
||||
* the robots chassis. These include four drive motors, a left and right encoder
|
||||
* and a gyro.
|
||||
*/
|
||||
class Drivetrain : public frc2::SubsystemBase {
|
||||
class Drivetrain : public frc2::Subsystem {
|
||||
public:
|
||||
Drivetrain();
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/angle.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void DriveSubsystem::SetMaxOutput(double maxOutput) {
|
||||
}
|
||||
|
||||
void DriveSubsystem::InitSendable(wpi::SendableBuilder& builder) {
|
||||
SubsystemBase::InitSendable(builder);
|
||||
Subsystem::InitSendable(builder);
|
||||
|
||||
// Publish encoder distances to telemetry.
|
||||
builder.AddDoubleProperty(
|
||||
|
||||
@@ -25,7 +25,7 @@ frc2::CommandPtr HatchSubsystem::ReleaseHatchCommand() {
|
||||
}
|
||||
|
||||
void HatchSubsystem::InitSendable(wpi::SendableBuilder& builder) {
|
||||
SubsystemBase::InitSendable(builder);
|
||||
Subsystem::InitSendable(builder);
|
||||
|
||||
// Publish the solenoid state to telemetry.
|
||||
builder.AddBooleanProperty(
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
#include <frc/DoubleSolenoid.h>
|
||||
#include <frc/PneumaticsControlModule.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class HatchSubsystem : public frc2::SubsystemBase {
|
||||
class HatchSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
HatchSubsystem();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void DriveSubsystem::SetMaxOutput(double maxOutput) {
|
||||
}
|
||||
|
||||
void DriveSubsystem::InitSendable(wpi::SendableBuilder& builder) {
|
||||
SubsystemBase::InitSendable(builder);
|
||||
Subsystem::InitSendable(builder);
|
||||
|
||||
// Publish encoder distances to telemetry.
|
||||
builder.AddDoubleProperty(
|
||||
|
||||
@@ -21,7 +21,7 @@ void HatchSubsystem::ReleaseHatch() {
|
||||
}
|
||||
|
||||
void HatchSubsystem::InitSendable(wpi::SendableBuilder& builder) {
|
||||
SubsystemBase::InitSendable(builder);
|
||||
Subsystem::InitSendable(builder);
|
||||
|
||||
// Publish the solenoid state to telemetry.
|
||||
builder.AddBooleanProperty(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/DriveSubsystem.h"
|
||||
@@ -16,8 +16,7 @@
|
||||
*
|
||||
* @see RunCommand
|
||||
*/
|
||||
class DefaultDrive
|
||||
: public frc2::CommandHelper<frc2::CommandBase, DefaultDrive> {
|
||||
class DefaultDrive : public frc2::CommandHelper<frc2::Command, DefaultDrive> {
|
||||
public:
|
||||
/**
|
||||
* Creates a new DefaultDrive.
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/DriveSubsystem.h"
|
||||
|
||||
class DriveDistance
|
||||
: public frc2::CommandHelper<frc2::CommandBase, DriveDistance> {
|
||||
class DriveDistance : public frc2::CommandHelper<frc2::Command, DriveDistance> {
|
||||
public:
|
||||
/**
|
||||
* Creates a new DriveDistance.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/HatchSubsystem.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @see InstantCommand
|
||||
*/
|
||||
class GrabHatch : public frc2::CommandHelper<frc2::CommandBase, GrabHatch> {
|
||||
class GrabHatch : public frc2::CommandHelper<frc2::Command, GrabHatch> {
|
||||
public:
|
||||
explicit GrabHatch(HatchSubsystem* subsystem);
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/DriveSubsystem.h"
|
||||
|
||||
class HalveDriveSpeed
|
||||
: public frc2::CommandHelper<frc2::CommandBase, HalveDriveSpeed> {
|
||||
: public frc2::CommandHelper<frc2::Command, HalveDriveSpeed> {
|
||||
public:
|
||||
explicit HalveDriveSpeed(DriveSubsystem* subsystem);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/HatchSubsystem.h"
|
||||
@@ -16,8 +16,7 @@
|
||||
*
|
||||
* @see InstantCommand
|
||||
*/
|
||||
class ReleaseHatch
|
||||
: public frc2::CommandHelper<frc2::CommandBase, ReleaseHatch> {
|
||||
class ReleaseHatch : public frc2::CommandHelper<frc2::Command, ReleaseHatch> {
|
||||
public:
|
||||
explicit ReleaseHatch(HatchSubsystem* subsystem);
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
#include <frc/DoubleSolenoid.h>
|
||||
#include <frc/PneumaticsControlModule.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class HatchSubsystem : public frc2::SubsystemBase {
|
||||
class HatchSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
HatchSubsystem();
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
#include <frc/kinematics/MecanumDriveOdometry.h>
|
||||
#include <frc/kinematics/MecanumDriveWheelSpeeds.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
#include <frc/kinematics/DifferentialDriveOdometry.h>
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/voltage.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
#include <frc/motorcontrol/MotorControllerGroup.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class Drive : public frc2::SubsystemBase {
|
||||
class Drive : public frc2::Subsystem {
|
||||
public:
|
||||
Drive();
|
||||
/**
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
#include <frc/DoubleSolenoid.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class Intake : public frc2::SubsystemBase {
|
||||
class Intake : public frc2::Subsystem {
|
||||
public:
|
||||
Intake() = default;
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
#include <frc/Compressor.h>
|
||||
#include <frc/PneumaticsControlModule.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/pressure.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class Pneumatics : frc2::SubsystemBase {
|
||||
class Pneumatics : frc2::Subsystem {
|
||||
public:
|
||||
Pneumatics();
|
||||
/** Returns a command that disables the compressor indefinitely. */
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
#include <frc/controller/SimpleMotorFeedforward.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/angle.h>
|
||||
#include <units/angular_velocity.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class Shooter : public frc2::SubsystemBase {
|
||||
class Shooter : public frc2::Subsystem {
|
||||
public:
|
||||
Shooter();
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
#include <frc/DigitalInput.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class Storage : frc2::SubsystemBase {
|
||||
class Storage : frc2::Subsystem {
|
||||
public:
|
||||
Storage();
|
||||
/** Returns a command that runs the storage motor indefinitely. */
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
|
||||
class DriveDistance
|
||||
: public frc2::CommandHelper<frc2::CommandBase, DriveDistance> {
|
||||
class DriveDistance : public frc2::CommandHelper<frc2::Command, DriveDistance> {
|
||||
public:
|
||||
DriveDistance(double speed, units::meter_t distance, Drivetrain* drive)
|
||||
: m_speed(speed), m_distance(distance), m_drive(drive) {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/Timer.h>
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
#include <units/time.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
|
||||
class DriveTime : public frc2::CommandHelper<frc2::CommandBase, DriveTime> {
|
||||
class DriveTime : public frc2::CommandHelper<frc2::Command, DriveTime> {
|
||||
public:
|
||||
DriveTime(double speed, units::second_t time, Drivetrain* drive)
|
||||
: m_speed(speed), m_duration(time), m_drive(drive) {
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
|
||||
class TeleopArcadeDrive
|
||||
: public frc2::CommandHelper<frc2::CommandBase, TeleopArcadeDrive> {
|
||||
: public frc2::CommandHelper<frc2::Command, TeleopArcadeDrive> {
|
||||
public:
|
||||
TeleopArcadeDrive(Drivetrain* subsystem,
|
||||
std::function<double()> xaxisSpeedSupplier,
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
#include <units/angle.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
|
||||
class TurnDegrees : public frc2::CommandHelper<frc2::CommandBase, TurnDegrees> {
|
||||
class TurnDegrees : public frc2::CommandHelper<frc2::Command, TurnDegrees> {
|
||||
public:
|
||||
TurnDegrees(double speed, units::degree_t angle, Drivetrain* drive)
|
||||
: m_speed(speed), m_angle(angle), m_drive(drive) {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/Timer.h>
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
#include <units/time.h>
|
||||
|
||||
#include "subsystems/Drivetrain.h"
|
||||
|
||||
class TurnTime : public frc2::CommandHelper<frc2::CommandBase, TurnTime> {
|
||||
class TurnTime : public frc2::CommandHelper<frc2::Command, TurnTime> {
|
||||
public:
|
||||
TurnTime(double speed, units::second_t time, Drivetrain* drive)
|
||||
: m_speed(speed), m_duration(time), m_drive(drive) {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
#include <frc/Encoder.h>
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/Spark.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "sensors/RomiGyro.h"
|
||||
|
||||
class Drivetrain : public frc2::SubsystemBase {
|
||||
class Drivetrain : public frc2::Subsystem {
|
||||
public:
|
||||
static constexpr double kCountsPerRevolution = 1440.0;
|
||||
static constexpr units::meter_t kWheelDiameter = 70_mm;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <frc/DigitalInput.h>
|
||||
#include <frc/DigitalOutput.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
/**
|
||||
* This class represents the onboard IO of the Romi
|
||||
@@ -20,7 +20,7 @@
|
||||
* DIO 2 - Button C (input) or Red LED (output)
|
||||
* DIO 3 - Yellow LED (output only)
|
||||
*/
|
||||
class OnBoardIO : public frc2::SubsystemBase {
|
||||
class OnBoardIO : public frc2::Subsystem {
|
||||
public:
|
||||
enum ChannelMode { INPUT, OUTPUT };
|
||||
OnBoardIO(OnBoardIO::ChannelMode dio1, OnBoardIO::ChannelMode dio2);
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
#include <frc/simulation/DifferentialDrivetrainSim.h>
|
||||
#include <frc/simulation/EncoderSim.h>
|
||||
#include <frc/smartdashboard/Field2d.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
#include <units/voltage.h>
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#include <frc/kinematics/SwerveDriveKinematics.h>
|
||||
#include <frc/kinematics/SwerveDriveOdometry.h>
|
||||
#include <frc/motorcontrol/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
#include "Constants.h"
|
||||
#include "SwerveModule.h"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/Command.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
#include "subsystems/ExampleSubsystem.h"
|
||||
@@ -12,12 +12,12 @@
|
||||
/**
|
||||
* An example command that uses an example subsystem.
|
||||
*
|
||||
* <p>Note that this extends CommandHelper, rather extending CommandBase
|
||||
* <p>Note that this extends CommandHelper, rather extending Command
|
||||
* directly; this is crucially important, or else the decorator functions in
|
||||
* Command will *not* work!
|
||||
*/
|
||||
class ExampleCommand
|
||||
: public frc2::CommandHelper<frc2::CommandBase, ExampleCommand> {
|
||||
: public frc2::CommandHelper<frc2::Command, ExampleCommand> {
|
||||
public:
|
||||
/**
|
||||
* Creates a new ExampleCommand.
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
#include <frc2/command/Subsystem.h>
|
||||
|
||||
class ExampleSubsystem : public frc2::SubsystemBase {
|
||||
class ExampleSubsystem : public frc2::Subsystem {
|
||||
public:
|
||||
ExampleSubsystem();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user