[command] Remove old command-based framework (#4211)

This commit is contained in:
Tyler Veness
2022-05-04 22:02:53 -07:00
committed by GitHub
parent ee03a7ad3b
commit 99343d40ba
171 changed files with 32 additions and 12798 deletions

View File

@@ -1,37 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.command;
import edu.wpi.first.wpilibj.command.Command;
public class ReplaceMeCommand extends Command {
public ReplaceMeCommand() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
// Called just before this Command runs the first time
@Override
protected void initialize() {}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
@Override
protected void end() {}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {}
}

View File

@@ -1,29 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.commandgroup;
import edu.wpi.first.wpilibj.command.CommandGroup;
public class ReplaceMeCommandGroup extends CommandGroup {
/** Add your docs here. */
public ReplaceMeCommandGroup() {
// Add Commands here:
// e.g. addSequential(new Command1());
// addSequential(new Command2());
// these will run in order.
// To run multiple commands at the same time,
// use addParallel()
// e.g. addParallel(new Command1());
// addSequential(new Command2());
// Command1 and Command2 will run in parallel.
// A command group will require all of the subsystems that each member
// would require.
// e.g. if Command1 requires chassis, and Command2 requires arm,
// a CommandGroup containing them would require both the chassis and the
// arm.
}
}

View File

@@ -10,78 +10,7 @@
"commandversion": 0
},
{
"name": "Command (Old)",
"description": "Create a base command",
"tags": [
"command"
],
"foldername": "command",
"replacename": "ReplaceMeCommand",
"commandversion": 1
},
{
"name": "Command Group (Old)",
"description": "Create a command group",
"tags": [
"commandgroup"
],
"foldername": "commandgroup",
"replacename": "ReplaceMeCommandGroup",
"commandversion": 1
},
{
"name": "Instant Command (Old)",
"description": "A command that runs immediately",
"tags": [
"instantcommand"
],
"foldername": "instant",
"replacename": "ReplaceMeInstantCommand",
"commandversion": 1
},
{
"name": "Subsystem (Old)",
"description": "A subsystem",
"tags": [
"subsystem"
],
"foldername": "subsystem",
"replacename": "ReplaceMeSubsystem",
"commandversion": 1
},
{
"name": "PID Subsystem (Old)",
"description": "A subsystem that runs a PID loop",
"tags": [
"pidsubsystem",
"pid"
],
"foldername": "pidsubsystem",
"replacename": "ReplaceMePIDSubsystem",
"commandversion": 1
},
{
"name": "Timed Command (Old)",
"description": "A command that runs for a specified time",
"tags": [
"timedcommand"
],
"foldername": "timed",
"replacename": "ReplaceMeTimedCommand",
"commandversion": 1
},
{
"name": "Trigger (Old)",
"description": "A command that runs off of a trigger",
"tags": [
"trigger"
],
"foldername": "trigger",
"replacename": "ReplaceMeTrigger",
"commandversion": 1
},
{
"name": "Command (New)",
"name": "Command",
"description": "A command.",
"tags": [
"command"
@@ -91,7 +20,7 @@
"commandversion": 2
},
{
"name": "InstantCommand (New)",
"name": "InstantCommand",
"description": "A command that finishes instantly.",
"tags": [
"instantcommand"
@@ -101,7 +30,7 @@
"commandversion": 2
},
{
"name": "ParallelCommandGroup (New)",
"name": "ParallelCommandGroup",
"description": "A command group that runs commands in parallel, ending when all commands have finished.",
"tags": [
"parallelcommandgroup"
@@ -111,7 +40,7 @@
"commandversion": 2
},
{
"name": "ParallelDeadlineGroup (New)",
"name": "ParallelDeadlineGroup",
"description": "A command group that runs commands in parallel, ending when a specific command has finished.",
"tags": [
"paralleldeadlinegroup"
@@ -121,7 +50,7 @@
"commandversion": 2
},
{
"name": "ParallelRaceGroup (New)",
"name": "ParallelRaceGroup",
"description": "A command that runs commands in parallel, ending as soon as any command has finished.",
"tags": [
"parallelracegroup"
@@ -131,7 +60,7 @@
"commandversion": 2
},
{
"name": "PIDCommand (New)",
"name": "PIDCommand",
"description": "A command that runs a PIDController.",
"tags": [
"pidcommand"
@@ -141,7 +70,7 @@
"commandversion": 2
},
{
"name": "PIDSubsystem (New)",
"name": "PIDSubsystem",
"description": "A subsystem that runs a PIDController.",
"tags": [
"pidsubsystem"
@@ -151,7 +80,7 @@
"commandversion": 2
},
{
"name": "ProfiledPIDCommand (New)",
"name": "ProfiledPIDCommand",
"description": "A command that runs a ProfiledPIDController.",
"tags": [
"profiledpidcommand"
@@ -161,7 +90,7 @@
"commandversion": 2
},
{
"name": "ProfiledPIDSubsystem (New)",
"name": "ProfiledPIDSubsystem",
"description": "A subsystem that runs a ProfiledPIDController.",
"tags": [
"profiledpidsubsystem"
@@ -171,7 +100,7 @@
"commandversion": 2
},
{
"name": "SequentialCommandGroup (New)",
"name": "SequentialCommandGroup",
"description": "A command group that runs commands in sequence.",
"tags": [
"sequentialcommandgroup"
@@ -181,7 +110,7 @@
"commandversion": 2
},
{
"name": "Subsystem (New)",
"name": "Subsystem",
"description": "A robot subsystem.",
"tags": [
"subsystem"
@@ -191,7 +120,7 @@
"commandversion": 2
},
{
"name": "TrapezoidProfileCommand (New)",
"name": "TrapezoidProfileCommand",
"description": "A command that executes a trapezoidal motion profile.",
"tags": [
"trapezoidprofilecommand"
@@ -201,7 +130,7 @@
"commandversion": 2
},
{
"name": "TrapezoidProfileSubsystem (New)",
"name": "TrapezoidProfileSubsystem",
"description": "A subystem that executes a trapezoidal motion profile.",
"tags": [
"trapezoidprofilesubsystem"

View File

@@ -1,21 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.instant;
import edu.wpi.first.wpilibj.command.InstantCommand;
/** Add your docs here. */
public class ReplaceMeInstantCommand extends InstantCommand {
/** Add your docs here. */
public ReplaceMeInstantCommand() {
super();
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
// Called once when the command executes
@Override
protected void initialize() {}
}

View File

@@ -1,40 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.pidsubsystem;
import edu.wpi.first.wpilibj.command.PIDSubsystem;
/** Add your docs here. */
public class ReplaceMePIDSubsystem extends PIDSubsystem {
/** Add your docs here. */
public ReplaceMePIDSubsystem() {
// Intert a subsystem name and PID values here
super("SubsystemName", 1, 2, 3);
// Use these to get going:
// setSetpoint() - Sets where the PID controller should move the system
// to
// enable() - Enables the PID controller.
}
@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}
@Override
protected double returnPIDInput() {
// Return your input value for the PID loop
// e.g. a sensor, like a potentiometer:
// yourPot.getAverageVoltage() / kYourMaxVoltage;
return 0.0;
}
@Override
protected void usePIDOutput(double output) {
// Use output to drive your system, like a motor
// e.g. yourMotor.set(output);
}
}

View File

@@ -1,19 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.subsystem;
import edu.wpi.first.wpilibj.command.Subsystem;
/** Add your docs here. */
public class ReplaceMeSubsystem extends Subsystem {
// Put methods for controlling this subsystem
// here. Call these from Commands.
@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}
}

View File

@@ -1,34 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.timed;
import edu.wpi.first.wpilibj.command.TimedCommand;
/** Add your docs here. */
public class ReplaceMeTimedCommand extends TimedCommand {
/** Add your docs here. */
public ReplaceMeTimedCommand(double timeout) {
super(timeout);
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
// Called just before this Command runs the first time
@Override
protected void initialize() {}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {}
// Called once after timeout
@Override
protected void end() {}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {}
}

View File

@@ -1,15 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.commands.trigger;
import edu.wpi.first.wpilibj.buttons.Trigger;
/** Add your docs here. */
public class ReplaceMeTrigger extends Trigger {
@Override
public boolean get() {
return false;
}
}