+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..15964d2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,67 @@
+# Spartronics 4915's Robot Template
+
+## Setup
+
+This repository is marked as a "Template" on Github, which allows you to create a new codebase from the latest snapshot of this code.
+Use it to create a new repository under the Spartronics4915 organization titled `XXXX-GameName`, where `XXXX` is the current year.
+Whether the repository is public (visible to other teams) or private (only visible to members of the Spartronics4915 organization) is up to you, but in the spirit of Coopertition, it should be made public at the end of the season regardless.
+
+After creating the new season's codebase, the following four changes must be made:
+
+- Update the current year in `wpilib_preferences.json`.
+- Update the current year in `settings.gradle`.
+- Refactor the `frc` folder into `frcXXXX`, where `XXXX` is the current year.
+- Change `ROBOT_MAIN_CLASS` in `build.gradle` to point to the new `Main` class: `com.spartronics4915.frcXXXX.Main`.
+
+Additionally, the following steps are advised:
+
+- Copy the contents of `SpartronicsLib` into the new codebase to facilitate [simultaneous development](https://github.com/Spartronics4915/SpartronicsLib#for-spartronics).
+ - This will override the Jitpack setup, so no need to do anything there.
+- Update vendor dependencies (the WPILib extension provides an option for this).
+- Remove this "Setup" section from the README.
+
+The `ExampleSubsystem` and `ExampleCommand` classes are non-functional and can
+be left in as a reference or taken out at your discretion.
+
+## Usage
+
+### Prerequisites
+
+Ensure you have Java 11 installed on your computer and added to `$PATH`.
+Visual Studio Code, Git, and the WPILib extension are also helpful for development.
+
+The (highly) recommended way to install these is through [the WPILib installer](https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html
+).
+
+### Installation
+
+Once your development environment is set up, `clone` this repository to your computer.
+
+Run `./gradlew tasks` to list available Gradle options.
+
+Run `./gradlew build` or use the WPILib extension's `Build Robot Code` option to build or compile the codebase.
+
+Run `./gradlew deploy` or use the WPILib extension's `Deploy Robot Code` option while connected to the robot to build and deploy your code.
+
+## Style Guide
+
+- **Indentation**: Four spaces, no tabs.
+- **Braces**: Each brace goes on its own line.
+ - This is verbose, but intentionally so - brace errors are common,
+ often difficult-to-diagnose, and have caused problems at bad times in the past.
+- Line length: Eighty characters or less, as a rule of thumb.
+ - This improves legibility and makes it easier to view files side-by-side.
+ - The formatter doesn't actually enforce this until lines are 120 characters,
+ to give you flexibility around how you'd like to wrap your lines.
+- Variable names: `camelCase`.
+ - **Member variables**: Prefix with `m`, ex. `mMemberVariable`.
+ - **Final constants**: Prefix with `k`, ex. `kFinalConstant`.
+ - Parameters: No prefix.
+- Class and file names: `PascalCase`.
+- Folder names: `lowercase`.
+- **Package structure**: `com.spartronics4915.frcXXXX`
+
+(differences from WPILib are in **bold**)
+
+A relatively unopinionated Eclipse-style formatter is included in the `.settings` folder.
+This can be run at any time by opening Visual Studio Code's Command Palette (`Ctrl+Shift+P`) and selecting `Format Document`.
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..33f6063
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,86 @@
+plugins {
+ id "java"
+ id "edu.wpi.first.GradleRIO" version "2021.2.2"
+}
+
+sourceCompatibility = JavaVersion.VERSION_11
+targetCompatibility = JavaVersion.VERSION_11
+
+def ROBOT_MAIN_CLASS = "com.spartronics4915.frc.Main"
+
+// Define my targets (RoboRIO) and artifacts (deployable files)
+// This is added by GradleRIO's backing project EmbeddedTools.
+deploy {
+ targets {
+ roboRIO("roborio") {
+ // Team number is loaded either from the .wpilib/wpilib_preferences.json
+ // or from command line. If not found an exception will be thrown.
+ // You can use getTeamOrDefault(team) instead of getTeamNumber if you
+ // want to store a team number in this file.
+ team = frc.getTeamNumber()
+ }
+ }
+ artifacts {
+ frcJavaArtifact('frcJava') {
+ targets << "roborio"
+ // Debug can be overridden by command line, for use with VSCode
+ debug = frc.getDebugOrDefault(false)
+ }
+ // Built in artifact to deploy arbitrary files to the roboRIO.
+ fileTreeArtifact('frcStaticFileDeploy') {
+ // The directory below is the local directory to deploy
+ files = fileTree(dir: 'src/main/deploy')
+ // Deploy to RoboRIO target, into /home/lvuser/deploy
+ targets << "roborio"
+ directory = '/home/lvuser/deploy'
+ }
+ }
+}
+
+// Set this to true to enable desktop support.
+def includeDesktopSupport = true
+
+// Tell Gradle to check JitPack (in this case, for SpartronicsLib)
+repositories {
+ maven { url 'https://jitpack.io' }
+}
+
+// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
+// Also defines JUnit 4.
+dependencies {
+ implementation wpi.deps.wpilib()
+ nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
+ nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)
+
+ implementation wpi.deps.vendor.java()
+ nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
+ nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
+
+ // This is how we can use SpartronicsLib without including it in the codebase
+ implementation "com.github.Spartronics4915:SpartronicsLib:master-SNAPSHOT"
+
+ testImplementation 'junit:junit:4.12'
+
+ // Enable simulation gui support. Must check the box in vscode to enable support
+ // upon debugging
+ simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)
+ simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, false)
+
+ // Websocket extensions require additional configuration.
+ // simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, false)
+ // simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, false)
+}
+
+// Simulation configuration (e.g. environment variables).
+sim {
+ // Sets the websocket client remote host.
+ // envVar "HALSIMWS_HOST", "10.0.0.2"
+}
+
+// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
+// in order to make them all available at runtime. Also adding the manifest so WPILib
+// knows where to look for our Robot Class.
+jar {
+ from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
+ manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..cc4fdc2
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..a2c6fac
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=permwrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=permwrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..2fe81a7
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..24467a1
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,100 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..4ee6ec2
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,27 @@
+import org.gradle.internal.os.OperatingSystem
+
+pluginManagement {
+ repositories {
+ mavenLocal()
+ gradlePluginPortal()
+ String frcYear = '2021'
+ File frcHome
+ if (OperatingSystem.current().isWindows()) {
+ String publicFolder = System.getenv('PUBLIC')
+ if (publicFolder == null) {
+ publicFolder = "C:\\Users\\Public"
+ }
+ def homeRoot = new File(publicFolder, "wpilib")
+ frcHome = new File(homeRoot, frcYear)
+ } else {
+ def userFolder = System.getProperty("user.home")
+ def homeRoot = new File(userFolder, "wpilib")
+ frcHome = new File(homeRoot, frcYear)
+ }
+ def frcHomeMaven = new File(frcHome, 'maven')
+ maven {
+ name 'frcHome'
+ url frcHomeMaven
+ }
+ }
+}
diff --git a/src/main/java/com/spartronics4915/frc/Constants.java b/src/main/java/com/spartronics4915/frc/Constants.java
new file mode 100644
index 0000000..47ef4fb
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/Constants.java
@@ -0,0 +1,15 @@
+package com.spartronics4915.frc;
+
+/**
+ * The Constants class provides a convenient place for teams to hold robot-wide
+ * numerical or boolean constants. This class should not be used for any other
+ * purpose. All constants should be declared globally (i.e. public static).
+ * Do not put anything functional in this class.
+ *
+ * It is advised to statically import this class (or one of its inner classes)
+ * wherever the constants are needed, to reduce verbosity.
+ */
+public final class Constants
+{
+
+}
diff --git a/src/main/java/com/spartronics4915/frc/Main.java b/src/main/java/com/spartronics4915/frc/Main.java
new file mode 100644
index 0000000..e99fa35
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/Main.java
@@ -0,0 +1,23 @@
+package com.spartronics4915.frc;
+
+import edu.wpi.first.wpilibj.RobotBase;
+
+/**
+ * Do NOT add any static variables to this class, or any initialization at all.
+ * Unless you know what you are doing, do not modify this file except to change
+ * the parameter class to the startRobot call.
+ */
+public final class Main
+{
+ private Main() {}
+
+ /**
+ * Main initialization function. Do not perform any initialization here.
+ *
+ * If you change your main robot class, change the parameter type.
+ */
+ public static void main(String... args)
+ {
+ RobotBase.startRobot(Robot::new);
+ }
+}
diff --git a/src/main/java/com/spartronics4915/frc/Robot.java b/src/main/java/com/spartronics4915/frc/Robot.java
new file mode 100644
index 0000000..dfdaeaf
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/Robot.java
@@ -0,0 +1,95 @@
+package com.spartronics4915.frc;
+
+import edu.wpi.first.wpilibj.TimedRobot;
+import edu.wpi.first.wpilibj2.command.Command;
+import edu.wpi.first.wpilibj2.command.CommandScheduler;
+
+public class Robot extends TimedRobot
+{
+ private Command mAutonomousCommand;
+ private RobotContainer mRobotContainer;
+
+ /**
+ * This function is run when the robot is first started up and should be
+ * used for any initialization code.
+ */
+ @Override
+ public void robotInit()
+ {
+ // Instantiate our RobotContainer. This will perform all our button
+ // bindings, and put our autonomous chooser on the dashboard.
+ mRobotContainer = new RobotContainer();
+ }
+
+ /**
+ * This function is called every robot packet, no matter the mode.
+ * Use this for items like diagnostics that you want ran during disabled,
+ * autonomous, teleoperated and test.
+ *
+ * This runs after the mode specific periodic functions,
+ * but before LiveWindow and SmartDashboard integrated updating.
+ */
+ @Override
+ public void robotPeriodic()
+ {
+ // Runs the Scheduler. This is responsible for polling buttons,
+ // adding newly-scheduled commands, running already-scheduled commands,
+ // removing finished or interrupted commands, and running subsystem
+ // periodic() methods.
+ // This must be called from the robot's periodic block in order for
+ // anything in the command-based framework to work.
+ CommandScheduler.getInstance().run();
+ }
+
+ /** This function is called once each time the robot enters disabled mode. */
+ @Override
+ public void disabledInit() {}
+
+ /** This function is called periodically while the robot is in disabled mode. */
+ @Override
+ public void disabledPeriodic() {}
+
+ /** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */
+ @Override
+ public void autonomousInit()
+ {
+ mAutonomousCommand = mRobotContainer.getAutonomousCommand();
+
+ if (mAutonomousCommand != null)
+ {
+ mAutonomousCommand.schedule();
+ }
+ }
+
+ /** This function is called periodically during autonomous. */
+ @Override
+ public void autonomousPeriodic() {}
+
+ @Override
+ public void teleopInit()
+ {
+ // This makes sure that the autonomous stops running when
+ // teleop starts running. If you want the autonomous to
+ // continue until interrupted by another command, remove
+ // this line or comment it out.
+ if (mAutonomousCommand != null) {
+ mAutonomousCommand.cancel();
+ }
+ }
+
+ /** This function is called periodically during operator control. */
+ @Override
+ public void teleopPeriodic() {}
+
+ /** This function is called once each time the robot enters test mode. */
+ @Override
+ public void testInit()
+ {
+ // Cancels all running commands at the start of test mode.
+ CommandScheduler.getInstance().cancelAll();
+ }
+
+ /** This function is called periodically during test mode. */
+ @Override
+ public void testPeriodic() {}
+}
diff --git a/src/main/java/com/spartronics4915/frc/RobotContainer.java b/src/main/java/com/spartronics4915/frc/RobotContainer.java
new file mode 100644
index 0000000..0e0ddac
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/RobotContainer.java
@@ -0,0 +1,45 @@
+package com.spartronics4915.frc;
+
+import com.spartronics4915.frc.commands.ExampleCommand;
+import com.spartronics4915.frc.subsystems.ExampleSubsystem;
+
+import edu.wpi.first.wpilibj.GenericHID;
+import edu.wpi.first.wpilibj.XboxController;
+import edu.wpi.first.wpilibj2.command.Command;
+
+/**
+ * This class is where the bulk of the robot should be declared.
+ * Since command-based is a "declarative" paradigm, very little robot logic
+ * should actually be handled in the {@link Robot} periodic methods
+ * (other than the scheduler calls). Instead, the structure of the robot
+ * (including subsystems, commands, and button mappings) should be declared here.
+ */
+public class RobotContainer
+{
+ // The robot's subsystems and commands are defined here...
+ public final ExampleSubsystem mExampleSubsystem;
+ public final ExampleCommand mAutoCommand;
+
+ /** The container for the robot. Contains subsystems, OI devices, and commands. */
+ public RobotContainer()
+ {
+ // ...and constructed here.
+ mExampleSubsystem = new ExampleSubsystem();
+ mAutoCommand = new ExampleCommand(mExampleSubsystem);
+
+ configureButtonBindings();
+ }
+
+ /** Use this method to define your button ==> command mappings. */
+ private void configureButtonBindings() {}
+
+ /**
+ * Use this to pass the autonomous command to the main {@link Robot} class.
+ *
+ * @return the command to run in autonomous
+ */
+ public Command getAutonomousCommand()
+ {
+ return mAutoCommand;
+ }
+}
diff --git a/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java b/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java
new file mode 100644
index 0000000..87c6525
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java
@@ -0,0 +1,43 @@
+package com.spartronics4915.frc.commands;
+
+import com.spartronics4915.frc.subsystems.ExampleSubsystem;
+
+import edu.wpi.first.wpilibj2.command.CommandBase;
+
+/**
+ * Detailed description of ExampleCommand.
+ */
+public class ExampleCommand extends CommandBase
+{
+ private final ExampleSubsystem mExampleSubsystem;
+
+ /**
+ * Creates a new ExampleCommand.
+ *
+ * @param subsystem The subsystem used by this command.
+ */
+ public ExampleCommand(ExampleSubsystem subsystem)
+ {
+ mExampleSubsystem = subsystem;
+ addRequirements(mExampleSubsystem); // Declares 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() {}
+
+ // Returns true when the command should end.
+ @Override
+ public boolean isFinished()
+ {
+ return false;
+ }
+
+ // Called once the command ends or is interrupted.
+ @Override
+ public void end(boolean interrupted) {}
+}
diff --git a/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java
new file mode 100644
index 0000000..a96649e
--- /dev/null
+++ b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java
@@ -0,0 +1,37 @@
+package com.spartronics4915.frc.subsystems;
+
+import com.spartronics4915.lib.subsystems.SpartronicsSubsystem;
+
+/**
+ * Detailed description of ExampleSubsystem.
+ */
+public class ExampleSubsystem extends SpartronicsSubsystem
+{
+ // The subsystem's hardware is defined here...
+
+ /** Creates a new ExampleSubsystem. */
+ public ExampleSubsystem()
+ {
+ boolean success = true;
+ try
+ {
+ // ...and constructed here.
+ }
+ catch (Exception exception)
+ {
+ logException("Could not construct hardware: ", exception);
+ success = false;
+ }
+ logInitialized(success);
+ }
+
+ // Subsystem methods - actions the robot can take - should be placed here.
+
+ /** This method will be called once per scheduler run. */
+ @Override
+ public void periodic() {}
+
+ /** This method will be called once per scheduler run during simulation. */
+ @Override
+ public void simulationPeriodic() {}
+}
diff --git a/vendordeps/Phoenix.json b/vendordeps/Phoenix.json
new file mode 100644
index 0000000..880c056
--- /dev/null
+++ b/vendordeps/Phoenix.json
@@ -0,0 +1,214 @@
+{
+ "fileName": "Phoenix.json",
+ "name": "CTRE-Phoenix",
+ "version": "5.19.4",
+ "uuid": "ab676553-b602-441f-a38d-f1296eff6537",
+ "mavenUrls": [
+ "https://devsite.ctr-electronics.com/maven/release/"
+ ],
+ "jsonUrl": "https://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json",
+ "javaDependencies": [
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "api-java",
+ "version": "5.19.4"
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "wpiapi-java",
+ "version": "5.19.4"
+ }
+ ],
+ "jniDependencies": [
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "cci",
+ "version": "5.19.4",
+ "isJar": false,
+ "skipInvalidPlatforms": true,
+ "validPlatforms": [
+ "linuxathena"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "cci-sim",
+ "version": "5.19.4",
+ "isJar": false,
+ "skipInvalidPlatforms": true,
+ "validPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "simTalonSRX",
+ "version": "5.19.4",
+ "isJar": false,
+ "skipInvalidPlatforms": true,
+ "validPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "simVictorSPX",
+ "version": "5.19.4",
+ "isJar": false,
+ "skipInvalidPlatforms": true,
+ "validPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ }
+ ],
+ "cppDependencies": [
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "wpiapi-cpp",
+ "version": "5.19.4",
+ "libName": "CTRE_Phoenix_WPI",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena",
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "api-cpp",
+ "version": "5.19.4",
+ "libName": "CTRE_Phoenix",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena",
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "cci",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixCCI",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "cci-sim",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixCCISim",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "diagnostics",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixDiagnostics",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena",
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "canutils",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixCanutils",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "platform-sim",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixPlatform",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix",
+ "artifactId": "core",
+ "version": "5.19.4",
+ "libName": "CTRE_PhoenixCore",
+ "headerClassifier": "headers",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena",
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "simTalonSRX",
+ "version": "5.19.4",
+ "libName": "CTRE_SimTalonSRX",
+ "headerClassifier": "headers",
+ "sharedLibrary": true,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ },
+ {
+ "groupId": "com.ctre.phoenix.sim",
+ "artifactId": "simVictorSPX",
+ "version": "5.19.4",
+ "libName": "CTRE_SimVictorSPX",
+ "headerClassifier": "headers",
+ "sharedLibrary": true,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ }
+ ]
+}
diff --git a/vendordeps/REVRobotics.json b/vendordeps/REVRobotics.json
new file mode 100644
index 0000000..9164b8e
--- /dev/null
+++ b/vendordeps/REVRobotics.json
@@ -0,0 +1,73 @@
+{
+ "cppDependencies": [
+ {
+ "artifactId": "SparkMax-cpp",
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "windowsx86",
+ "linuxaarch64bionic",
+ "linuxx86-64",
+ "linuxathena",
+ "linuxraspbian",
+ "osxx86-64"
+ ],
+ "groupId": "com.revrobotics.frc",
+ "headerClassifier": "headers",
+ "libName": "SparkMax",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "version": "1.5.4"
+ },
+ {
+ "artifactId": "SparkMax-driver",
+ "binaryPlatforms": [
+ "windowsx86-64",
+ "windowsx86",
+ "linuxaarch64bionic",
+ "linuxx86-64",
+ "linuxathena",
+ "linuxraspbian",
+ "osxx86-64"
+ ],
+ "groupId": "com.revrobotics.frc",
+ "headerClassifier": "headers",
+ "libName": "SparkMaxDriver",
+ "sharedLibrary": false,
+ "skipInvalidPlatforms": true,
+ "version": "1.5.4"
+ }
+ ],
+ "fileName": "REVRobotics.json",
+ "javaDependencies": [
+ {
+ "artifactId": "SparkMax-java",
+ "groupId": "com.revrobotics.frc",
+ "version": "1.5.4"
+ }
+ ],
+ "jniDependencies": [
+ {
+ "artifactId": "SparkMax-driver",
+ "groupId": "com.revrobotics.frc",
+ "isJar": false,
+ "skipInvalidPlatforms": true,
+ "validPlatforms": [
+ "windowsx86-64",
+ "windowsx86",
+ "linuxaarch64bionic",
+ "linuxx86-64",
+ "linuxathena",
+ "linuxraspbian",
+ "osxx86-64"
+ ],
+ "version": "1.5.4"
+ }
+ ],
+ "jsonUrl": "http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json",
+ "mavenUrls": [
+ "http://www.revrobotics.com/content/sw/max/sdk/maven/"
+ ],
+ "name": "REVRobotics",
+ "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
+ "version": "1.5.4"
+}
diff --git a/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json
new file mode 100644
index 0000000..2ac5f35
--- /dev/null
+++ b/vendordeps/WPILibNewCommands.json
@@ -0,0 +1,37 @@
+{
+ "fileName": "WPILibNewCommands.json",
+ "name": "WPILib-New-Commands",
+ "version": "2020.0.0",
+ "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266",
+ "mavenUrls": [],
+ "jsonUrl": "",
+ "javaDependencies": [
+ {
+ "groupId": "edu.wpi.first.wpilibNewCommands",
+ "artifactId": "wpilibNewCommands-java",
+ "version": "wpilib"
+ }
+ ],
+ "jniDependencies": [],
+ "cppDependencies": [
+ {
+ "groupId": "edu.wpi.first.wpilibNewCommands",
+ "artifactId": "wpilibNewCommands-cpp",
+ "version": "wpilib",
+ "libName": "wpilibNewCommands",
+ "headerClassifier": "headers",
+ "sourcesClassifier": "sources",
+ "sharedLibrary": true,
+ "skipInvalidPlatforms": true,
+ "binaryPlatforms": [
+ "linuxathena",
+ "linuxraspbian",
+ "linuxaarch64bionic",
+ "windowsx86-64",
+ "windowsx86",
+ "linuxx86-64",
+ "osxx86-64"
+ ]
+ }
+ ]
+}