From f3f68a9e1ff435ee6d0a3abc47f4b1d8d20acf04 Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Sun, 8 Sep 2024 15:41:35 +0800 Subject: [PATCH] [documentation] Remove ReplaceMeCommand examples --- shared/examplecheck.gradle | 24 -- wpilibcExamples/build.gradle | 37 +-- .../commands/command2/ReplaceMeCommand2.cpp | 23 -- .../cpp/commands/command2/ReplaceMeCommand2.h | 29 --- .../src/main/cpp/commands/commands.json | 210 ------------------ .../emptyclass/ReplaceMeEmptyClass.cpp | 7 - .../commands/emptyclass/ReplaceMeEmptyClass.h | 10 - .../ReplaceMeInstantCommand2.cpp | 15 -- .../instantcommand/ReplaceMeInstantCommand2.h | 17 -- .../ReplaceMeParallelCommandGroup.cpp | 13 -- .../ReplaceMeParallelCommandGroup.h | 15 -- .../ReplaceMeParallelDeadlineGroup.cpp | 17 -- .../ReplaceMeParallelDeadlineGroup.h | 15 -- .../ReplaceMeParallelRaceGroup.cpp | 13 -- .../ReplaceMeParallelRaceGroup.h | 15 -- .../pidcommand/ReplaceMePIDCommand.cpp | 24 -- .../commands/pidcommand/ReplaceMePIDCommand.h | 16 -- .../pidsubsystem2/ReplaceMePIDSubsystem2.cpp | 18 -- .../pidsubsystem2/ReplaceMePIDSubsystem2.h | 17 -- .../ReplaceMeProfiledPIDCommand.cpp | 38 ---- .../ReplaceMeProfiledPIDCommand.h | 18 -- .../ReplaceMeProfiledPIDSubsystem.cpp | 28 --- .../ReplaceMeProfiledPIDSubsystem.h | 20 -- .../ReplaceMeSequentialCommandGroup.cpp | 13 -- .../ReplaceMeSequentialCommandGroup.h | 15 -- .../subsystem2/ReplaceMeSubsystem2.cpp | 10 - .../commands/subsystem2/ReplaceMeSubsystem2.h | 21 -- .../ReplaceMeTrapezoidProfileSubsystem.cpp | 20 -- .../ReplaceMeTrapezoidProfileSubsystem.h | 17 -- wpilibjExamples/build.gradle | 2 - .../commands/command2/ReplaceMeCommand.java | 32 --- .../wpi/first/wpilibj/commands/commands.json | 132 ----------- .../emptyclass/ReplaceMeEmptyClass.java | 8 - .../ReplaceMeInstantCommand.java | 20 -- .../ReplaceMeParallelCommandGroup.java | 19 -- .../ReplaceMeParallelDeadlineGroup.java | 21 -- .../ReplaceMeParallelRaceGroup.java | 19 -- .../pidcommand/ReplaceMePIDCommand.java | 36 --- .../pidsubsystem2/ReplaceMePIDSubsystem.java | 28 --- .../ReplaceMeProfiledPIDCommand.java | 43 ---- .../ReplaceMeProfiledPIDSubsystem.java | 34 --- .../ReplaceMeSequentialCommandGroup.java | 19 -- .../subsystem2/ReplaceMeSubsystem.java | 17 -- .../ReplaceMeTrapezoidProfileSubsystem.java | 24 -- 44 files changed, 1 insertion(+), 1188 deletions(-) delete mode 100644 wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/commands.json delete mode 100644 wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h delete mode 100644 wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp delete mode 100644 wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/emptyclass/ReplaceMeEmptyClass.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/instantcommand/ReplaceMeInstantCommand.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelracegroup/ReplaceMeParallelRaceGroup.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/subsystem2/ReplaceMeSubsystem.java delete mode 100644 wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java diff --git a/shared/examplecheck.gradle b/shared/examplecheck.gradle index 9463ea1c8f7..4708f4e94a3 100644 --- a/shared/examplecheck.gradle +++ b/shared/examplecheck.gradle @@ -34,7 +34,6 @@ task checkTemplates(type: Task) { assert it.tags != null assert it.foldername != null assert it.gradlebase != null - assert it.commandversion != null if (it.gradlebase == 'java') { assert it.mainclass != null } @@ -95,7 +94,6 @@ task checkExamples(type: Task) { assert it.tags.findAll { !tagList.contains(it) }.empty assert it.foldername != null assert it.gradlebase != null - assert it.commandversion != null if (it.gradlebase == 'java') { assert it.mainclass != null } @@ -103,27 +101,5 @@ task checkExamples(type: Task) { } } -task checkCommands(type: Task) { - doLast { - def parsedJson = new groovy.json.JsonSlurper().parseText(commandFile.text) - fileCheck(parsedJson, commandDirectory) - parsedJson.each { - assert it.name != null - assert it.description != null - assert it.tags != null - assert it.foldername != null - assert it.replacename != null - assert it.commandversion != null - if (project.isCppCommands) { - assert it.headers != null - assert !it.headers.isEmpty() - assert it.source != null - assert !it.source.isEmpty() - } - } - } -} - check.dependsOn checkTemplates check.dependsOn checkExamples -check.dependsOn checkCommands diff --git a/wpilibcExamples/build.gradle b/wpilibcExamples/build.gradle index eb1aca52513..47dd87643fe 100644 --- a/wpilibcExamples/build.gradle +++ b/wpilibcExamples/build.gradle @@ -41,7 +41,7 @@ nativeUtils.platformConfigs.named(nativeUtils.wpi.platforms.windowsx64).configur } ext { - sharedCvConfigs = examplesMap + templatesMap + [commands: []] + sharedCvConfigs = examplesMap + templatesMap staticCvConfigs = [:] useJava = false useCpp = true @@ -53,39 +53,6 @@ apply from: "${rootDir}/shared/opencv.gradle" model { components { - commands(NativeLibrarySpec) { - binaries.all { binary -> - if (binary in StaticLibraryBinarySpec) { - binary.buildable = false - return - } - lib project: ':wpilibNewCommands', library: 'wpilibNewCommands', linkage: 'shared' - lib project: ':romiVendordep', library: 'romiVendordep', linkage: 'shared' - lib project: ':xrpVendordep', library: 'xrpVendordep', linkage: 'shared' - lib project: ':apriltag', library: 'apriltag', linkage: 'shared' - lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared' - lib project: ':wpimath', library: 'wpimath', linkage: 'shared' - project(':ntcore').addNtcoreDependency(binary, 'shared') - lib project: ':cscore', library: 'cscore', linkage: 'shared' - project(':hal').addHalDependency(binary, 'shared') - lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared' - lib project: ':wpinet', library: 'wpinet', linkage: 'shared' - lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' - } - sources { - cpp { - source { - srcDirs = ['src/main/cpp/commands'] - include '**/*.cpp' - } - exportedHeaders { - srcDirs 'src/main/cpp/commands' - include '**/*.h' - } - } - } - } - examplesMap.each { key, value -> "${key}"(NativeExecutableSpec) { targetBuildTypes 'debug' @@ -258,8 +225,6 @@ ext { templateFile = new File("$projectDir/src/main/cpp/templates/templates.json") exampleDirectory = new File("$projectDir/src/main/cpp/examples/") exampleFile = new File("$projectDir/src/main/cpp/examples/examples.json") - commandDirectory = new File("$projectDir/src/main/cpp/commands/") - commandFile = new File("$projectDir/src/main/cpp/commands/commands.json") } model { diff --git a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.cpp b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.cpp deleted file mode 100644 index c17d267c319..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.cpp +++ /dev/null @@ -1,23 +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. - -#include "ReplaceMeCommand2.h" - -ReplaceMeCommand2::ReplaceMeCommand2() { - // Use addRequirements() here to declare subsystem dependencies. -} - -// Called when the command is initially scheduled. -void ReplaceMeCommand2::Initialize() {} - -// Called repeatedly when this Command is scheduled to run -void ReplaceMeCommand2::Execute() {} - -// Called once the command ends or is interrupted. -void ReplaceMeCommand2::End(bool interrupted) {} - -// Returns true when the command should end. -bool ReplaceMeCommand2::IsFinished() { - return false; -} diff --git a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h deleted file mode 100644 index d3071eb4b0c..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h +++ /dev/null @@ -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. - -#pragma once - -#include -#include - -/** - * An example command. - * - *

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 { - public: - ReplaceMeCommand2(); - - void Initialize() override; - - void Execute() override; - - void End(bool interrupted) override; - - bool IsFinished() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/commands.json b/wpilibcExamples/src/main/cpp/commands/commands.json deleted file mode 100644 index 4fd9706f26f..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/commands.json +++ /dev/null @@ -1,210 +0,0 @@ -[ - { - "name": "Empty Class", - "description": "Create an empty command", - "tags": [ - "class" - ], - "foldername": "emptyclass", - "headers": [ - "ReplaceMeEmptyClass.h" - ], - "source": [ - "ReplaceMeEmptyClass.cpp" - ], - "replacename": "ReplaceMeEmptyClass", - "commandversion": 0 - }, - { - "name": "Command", - "description": "A command.", - "tags": [ - "command" - ], - "foldername": "command2", - "headers": [ - "ReplaceMeCommand2.h" - ], - "source": [ - "ReplaceMeCommand2.cpp" - ], - "replacename": "ReplaceMeCommand2", - "commandversion": 2 - }, - { - "name": "InstantCommand", - "description": "A command that finishes instantly.", - "tags": [ - "instantcommand" - ], - "foldername": "instantcommand", - "headers": [ - "ReplaceMeInstantCommand2.h" - ], - "source": [ - "ReplaceMeInstantCommand2.cpp" - ], - "replacename": "ReplaceMeInstantCommand2", - "commandversion": 2 - }, - { - "name": "ParallelCommandGroup", - "description": "A command group that runs commands in parallel, ending when all commands have finished.", - "tags": [ - "parallelcommandgroup" - ], - "foldername": "parallelcommandgroup", - "headers": [ - "ReplaceMeParallelCommandGroup.h" - ], - "source": [ - "ReplaceMeParallelCommandGroup.cpp" - ], - "replacename": "ReplaceMeParallelCommandGroup", - "commandversion": 2 - }, - { - "name": "ParallelDeadlineGroup", - "description": "A command group that runs commands in parallel, ending when a specific command has finished.", - "tags": [ - "paralleldeadlinegroup" - ], - "foldername": "paralleldeadlinegroup", - "headers": [ - "ReplaceMeParallelDeadlineGroup.h" - ], - "source": [ - "ReplaceMeParallelDeadlineGroup.cpp" - ], - "replacename": "ReplaceMeParallelDeadlineGroup", - "commandversion": 2 - }, - { - "name": "ParallelRaceGroup", - "description": "A command that runs commands in parallel, ending as soon as any command has finished.", - "tags": [ - "parallelracegroup" - ], - "foldername": "parallelracegroup", - "headers": [ - "ReplaceMeParallelRaceGroup.h" - ], - "source": [ - "ReplaceMeParallelRaceGroup.cpp" - ], - "replacename": "ReplaceMeParallelRaceGroup", - "commandversion": 2 - }, - { - "name": "PIDCommand", - "description": "A command that runs a PIDController.", - "tags": [ - "pidcommand" - ], - "foldername": "pidcommand", - "headers": [ - "ReplaceMePIDCommand.h" - ], - "source": [ - "ReplaceMePIDCommand.cpp" - ], - "replacename": "ReplaceMePIDCommand", - "commandversion": 2 - }, - { - "name": "PIDSubsystem", - "description": "A subsystem that runs a PIDController.", - "tags": [ - "pidsubsystem" - ], - "foldername": "pidsubsystem2", - "headers": [ - "ReplaceMePIDSubsystem2.h" - ], - "source": [ - "ReplaceMePIDSubsystem2.cpp" - ], - "replacename": "ReplaceMePIDSubsystem2", - "commandversion": 2 - }, - { - "name": "ProfiledPIDCommand", - "description": "A command that runs a ProfiledPIDController.", - "tags": [ - "profiledpidcommand" - ], - "foldername": "profiledpidcommand", - "headers": [ - "ReplaceMeProfiledPIDCommand.h" - ], - "source": [ - "ReplaceMeProfiledPIDCommand.cpp" - ], - "replacename": "ReplaceMeProfiledPIDCommand", - "commandversion": 2 - }, - { - "name": "ProfiledPIDSubsystem", - "description": "A subsystem that runs a ProfiledPIDController.", - "tags": [ - "profiledpidsubsystem" - ], - "foldername": "profiledpidsubsystem", - "headers": [ - "ReplaceMeProfiledPIDSubsystem.h" - ], - "source": [ - "ReplaceMeProfiledPIDSubsystem.cpp" - ], - "replacename": "ReplaceMeProfiledPIDSubsystem", - "commandversion": 2 - }, - { - "name": "SequentialCommandGroup", - "description": "A command group that runs commands in sequence.", - "tags": [ - "sequentialcommandgroup" - ], - "foldername": "sequentialcommandgroup", - "headers": [ - "ReplaceMeSequentialCommandGroup.h" - ], - "source": [ - "ReplaceMeSequentialCommandGroup.cpp" - ], - "replacename": "ReplaceMeSequentialCommandGroup", - "commandversion": 2 - }, - { - "name": "Subsystem", - "description": "A robot subsystem.", - "tags": [ - "subsystem" - ], - "foldername": "subsystem2", - "headers": [ - "ReplaceMeSubsystem2.h" - ], - "source": [ - "ReplaceMeSubsystem2.cpp" - ], - "replacename": "ReplaceMeSubsystem2", - "commandversion": 2 - }, - { - "name": "TrapezoidProfileSubsystem", - "description": "A subsystem that executes a trapezoidal motion profile.", - "tags": [ - "trapezoidprofilesubsystem" - ], - "foldername": "trapezoidprofilesubsystem", - "headers": [ - "ReplaceMeTrapezoidProfileSubsystem.h" - ], - "source": [ - "ReplaceMeTrapezoidProfileSubsystem.cpp" - ], - "replacename": "ReplaceMeTrapezoidProfileSubsystem", - "commandversion": 2 - } -] diff --git a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp b/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp deleted file mode 100644 index 19de34f3da0..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp +++ /dev/null @@ -1,7 +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. - -#include "ReplaceMeEmptyClass.h" - -ReplaceMeEmptyClass::ReplaceMeEmptyClass() = default; diff --git a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.h b/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.h deleted file mode 100644 index e6a733cc10b..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.h +++ /dev/null @@ -1,10 +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. - -#pragma once - -class ReplaceMeEmptyClass { - public: - ReplaceMeEmptyClass(); -}; diff --git a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.cpp b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.cpp deleted file mode 100644 index 4de2be6a80f..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.cpp +++ /dev/null @@ -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. - -#include "ReplaceMeInstantCommand2.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeInstantCommand2::ReplaceMeInstantCommand2() { - // Use addRequirements() here to declare subsystem dependencies. -} - -// Called when the command is initially scheduled. -void ReplaceMeInstantCommand2::Initialize() {} diff --git a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h deleted file mode 100644 index cd8de5f73f4..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h +++ /dev/null @@ -1,17 +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. - -#pragma once - -#include -#include - -class ReplaceMeInstantCommand2 - : public frc2::CommandHelper { - public: - ReplaceMeInstantCommand2(); - - void Initialize() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.cpp b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.cpp deleted file mode 100644 index 3a387ff99d4..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.cpp +++ /dev/null @@ -1,13 +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. - -#include "ReplaceMeParallelCommandGroup.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeParallelCommandGroup::ReplaceMeParallelCommandGroup() { - // Add your commands here, e.g. - // AddCommands(FooCommand{}, BarCommand{}); -} diff --git a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h deleted file mode 100644 index 1cbabdd53f5..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h +++ /dev/null @@ -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. - -#pragma once - -#include -#include - -class ReplaceMeParallelCommandGroup - : public frc2::CommandHelper { - public: - ReplaceMeParallelCommandGroup(); -}; diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp deleted file mode 100644 index f664e55b339..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp +++ /dev/null @@ -1,17 +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. - -#include "ReplaceMeParallelDeadlineGroup.h" - -#include - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeParallelDeadlineGroup::ReplaceMeParallelDeadlineGroup() - // The deadline command - : CommandHelper{frc2::InstantCommand{[] {}}} { - // Add your commands here, e.g. - // AddCommands(FooCommand{}, BarCommand{}); -} diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h deleted file mode 100644 index 91be75f88b7..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h +++ /dev/null @@ -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. - -#pragma once - -#include -#include - -class ReplaceMeParallelDeadlineGroup - : public frc2::CommandHelper { - public: - ReplaceMeParallelDeadlineGroup(); -}; diff --git a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.cpp b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.cpp deleted file mode 100644 index f51433cdeea..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.cpp +++ /dev/null @@ -1,13 +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. - -#include "ReplaceMeParallelRaceGroup.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeParallelRaceGroup::ReplaceMeParallelRaceGroup() { - // Add your commands here, e.g. - // AddCommands(FooCommand{}, BarCommand{}); -} diff --git a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h deleted file mode 100644 index a3f4227d517..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h +++ /dev/null @@ -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. - -#pragma once - -#include -#include - -class ReplaceMeParallelRaceGroup - : public frc2::CommandHelper { - public: - ReplaceMeParallelRaceGroup(); -}; diff --git a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp b/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp deleted file mode 100644 index 0bc1d7480b1..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp +++ /dev/null @@ -1,24 +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. - -#include "ReplaceMePIDCommand.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMePIDCommand::ReplaceMePIDCommand() - : CommandHelper{frc::PIDController{0, 0, 0}, - // This should return the measurement - [] { return 0; }, - // This should return the setpoint (can also be a constant) - [] { return 0; }, - // This uses the output - [](double output) { - // Use the output here - }} {} - -// Returns true when the command should end. -bool ReplaceMePIDCommand::IsFinished() { - return false; -} diff --git a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h b/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h deleted file mode 100644 index a78d2160d50..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h +++ /dev/null @@ -1,16 +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. - -#pragma once - -#include -#include - -class ReplaceMePIDCommand - : public frc2::CommandHelper { - public: - ReplaceMePIDCommand(); - - bool IsFinished() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp b/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp deleted file mode 100644 index fe289f62a45..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp +++ /dev/null @@ -1,18 +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. - -#include "ReplaceMePIDSubsystem2.h" - -ReplaceMePIDSubsystem2::ReplaceMePIDSubsystem2() - // The PIDController used by the subsystem - : PIDSubsystem{frc::PIDController{0, 0, 0}} {} - -void ReplaceMePIDSubsystem2::UseOutput(double output, double setpoint) { - // Use the output here -} - -double ReplaceMePIDSubsystem2::GetMeasurement() { - // Return the process variable measurement here - return 0; -} diff --git a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h b/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h deleted file mode 100644 index 0b450f4a834..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h +++ /dev/null @@ -1,17 +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. - -#pragma once - -#include - -class ReplaceMePIDSubsystem2 : public frc2::PIDSubsystem { - public: - ReplaceMePIDSubsystem2(); - - protected: - void UseOutput(double output, double setpoint) override; - - double GetMeasurement() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp b/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp deleted file mode 100644 index f3fd26af8b2..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp +++ /dev/null @@ -1,38 +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. - -#include "ReplaceMeProfiledPIDCommand.h" - -#include -#include - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeProfiledPIDCommand::ReplaceMeProfiledPIDCommand() - : CommandHelper{ - // The ProfiledPIDController that the command will use - frc::ProfiledPIDController{ - // The PID gains - 0, - 0, - 0, - // The motion profile constraints - {0_mps, 0_mps_sq}}, - // This should return the measurement - [] { return 0_m; }, - // This should return the goal state (can also be a constant) - [] { - return frc::TrapezoidProfile::State{0_m, 0_mps}; - }, - // This uses the output and current trajectory setpoint - [](double output, - frc::TrapezoidProfile::State setpoint) { - // Use the output and setpoint here - }} {} - -// Returns true when the command should end. -bool ReplaceMeProfiledPIDCommand::IsFinished() { - return false; -} diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h b/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h deleted file mode 100644 index 0bd45ac57ea..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h +++ /dev/null @@ -1,18 +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. - -#pragma once - -#include -#include -#include - -class ReplaceMeProfiledPIDCommand - : public frc2::CommandHelper, - ReplaceMeProfiledPIDCommand> { - public: - ReplaceMeProfiledPIDCommand(); - - bool IsFinished() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp b/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp deleted file mode 100644 index 2ee899c03c5..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp +++ /dev/null @@ -1,28 +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. - -#include "ReplaceMeProfiledPIDSubsystem.h" - -#include -#include - -ReplaceMeProfiledPIDSubsystem::ReplaceMeProfiledPIDSubsystem() - // The ProfiledPIDController used by the subsystem - : ProfiledPIDSubsystem{frc::ProfiledPIDController{ - // The PID gains - 0, - 0, - 0, - // The constraints for the motion profiles - {0_mps, 0_mps_sq}}} {} - -void ReplaceMeProfiledPIDSubsystem::UseOutput( - double output, frc::TrapezoidProfile::State setpoint) { - // Use the output and current trajectory setpoint here -} - -units::meter_t ReplaceMeProfiledPIDSubsystem::GetMeasurement() { - // Return the process variable measurement here - return 0_m; -} diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h b/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h deleted file mode 100644 index 8e86f3fff40..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h +++ /dev/null @@ -1,20 +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. - -#pragma once - -#include -#include - -class ReplaceMeProfiledPIDSubsystem - : public frc2::ProfiledPIDSubsystem { - public: - ReplaceMeProfiledPIDSubsystem(); - - protected: - void UseOutput(double output, - frc::TrapezoidProfile::State setpoint) override; - - units::meter_t GetMeasurement() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.cpp b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.cpp deleted file mode 100644 index cc2504c53c4..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.cpp +++ /dev/null @@ -1,13 +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. - -#include "ReplaceMeSequentialCommandGroup.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeSequentialCommandGroup::ReplaceMeSequentialCommandGroup() { - // Add your commands here, e.g. - // AddCommands(FooCommand{}, BarCommand{}); -} diff --git a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h deleted file mode 100644 index f9fe09e3a9a..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h +++ /dev/null @@ -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. - -#pragma once - -#include -#include - -class ReplaceMeSequentialCommandGroup - : public frc2::CommandHelper { - public: - ReplaceMeSequentialCommandGroup(); -}; diff --git a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp deleted file mode 100644 index 8d0ede06f38..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp +++ /dev/null @@ -1,10 +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. - -#include "ReplaceMeSubsystem2.h" - -ReplaceMeSubsystem2::ReplaceMeSubsystem2() = default; - -// This method will be called once per scheduler run -void ReplaceMeSubsystem2::Periodic() {} diff --git a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h deleted file mode 100644 index ca11456d432..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h +++ /dev/null @@ -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. - -#pragma once - -#include - -class ReplaceMeSubsystem2 : public frc2::SubsystemBase { - public: - ReplaceMeSubsystem2(); - - /** - * Will be called periodically whenever the CommandScheduler runs. - */ - void Periodic() override; - - private: - // Components (e.g. motor controllers and sensors) should generally be - // declared private and exposed only through public methods. -}; diff --git a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp b/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp deleted file mode 100644 index a3f458c04f0..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp +++ /dev/null @@ -1,20 +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. - -#include "ReplaceMeTrapezoidProfileSubsystem.h" - -#include -#include - -ReplaceMeTrapezoidProfileSubsystem::ReplaceMeTrapezoidProfileSubsystem() - : TrapezoidProfileSubsystem( - // The motion profile constraints - {5_mps, 5_mps_sq}, - // The initial position of the mechanism - 0_m) {} - -void ReplaceMeTrapezoidProfileSubsystem::UseState( - frc::TrapezoidProfile::State state) { - // Use the current profile state here -} diff --git a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h b/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h deleted file mode 100644 index 99b9410a86d..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h +++ /dev/null @@ -1,17 +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. - -#pragma once - -#include -#include - -class ReplaceMeTrapezoidProfileSubsystem - : frc2::TrapezoidProfileSubsystem { - public: - ReplaceMeTrapezoidProfileSubsystem(); - - protected: - void UseState(frc::TrapezoidProfile::State state) override; -}; diff --git a/wpilibjExamples/build.gradle b/wpilibjExamples/build.gradle index 115b2539650..ff1a966b762 100644 --- a/wpilibjExamples/build.gradle +++ b/wpilibjExamples/build.gradle @@ -70,8 +70,6 @@ ext { templateFile = new File("$projectDir/src/main/java/edu/wpi/first/wpilibj/templates/templates.json") exampleDirectory = new File("$projectDir/src/main/java/edu/wpi/first/wpilibj/examples/") exampleFile = new File("$projectDir/src/main/java/edu/wpi/first/wpilibj/examples/examples.json") - commandDirectory = new File("$projectDir/src/main/java/edu/wpi/first/wpilibj/commands/") - commandFile = new File("$projectDir/src/main/java/edu/wpi/first/wpilibj/commands/commands.json") } apply plugin: 'cpp' diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java deleted file mode 100644 index 2d90dc27faf..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java +++ /dev/null @@ -1,32 +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.command2; - -import edu.wpi.first.wpilibj2.command.Command; - -public class ReplaceMeCommand extends Command { - /** Creates a new ReplaceMeCommand. */ - public ReplaceMeCommand() { - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() {} - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() {} - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) {} - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json deleted file mode 100644 index 5631c5bf3eb..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "name": "Empty Class", - "description": "Create an empty class", - "tags": [ - "class" - ], - "foldername": "emptyclass", - "replacename": "ReplaceMeEmptyClass", - "commandversion": 0 - }, - { - "name": "Command", - "description": "A command.", - "tags": [ - "command" - ], - "foldername": "command2", - "replacename": "ReplaceMeCommand", - "commandversion": 2 - }, - { - "name": "InstantCommand", - "description": "A command that finishes instantly.", - "tags": [ - "instantcommand" - ], - "foldername": "instantcommand", - "replacename": "ReplaceMeInstantCommand", - "commandversion": 2 - }, - { - "name": "ParallelCommandGroup", - "description": "A command group that runs commands in parallel, ending when all commands have finished.", - "tags": [ - "parallelcommandgroup" - ], - "foldername": "parallelcommandgroup", - "replacename": "ReplaceMeParallelCommandGroup", - "commandversion": 2 - }, - { - "name": "ParallelDeadlineGroup", - "description": "A command group that runs commands in parallel, ending when a specific command has finished.", - "tags": [ - "paralleldeadlinegroup" - ], - "foldername": "paralleldeadlinegroup", - "replacename": "ReplaceMeParallelDeadlineGroup", - "commandversion": 2 - }, - { - "name": "ParallelRaceGroup", - "description": "A command that runs commands in parallel, ending as soon as any command has finished.", - "tags": [ - "parallelracegroup" - ], - "foldername": "parallelracegroup", - "replacename": "ReplaceMeParallelRaceGroup", - "commandversion": 2 - }, - { - "name": "PIDCommand", - "description": "A command that runs a PIDController.", - "tags": [ - "pidcommand" - ], - "foldername": "pidcommand", - "replacename": "ReplaceMePIDCommand", - "commandversion": 2 - }, - { - "name": "PIDSubsystem", - "description": "A subsystem that runs a PIDController.", - "tags": [ - "pidsubsystem" - ], - "foldername": "pidsubsystem2", - "replacename": "ReplaceMePIDSubsystem", - "commandversion": 2 - }, - { - "name": "ProfiledPIDCommand", - "description": "A command that runs a ProfiledPIDController.", - "tags": [ - "profiledpidcommand" - ], - "foldername": "profiledpidcommand", - "replacename": "ReplaceMeProfiledPIDCommand", - "commandversion": 2 - }, - { - "name": "ProfiledPIDSubsystem", - "description": "A subsystem that runs a ProfiledPIDController.", - "tags": [ - "profiledpidsubsystem" - ], - "foldername": "profiledpidsubsystem", - "replacename": "ReplaceMeProfiledPIDSubsystem", - "commandversion": 2 - }, - { - "name": "SequentialCommandGroup", - "description": "A command group that runs commands in sequence.", - "tags": [ - "sequentialcommandgroup" - ], - "foldername": "sequentialcommandgroup", - "replacename": "ReplaceMeSequentialCommandGroup", - "commandversion": 2 - }, - { - "name": "Subsystem", - "description": "A robot subsystem.", - "tags": [ - "subsystem" - ], - "foldername": "subsystem2", - "replacename": "ReplaceMeSubsystem", - "commandversion": 2 - }, - { - "name": "TrapezoidProfileSubsystem", - "description": "A subsystem that executes a trapezoidal motion profile.", - "tags": [ - "trapezoidprofilesubsystem" - ], - "foldername": "trapezoidprofilesubsystem", - "replacename": "ReplaceMeTrapezoidProfileSubsystem", - "commandversion": 2 - } -] diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/emptyclass/ReplaceMeEmptyClass.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/emptyclass/ReplaceMeEmptyClass.java deleted file mode 100644 index 2e8a5fff9ca..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/emptyclass/ReplaceMeEmptyClass.java +++ /dev/null @@ -1,8 +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.emptyclass; - -/** Add your docs here. */ -public class ReplaceMeEmptyClass {} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/instantcommand/ReplaceMeInstantCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/instantcommand/ReplaceMeInstantCommand.java deleted file mode 100644 index fe7fe9bb440..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/instantcommand/ReplaceMeInstantCommand.java +++ /dev/null @@ -1,20 +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.instantcommand; - -import edu.wpi.first.wpilibj2.command.InstantCommand; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeInstantCommand extends InstantCommand { - public ReplaceMeInstantCommand() { - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() {} -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.java deleted file mode 100644 index ab4d0cc1830..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.java +++ /dev/null @@ -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.parallelcommandgroup; - -import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeParallelCommandGroup extends ParallelCommandGroup { - /** Creates a new ReplaceMeParallelCommandGroup. */ - public ReplaceMeParallelCommandGroup() { - // Add your commands in the addCommands() call, e.g. - // addCommands(new FooCommand(), new BarCommand()); - addCommands(); - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.java deleted file mode 100644 index 95c902dab86..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.java +++ /dev/null @@ -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.paralleldeadlinegroup; - -import edu.wpi.first.wpilibj2.command.InstantCommand; -import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeParallelDeadlineGroup extends ParallelDeadlineGroup { - /** Creates a new ReplaceMeParallelDeadlineGroup. */ - public ReplaceMeParallelDeadlineGroup() { - // Add the deadline command in the super() call. Add other commands using - // addCommands(). - super(new InstantCommand()); - // addCommands(new FooCommand(), new BarCommand()); - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelracegroup/ReplaceMeParallelRaceGroup.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelracegroup/ReplaceMeParallelRaceGroup.java deleted file mode 100644 index 3de0c7f654b..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/parallelracegroup/ReplaceMeParallelRaceGroup.java +++ /dev/null @@ -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.parallelracegroup; - -import edu.wpi.first.wpilibj2.command.ParallelRaceGroup; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeParallelRaceGroup extends ParallelRaceGroup { - /** Creates a new ReplaceMeParallelRaceGroup. */ - public ReplaceMeParallelRaceGroup() { - // Add your commands in the addCommands() call, e.g. - // addCommands(new FooCommand(), new BarCommand()); - addCommands(); - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java deleted file mode 100644 index ff39b12674a..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java +++ /dev/null @@ -1,36 +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.pidcommand; - -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.wpilibj2.command.PIDCommand; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMePIDCommand extends PIDCommand { - /** Creates a new ReplaceMePIDCommand. */ - public ReplaceMePIDCommand() { - super( - // The controller that the command will use - new PIDController(0, 0, 0), - // This should return the measurement - () -> 0, - // This should return the setpoint (can also be a constant) - () -> 0, - // This uses the output - output -> { - // Use the output here - }); - // Use addRequirements() here to declare subsystem dependencies. - // Configure additional PID options by calling `getController` here. - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java deleted file mode 100644 index 0876d94a11a..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java +++ /dev/null @@ -1,28 +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.pidsubsystem2; - -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.wpilibj2.command.PIDSubsystem; - -public class ReplaceMePIDSubsystem extends PIDSubsystem { - /** Creates a new ReplaceMePIDSubsystem. */ - public ReplaceMePIDSubsystem() { - super( - // The PIDController used by the subsystem - new PIDController(0, 0, 0)); - } - - @Override - public void useOutput(double output, double setpoint) { - // Use the output here - } - - @Override - public double getMeasurement() { - // Return the process variable measurement here - return 0; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java deleted file mode 100644 index f3d44102db5..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java +++ /dev/null @@ -1,43 +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.profiledpidcommand; - -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.ProfiledPIDCommand; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeProfiledPIDCommand extends ProfiledPIDCommand { - /** Creates a new ReplaceMeProfiledPIDCommand. */ - public ReplaceMeProfiledPIDCommand() { - super( - // The ProfiledPIDController used by the command - new ProfiledPIDController( - // The PID gains - 0, - 0, - 0, - // The motion profile constraints - new TrapezoidProfile.Constraints(0, 0)), - // This should return the measurement - () -> 0, - // This should return the goal (can also be a constant) - () -> new TrapezoidProfile.State(), - // This uses the output - (output, setpoint) -> { - // Use the output (and setpoint, if desired) here - }); - // Use addRequirements() here to declare subsystem dependencies. - // Configure additional PID options by calling `getController` here. - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java deleted file mode 100644 index 60eda3508cd..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java +++ /dev/null @@ -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.profiledpidsubsystem; - -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.ProfiledPIDSubsystem; - -public class ReplaceMeProfiledPIDSubsystem extends ProfiledPIDSubsystem { - /** Creates a new ReplaceMeProfiledPIDSubsystem. */ - public ReplaceMeProfiledPIDSubsystem() { - super( - // The ProfiledPIDController used by the subsystem - new ProfiledPIDController( - 0, - 0, - 0, - // The motion profile constraints - new TrapezoidProfile.Constraints(0, 0))); - } - - @Override - public void useOutput(double output, TrapezoidProfile.State setpoint) { - // Use the output (and optionally the setpoint) here - } - - @Override - public double getMeasurement() { - // Return the process variable measurement here - return 0; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.java deleted file mode 100644 index ca4488b5ed6..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.java +++ /dev/null @@ -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.sequentialcommandgroup; - -import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeSequentialCommandGroup extends SequentialCommandGroup { - /** Creates a new ReplaceMeSequentialCommandGroup. */ - public ReplaceMeSequentialCommandGroup() { - // Add your commands in the addCommands() call, e.g. - // addCommands(new FooCommand(), new BarCommand()); - addCommands(); - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/subsystem2/ReplaceMeSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/subsystem2/ReplaceMeSubsystem.java deleted file mode 100644 index f72539d7129..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/subsystem2/ReplaceMeSubsystem.java +++ /dev/null @@ -1,17 +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.subsystem2; - -import edu.wpi.first.wpilibj2.command.SubsystemBase; - -public class ReplaceMeSubsystem extends SubsystemBase { - /** Creates a new ReplaceMeSubsystem. */ - public ReplaceMeSubsystem() {} - - @Override - public void periodic() { - // This method will be called once per scheduler run - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java deleted file mode 100644 index e95f95792fc..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java +++ /dev/null @@ -1,24 +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.trapezoidprofilesubsystem; - -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.TrapezoidProfileSubsystem; - -public class ReplaceMeTrapezoidProfileSubsystem extends TrapezoidProfileSubsystem { - /** Creates a new ReplaceMeTrapezoidProfileSubsystem. */ - public ReplaceMeTrapezoidProfileSubsystem() { - super( - // The constraints for the generated profiles - new TrapezoidProfile.Constraints(0, 0), - // The initial position of the mechanism - 0); - } - - @Override - protected void useState(TrapezoidProfile.State state) { - // Use the computed profile state here. - } -}