diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 28a230a..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a bug report for something -title: "[Bug]: Describe the bug here" -labels: bug -assignees: '' - ---- - -**Describe the bug** -Describe what the issue is and any steps you may have tried to fix it (Like making sure you are using the right version, etc.) - -Please make sure to include the application that is failing or not working correctly like if it's a problem in Driver Station or if it's an issue with the code itself not doing what you would expect or not building (If using Java / C++. This would also be included in the Versions sections) - -**Steps To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '...' -3. Scroll down to '...' -4. See error - -**Expected Behavior** -What should have happened? - -**Screenshots or Videos** -If applicable, add screenshots and / or videos to help explain your problem - -**Versions (if applicable):** -> If using Python, please list off what version of robotpy you are using along with the version of Python - -- OS: [e.g. Arch Linux] -- Version [e.g. 6.4.12] -- Architecture [e.g x86_64] -- Java, C++ or Python Version [e.g. Python 3.11, Java 20.0.2] -- WPILib Version [e.g. 2023.4.3] - -**Additional context** -Add any other context about the problem down here. diff --git a/.github/linters/actionlint.yml b/.github/linters/actionlint.yml deleted file mode 100644 index fab3ac3..0000000 --- a/.github/linters/actionlint.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -self-hosted-runner: - labels: - - Primary - - Backup \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..b25a586 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,56 @@ +# Gradle workflow to build the current project and generate a dependency graph for Dependabot Alerts. + +name: Gradle Dependencies and Build + +on: + push: + branches: [ "repo-rework" ] # Change to "main" when merged + pull_request: + branches: [ "repo-rework" ] # Change to "main" when merged + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + # Set up Java 17 JDK since the WPILib provided one isn't installed on this runner + # This will most likely change for a self-hosted runner + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + # Set up Java 17 JDK since the WPILib provided one isn't installed on this runner + # This will most likely change for a self-hosted runner + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..c577fe9 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,37 @@ +# Workflow to lint and format code using super-linter +# +# https://github.com/github/super-linter +--- +name: Linting and Formatting + +on: + push: + branches: ["repo-rework"] # Change to "main" when merged + pull_request: + branches: ["repo-rework"] # Change to "main" when merged + +jobs: + super-linter: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within + # `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + # Update the environment here + env: + # Update to false whenever all previous files have been linted successfully so we + # aren't checking the whole codebase each time + VALIDATE_ALL_CODEBASE: true + # Add files or folders to exclude here + FILTER_REGEX_EXCLUDE: ".*vendordeps/.*|.*gradlew|.*.gradle|.*WPILib-License.md.*" + DEFAULT_BRANCH: "main" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml deleted file mode 100644 index a20e4e9..0000000 --- a/.github/workflows/superlinter.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Super-Linter - -on: push - -jobs: - super-lint: - name: Super-Linter - runs-on: - - self-hosted - - Primary - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run Super-Linter - uses: github/super-linter@v5 - env: - # Testing multiple folders and files - # Files to ignore: - # - gradlew - # - .gradle - # - WPILib-License.md - # Folders to ignore: - # - 2022-2023 - # - vendordeps - FILTER_REGEX_EXCLUDE: ".*2022-2023/.*|.*vendordeps/.*|.*gradlew|.*.gradle|.*WPILib-License.md.*" - DEFAULT_BRANCH: main - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/wpilib-build.yml b/.github/workflows/wpilib-build.yml deleted file mode 100644 index c866985..0000000 --- a/.github/workflows/wpilib-build.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Build - -on: push - -jobs: - Build-Latest: - runs-on: - - self-hosted - - Primary - steps: - # Check out the code so the action can use it - - name: Checkout code - uses: actions/checkout@v4 - - - name: Build 2023-2024 - # Set the working directory so gradlew and WPILib are in the right folder - working-directory: ./2023-2024/main-bot - # Run gradlew to build the robot code with java home being what it is set to during manual runtime - # This machine should have Java 17 installed which is what WPILib is using for building with 2024 - run: ./gradlew build - Build-2022-2023: - runs-on: - - self-hosted - - Primary - steps: - # Check out the code so the action can use it - - name: Checkout code - uses: actions/checkout@v4 - - - name: Build 2022-2023 - working-directory: ./2022-2023/main-bot - run: ./gradlew build - - -# I have no idea if this will work but this is just to test to see if it's possible and to get used to using actions diff --git a/.gitignore b/.gitignore index 4835bef..ceb43c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,156 +1,195 @@ -# .gitignore -# Ingore File For Git - -# -----=====[ IDEs ]=====----- # - -# VSCode -.vscode/ - -# Sublime Text -.sublime-workspace -.sublime-project - -# PyCharm -.idea/ -*.iml -*.ipr -*.iws - -# -----=====[ Python ]=====----- # - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# -----=====[ Misc ]=====----- # - -# MacOS Finder Cache -# >:( -*.DS_Store - +# This gitignore has been specially created by the WPILib team. +# If you remove items from this file, intellisense might break. + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +# # VSCode Specific Java Settings +# DO NOT REMOVE .classpath and .project +.classpath +.project +.settings/ +bin/ + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ +out/ + +# Fleet +.fleet + +# Simulation GUI and other tools window save file +networktables.json +simgui.json +*-window.json + +# Simulation data log directory +logs/ + +# Folder that has CTRE Phoenix Sim device config storage +ctre_sim/ + +# clangd +/.cache +compile_commands.json + +# VSCode settings +.vscode/ + +# MacOS specific files +.DS_Store + +# Windows specific files +Thumbs.db +Desktop.ini +System Volume Information/ \ No newline at end of file diff --git a/2022-2023/main-bot/.wpilib/wpilib_preferences.json b/.wpilib/wpilib_preferences.json old mode 100755 new mode 100644 similarity index 77% rename from 2022-2023/main-bot/.wpilib/wpilib_preferences.json rename to .wpilib/wpilib_preferences.json index 4062463..475f197 --- a/2022-2023/main-bot/.wpilib/wpilib_preferences.json +++ b/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2023", + "projectYear": "2025", "teamNumber": 5098 } \ No newline at end of file diff --git a/2022-2023/main-bot/.gradle/7.5.1/checksums/checksums.lock b/2022-2023/main-bot/.gradle/7.5.1/checksums/checksums.lock deleted file mode 100755 index 5a04837..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/checksums/checksums.lock and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/checksums/md5-checksums.bin b/2022-2023/main-bot/.gradle/7.5.1/checksums/md5-checksums.bin deleted file mode 100755 index c8ee3ba..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/checksums/md5-checksums.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/checksums/sha1-checksums.bin b/2022-2023/main-bot/.gradle/7.5.1/checksums/sha1-checksums.bin deleted file mode 100755 index 2d75895..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/checksums/sha1-checksums.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock b/2022-2023/main-bot/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock deleted file mode 100755 index 4e31113..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/dependencies-accessors/gc.properties b/2022-2023/main-bot/.gradle/7.5.1/dependencies-accessors/gc.properties deleted file mode 100755 index e69de29..0000000 diff --git a/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.bin b/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.bin deleted file mode 100755 index b53bfdc..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.lock b/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.lock deleted file mode 100755 index a8b1257..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/executionHistory/executionHistory.lock and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/fileChanges/last-build.bin b/2022-2023/main-bot/.gradle/7.5.1/fileChanges/last-build.bin deleted file mode 100755 index f76dd23..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/fileChanges/last-build.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.bin b/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.bin deleted file mode 100755 index 1b0c1b1..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.lock b/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.lock deleted file mode 100755 index a69daf0..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/fileHashes.lock and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/resourceHashesCache.bin b/2022-2023/main-bot/.gradle/7.5.1/fileHashes/resourceHashesCache.bin deleted file mode 100755 index 7df2b98..0000000 Binary files a/2022-2023/main-bot/.gradle/7.5.1/fileHashes/resourceHashesCache.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/7.5.1/gc.properties b/2022-2023/main-bot/.gradle/7.5.1/gc.properties deleted file mode 100755 index e69de29..0000000 diff --git a/2022-2023/main-bot/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/2022-2023/main-bot/.gradle/buildOutputCleanup/buildOutputCleanup.lock deleted file mode 100755 index f4c0a08..0000000 Binary files a/2022-2023/main-bot/.gradle/buildOutputCleanup/buildOutputCleanup.lock and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/buildOutputCleanup/cache.properties b/2022-2023/main-bot/.gradle/buildOutputCleanup/cache.properties deleted file mode 100755 index 7fdc208..0000000 --- a/2022-2023/main-bot/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Thu Jan 26 17:19:17 CST 2023 -gradle.version=7.5.1 diff --git a/2022-2023/main-bot/.gradle/buildOutputCleanup/outputFiles.bin b/2022-2023/main-bot/.gradle/buildOutputCleanup/outputFiles.bin deleted file mode 100755 index eae504c..0000000 Binary files a/2022-2023/main-bot/.gradle/buildOutputCleanup/outputFiles.bin and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/file-system.probe b/2022-2023/main-bot/.gradle/file-system.probe deleted file mode 100755 index 6c82972..0000000 Binary files a/2022-2023/main-bot/.gradle/file-system.probe and /dev/null differ diff --git a/2022-2023/main-bot/.gradle/vcs-1/gc.properties b/2022-2023/main-bot/.gradle/vcs-1/gc.properties deleted file mode 100755 index e69de29..0000000 diff --git a/2022-2023/main-bot/WPILib-License.md b/2022-2023/main-bot/WPILib-License.md deleted file mode 100755 index f6cdf0d..0000000 --- a/2022-2023/main-bot/WPILib-License.md +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2009-2021 FIRST and other WPILib contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of FIRST, WPILib, nor the names of other WPILib - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/2022-2023/main-bot/bin/main/frc/.clang-format b/2022-2023/main-bot/bin/main/frc/.clang-format deleted file mode 100755 index bdb418e..0000000 --- a/2022-2023/main-bot/bin/main/frc/.clang-format +++ /dev/null @@ -1,6 +0,0 @@ -Language: Java -BasedOnStyle: Microsoft - -AlignConsecutiveAssignments: Consecutive -AlignConsecutiveDeclarations: Consecutive -ColumnLimit: 0 \ No newline at end of file diff --git a/2022-2023/main-bot/bin/main/frc/CommonData.class b/2022-2023/main-bot/bin/main/frc/CommonData.class deleted file mode 100644 index e49417b..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/CommonData.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/Arm$Position.class b/2022-2023/main-bot/bin/main/frc/components/Arm$Position.class deleted file mode 100644 index c17c3f1..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/Arm$Position.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/Arm.class b/2022-2023/main-bot/bin/main/frc/components/Arm.class deleted file mode 100644 index abfe5a9..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/Arm.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/Claw$State.class b/2022-2023/main-bot/bin/main/frc/components/Claw$State.class deleted file mode 100644 index b9b889a..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/Claw$State.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/Claw.class b/2022-2023/main-bot/bin/main/frc/components/Claw.class deleted file mode 100644 index ca879a2..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/Claw.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/IComponent.class b/2022-2023/main-bot/bin/main/frc/components/IComponent.class deleted file mode 100644 index ef13c9f..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/IComponent.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/README.md b/2022-2023/main-bot/bin/main/frc/components/README.md deleted file mode 100755 index 6e1e7ce..0000000 --- a/2022-2023/main-bot/bin/main/frc/components/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Structure of components - -Each component should implement an `update` function, as specified in -`IComponent`. What each component does in its `update` depends on that -component. For instance, a controller component may fetch all the data -it needs and fill out relevant sections of a common `data` object. A -drive component may fetch the values from the common `data` object and -drive accordingly. \ No newline at end of file diff --git a/2022-2023/main-bot/bin/main/frc/components/SwerveDrive.class b/2022-2023/main-bot/bin/main/frc/components/SwerveDrive.class deleted file mode 100644 index b0bfedf..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/SwerveDrive.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/SwerveWheel.class b/2022-2023/main-bot/bin/main/frc/components/SwerveWheel.class deleted file mode 100644 index 4544e2c..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/SwerveWheel.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState1.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState1.class deleted file mode 100644 index 468c9a2..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState1.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState2.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState2.class deleted file mode 100644 index e6354b7..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState2.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState3.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState3.class deleted file mode 100644 index f5d0bb2..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/ArmState3.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/Autonomous.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/Autonomous.class deleted file mode 100644 index 73b5883..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/Autonomous.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState1.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState1.class deleted file mode 100644 index 08a086c..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState1.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState2.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState2.class deleted file mode 100644 index 08983c3..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState2.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState3.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState3.class deleted file mode 100644 index 4ebecb7..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState3.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState4.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState4.class deleted file mode 100644 index c6a2f0d..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState4.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState5.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState5.class deleted file mode 100644 index b62e3b2..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState5.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState6.class b/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState6.class deleted file mode 100644 index 044a2c4..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/components/autonomous/DriveState6.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/controllers/LogitechF310.class b/2022-2023/main-bot/bin/main/frc/controllers/LogitechF310.class deleted file mode 100644 index 2be01dd..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/controllers/LogitechF310.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/controllers/Xbox360$dPad.class b/2022-2023/main-bot/bin/main/frc/controllers/Xbox360$dPad.class deleted file mode 100644 index d3ab43e..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/controllers/Xbox360$dPad.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/controllers/Xbox360.class b/2022-2023/main-bot/bin/main/frc/controllers/Xbox360.class deleted file mode 100644 index 2ba9c9d..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/controllers/Xbox360.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/controllers/XboxOne$dPad.class b/2022-2023/main-bot/bin/main/frc/controllers/XboxOne$dPad.class deleted file mode 100644 index ff0d64b..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/controllers/XboxOne$dPad.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/controllers/XboxOne.class b/2022-2023/main-bot/bin/main/frc/controllers/XboxOne.class deleted file mode 100644 index ccbb110..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/controllers/XboxOne.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/robot/Main.class b/2022-2023/main-bot/bin/main/frc/robot/Main.class deleted file mode 100644 index 54aaf77..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/robot/Main.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/robot/Robot.class b/2022-2023/main-bot/bin/main/frc/robot/Robot.class deleted file mode 100644 index 165911b..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/robot/Robot.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/robot/Utility.class b/2022-2023/main-bot/bin/main/frc/robot/Utility.class deleted file mode 100644 index f9d72fb..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/robot/Utility.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/ArmSettings.class b/2022-2023/main-bot/bin/main/frc/settings/ArmSettings.class deleted file mode 100644 index 42ce2c9..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/ArmSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/ClawSettings.class b/2022-2023/main-bot/bin/main/frc/settings/ClawSettings.class deleted file mode 100644 index 54ece2c..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/ClawSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/LimitedMotorSettings.class b/2022-2023/main-bot/bin/main/frc/settings/LimitedMotorSettings.class deleted file mode 100644 index 9246187..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/LimitedMotorSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/Settings.class b/2022-2023/main-bot/bin/main/frc/settings/Settings.class deleted file mode 100644 index 6fda243..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/Settings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/SwerveDriveSettings.class b/2022-2023/main-bot/bin/main/frc/settings/SwerveDriveSettings.class deleted file mode 100644 index cab29a8..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/SwerveDriveSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings$Location.class b/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings$Location.class deleted file mode 100644 index 3fba39b..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings$Location.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings.class b/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings.class deleted file mode 100644 index 031ebc5..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/SwerveWheelSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/settings/WristSettings.class b/2022-2023/main-bot/bin/main/frc/settings/WristSettings.class deleted file mode 100644 index 068c37a..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/settings/WristSettings.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/state_machine/State.class b/2022-2023/main-bot/bin/main/frc/state_machine/State.class deleted file mode 100644 index dfee2a5..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/state_machine/State.class and /dev/null differ diff --git a/2022-2023/main-bot/bin/main/frc/state_machine/StateMachine.class b/2022-2023/main-bot/bin/main/frc/state_machine/StateMachine.class deleted file mode 100644 index e734538..0000000 Binary files a/2022-2023/main-bot/bin/main/frc/state_machine/StateMachine.class and /dev/null differ diff --git a/2022-2023/main-bot/build.gradle b/2022-2023/main-bot/build.gradle deleted file mode 100755 index e1a67b8..0000000 --- a/2022-2023/main-bot/build.gradle +++ /dev/null @@ -1,105 +0,0 @@ -plugins { - id "java" - id "edu.wpi.first.GradleRIO" version "2023.4.3" -} - -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 - -def ROBOT_MAIN_CLASS = "frc.robot.Main" - -// Define my targets (RoboRIO) and artifacts (deployable files) -// This is added by GradleRIO's backing project DeployUtils. -deploy { - targets { - roborio(getTargetTypeClass('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 = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) - - artifacts { - // First part is artifact name, 2nd is artifact type - // getTargetTypeClass is a shortcut to get the class type using a string - - frcJava(getArtifactTypeClass('FRCJavaArtifact')) { - } - - // Static files artifact - frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { - files = project.fileTree('src/main/deploy') - directory = '/home/lvuser/deploy' - } - } - } - } -} - -def deployArtifact = deploy.targets.roborio.artifacts.frcJava - -// Set to true to use debug for JNI. -wpi.java.debugJni = false - -// Set this to true to enable desktop support. -def includeDesktopSupport = false - -repositories { - mavenCentral() -} - -// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. -// Also defines JUnit 5. -dependencies { - implementation wpi.java.deps.wpilib() - implementation wpi.java.vendor.java() - - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) - - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) - - nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) - nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) - simulationDebug wpi.sim.enableDebug() - - nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) - nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) - simulationRelease wpi.sim.enableRelease() - - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' - - implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2' -} - -test { - useJUnitPlatform() - systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' -} - -// Simulation configuration (e.g. environment variables). -wpi.sim.addGui().defaultEnabled = true -wpi.sim.addDriverstation() - -// 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) - duplicatesStrategy = DuplicatesStrategy.INCLUDE -} - -// Configure jar and deploy tasks -deployArtifact.jarTask = jar -wpi.java.configureExecutableTasks(jar) -wpi.java.configureTestTasks(test) - -// Configure string concat to always inline compile -tasks.withType(JavaCompile) { - options.compilerArgs.add '-XDstringConcat=inline' -} diff --git a/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.jar b/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.jar deleted file mode 100755 index 249e583..0000000 Binary files a/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.properties b/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.properties deleted file mode 100755 index 7414769..0000000 --- a/2022-2023/main-bot/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=permwrapper/dists diff --git a/2022-2023/main-bot/gradlew b/2022-2023/main-bot/gradlew deleted file mode 100755 index a69d9cb..0000000 --- a/2022-2023/main-bot/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original 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 POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${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 "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# 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 ;; #( - MSYS* | 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" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/2022-2023/main-bot/gradlew.bat b/2022-2023/main-bot/gradlew.bat deleted file mode 100755 index 53a6b23..0000000 --- a/2022-2023/main-bot/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@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 Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@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% equ 0 goto execute - -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 execute - -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 - -: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 %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 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! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/2022-2023/main-bot/settings.gradle b/2022-2023/main-bot/settings.gradle deleted file mode 100755 index ae1af1c..0000000 --- a/2022-2023/main-bot/settings.gradle +++ /dev/null @@ -1,27 +0,0 @@ -import org.gradle.internal.os.OperatingSystem - -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - String frcYear = '2023' - 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/2022-2023/main-bot/src/main/deploy/robot_settings.json b/2022-2023/main-bot/src/main/deploy/robot_settings.json deleted file mode 100755 index 022b1d5..0000000 --- a/2022-2023/main-bot/src/main/deploy/robot_settings.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "controllerID": 0, - "auxControllerID": 1, - "swerveDrive": { - "FLSwerve": { - "driveID": 1, - "turnID": 2, - "encoderID": 10, - "location": "front", - "defensiveAngle": 315, - "posY": -0.238125, - "posX": 0.365125 - }, - "FRSwerve": { - "driveID": 7, - "turnID": 8, - "encoderID": 12, - "location": "front", - "defensiveAngle": 45, - "posY": 0.238125, - "posX": 0.365125 - }, - "BLSwerve": { - "driveID": 3, - "turnID": 4, - "encoderID": 11, - "location": "back", - "defensiveAngle": 45, - "posY": -0.238125, - "posX": -0.365125 - }, - "BRSwerve": { - "driveID": 5, - "turnID": 6, - "encoderID": 9, - "location": "back", - "defensiveAngle": 315, - "posY": 0.238125, - "posX": -0.365125 - } - }, - "clawSettings": { - "pneumaticsModuleId": 1, - "openingPortId": 7, - "closingPortId": 8 - }, - "armSettings": { - "shoulderMotorID": 13, - "elbowMotorID": 14 - } -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/.clang-format b/2022-2023/main-bot/src/main/java/frc/.clang-format deleted file mode 100755 index bdb418e..0000000 --- a/2022-2023/main-bot/src/main/java/frc/.clang-format +++ /dev/null @@ -1,6 +0,0 @@ -Language: Java -BasedOnStyle: Microsoft - -AlignConsecutiveAssignments: Consecutive -AlignConsecutiveDeclarations: Consecutive -ColumnLimit: 0 \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/CommonData.java b/2022-2023/main-bot/src/main/java/frc/CommonData.java deleted file mode 100755 index 572ccce..0000000 --- a/2022-2023/main-bot/src/main/java/frc/CommonData.java +++ /dev/null @@ -1,116 +0,0 @@ -package frc; - -import frc.components.Claw; - -/* -* 'public': This class can be accessed outside of this folder. -* 'class': This can contain variables and functionality. -* 'CommonData': The name of this class. It is treated as a TYPE. -*/ -public class CommonData { - /* - * 'public': This variable can be accessed outside this class. - * 'static': This variable is the same across the entire class; - * it is not unique to individual intances, or - * objects, of this class. - * 'Claw.State': The type of data this variable is. - * 'ClawState': The name of this variable. - */ - - // Contructor to prevent instantiation of a utility class - private CommonData() { - throw new UnsupportedOperationException( - "This is a utility class and cannot be instantiated"); - } - - public static Claw.State clawState; - /* - * This keeps track of the state of claw - * Either open or closed - */ - - public static double desiredTurn; - /* - * This is the desired turn value - * It is used in the drive class - */ - - public static double forwardSpeed; - /* - * This is the desired forward speed - * It's used to keep track of the speed - * and set the speed in the drive class - */ - - public static double sideSpeed; - /* - * Side speed of the robot - * This is used when the robot is strafing - */ - - public static boolean balance; - /* - * Set to true when the robot is balancing in autonomous - */ - - public static boolean battenDownTheHatches; - /* - * This is set to true whenever the robot is in defense mode - * All wheels are set to an 'x' pattern so the robot can't be pushed - */ - - public static boolean calibrate; - /* - * Set to true when the robot is calibrating - * Set to false otherwise - */ - - public static double shoulderPower; - /* - * This is the current power of the shoulder motor - */ - public static double elbowPower; - /* - * This is the current power of the elbow motor - */ - - public static double shoulderAngle; - /* - * The current angle of the shoulder motor - * This is in degrees - */ - public static double elbowAngle; - /* - * The current angle of the elbow motor - * This is in degrees - */ - - public static double desiredShoulderAngle; - /* - * The desired angle of the shoulder motor - * This is in degrees - */ - public static double desiredElbowAngle; - /* - * The desired angle of the elbow motor - * This is in degrees - */ - - public static double robotPitch; - /* - * Current pitch of the robot - * Gathered from the NavX - */ - public static double robotRoll; - /* - * Current roll of the robot - * Gathered from the NavX - */ - - // Autonomous Varaibles - public static int counter; - /* - * This is a counter that is used in the autonomous class - * It is used to keep track of the current state of the state machine - */ -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/Arm.java b/2022-2023/main-bot/src/main/java/frc/components/Arm.java deleted file mode 100755 index c3ee00b..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/Arm.java +++ /dev/null @@ -1,53 +0,0 @@ -package frc.components; - -import com.ctre.phoenix.motorcontrol.ControlMode; -import com.ctre.phoenix.motorcontrol.can.TalonFX; -import frc.CommonData; -import frc.robot.Utility; -import frc.settings.ArmSettings; - -public class Arm implements IComponent { - - public enum Position { - /* - * This is the positions or 'presets' of the arms - */ - - kTopShelf(-85465, 99934), - kMiddleShelfOrHumanPlayer(-30156, 152244), - kGroundPickup(10411, 26723), - kHome(-32405, 941), - kHumanPlayerStation(-55821, 45126); - - Position(double presetShoulderPos, double presetElbowPos) { - shoulderPos = presetShoulderPos; - elbowPos = presetElbowPos; - } - - public double shoulderPos; - public double elbowPos; - } - - public Arm(ArmSettings settings) { - shoulderMotor = new TalonFX(settings.shoulderMotorID); - elbowMotor = new TalonFX(settings.elbowMotorID); - } - - TalonFX shoulderMotor; - TalonFX elbowMotor; - - public void moveToPOS() { - CommonData.shoulderAngle = shoulderMotor.getSelectedSensorPosition(); - CommonData.elbowAngle = elbowMotor.getSelectedSensorPosition(); - - var actualShoulderTarget = Utility.clamp(CommonData.desiredShoulderAngle, -91250, 52915); - var actualElbowTarget = Utility.clamp(CommonData.desiredElbowAngle, -645, 189514); - - shoulderMotor.set(ControlMode.Position, actualShoulderTarget); - elbowMotor.set(ControlMode.Position, actualElbowTarget); - } - - public void update() { - moveToPOS(); - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/Claw.java b/2022-2023/main-bot/src/main/java/frc/components/Claw.java deleted file mode 100755 index faa3266..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/Claw.java +++ /dev/null @@ -1,66 +0,0 @@ -package frc.components; - -import edu.wpi.first.wpilibj.DoubleSolenoid; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; -import edu.wpi.first.wpilibj.PneumaticsModuleType; -import frc.CommonData; -import frc.settings.ClawSettings; - -/* - * 'public': This class can be accessed outside of this folder. - * 'class': This can contain variables and functionality. - * 'Claw': The name of this particular class. This is treated as a TYPE. - * 'implements': This class implements an interface, or more than one. This class must implement the methods described - * in the interface. - * 'IComponent': The name of the interface this class implements. This can be more than one, separated by commas. - */ -public class Claw implements IComponent { - - /* - * 'public': This enum can be accessed outside this class. - * 'enum': A conventiently-named list of constants, in lieu of saying '1', '2', '3'... by giving each value a - * meaningful name. An enum is actually capable of more than this, but this is its most used form. - * 'State': The name of this particular enum. This is treated as a TYPE. - */ - public enum State { - kOpen, - kClosed, - } - - /* - * 'private': This variable cannot be accessed outside this class, nor by any potential child classes. - * 'DoubleSolenoid': the TYPE of data this variable is. - * 'm_solenoid': A custom name for this variable. Uses the convention that member variables begin with 'm_'. - */ - private DoubleSolenoid m_solenoid; - - /* - * 'public': This constructor can be accessed outside this class. - * 'Claw': The same name as the class. A "method-looking" declaration that uses the same name as the class is a - * constructor. Constructors do NOT specify a return type, not even 'void'. - * '(...)': This constructor accepts 3 arguments. - * '(int _, int _, int _)': Each argument is an 'int'. Generally, arguments need not all be the same type. - * '(_ pneumaticsModuleId, _ openingPortId, _ closingPortId)': Each argument's name. These are variables. - */ - public Claw(ClawSettings settings) { - m_solenoid = new DoubleSolenoid(settings.pneumaticsModuleId, PneumaticsModuleType.REVPH, settings.openingPortId, settings.closingPortId); - } - - /* - * 'public': This method can be called by code outside this class. - * 'void': This method does not return anything. - * 'update': The name of this method. - * '()': This method accepts 0 arguments. - */ - public void update() { - // This method will be called periodically. - // This assumes that 'CommonData.ClawState' updates elsewhere before this is called. - switch (CommonData.clawState) { - case kOpen: - m_solenoid.set(Value.kForward); // piston pushes forward -> claw opens - break; - case kClosed: - m_solenoid.set(Value.kReverse); // piston pulls back -> claw closes - } - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/IComponent.java b/2022-2023/main-bot/src/main/java/frc/components/IComponent.java deleted file mode 100755 index b04a23c..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/IComponent.java +++ /dev/null @@ -1,19 +0,0 @@ -package frc.components; - -/* - * 'public': This class can be accessed outside of this folder. - * 'interface': This can contain method declarations without their definitions. Any class that implements this - * interface MUST implement all methods this interface describes. Otherwise, the compiler reports an - * error. - * 'IComponent': The name of this particular interface. - */ -public interface IComponent { - /* - * 'public': This method can be accessed outside this class. - * 'void': This method does not return anything. - * 'update': This method is called "update". - * '()': This method accepts no arguments. - * ';' This method contains no body; it is not defined (only declared); it is not implemented. - */ - public void update(); -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/README.md b/2022-2023/main-bot/src/main/java/frc/components/README.md deleted file mode 100755 index 6e1e7ce..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Structure of components - -Each component should implement an `update` function, as specified in -`IComponent`. What each component does in its `update` depends on that -component. For instance, a controller component may fetch all the data -it needs and fill out relevant sections of a common `data` object. A -drive component may fetch the values from the common `data` object and -drive accordingly. \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/components/SwerveDrive.java b/2022-2023/main-bot/src/main/java/frc/components/SwerveDrive.java deleted file mode 100755 index 5cbd129..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/SwerveDrive.java +++ /dev/null @@ -1,84 +0,0 @@ -package frc.components; - -import com.kauailabs.navx.frc.AHRS; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.kinematics.SwerveDriveKinematics; -import edu.wpi.first.wpilibj.SPI; -import frc.CommonData; -import frc.robot.Utility; -import frc.settings.SwerveDriveSettings; - -public class SwerveDrive implements IComponent { - final static double maximumSpeed = (6380 * 0.3191858136) / 60 / 3; - final static double maximumRotation = (maximumSpeed * 2 * Math.PI) / 2.7389195456 / 2; - - double yawOffset = 0; - - public SwerveDrive(SwerveDriveSettings settings) { - swerveWheels = new SwerveWheel[] { - new SwerveWheel(settings.FLSwerve), - new SwerveWheel(settings.FRSwerve), - new SwerveWheel(settings.BLSwerve), - new SwerveWheel(settings.BRSwerve)}; - - kinematics = new SwerveDriveKinematics(swerveWheels[0].getSwervePos(), swerveWheels[1].getSwervePos(), swerveWheels[2].getSwervePos(), swerveWheels[3].getSwervePos()); - } - - SwerveWheel[] swerveWheels; - - double leftOrRight; - double forwardOrBack; - - AHRS ahrs = new AHRS(SPI.Port.kMXP); - - SwerveDriveKinematics kinematics; - - public void balance() { - final double maximumTiltAngle = 12.81974281; - - forwardOrBack = Math.abs(CommonData.robotPitch) > 10 ? CommonData.robotPitch / maximumTiltAngle : 0; - leftOrRight = Math.abs(CommonData.robotRoll) > 10 ? CommonData.robotRoll / maximumTiltAngle : 0; - - Utility.printLn("" + forwardOrBack); - final var desiredTranslationSpeedX = forwardOrBack * -maximumSpeed; // This code uses '+x' as toward opposing alliance wall - final var desiredTranslationSpeedY = 0; // This code uses '+y' as toward driver's right - final var desiredRotationSpeed = -leftOrRight * maximumRotation; - var moduleStates = kinematics.toSwerveModuleStates(ChassisSpeeds.fromFieldRelativeSpeeds(desiredTranslationSpeedX, desiredTranslationSpeedY, desiredRotationSpeed, Rotation2d.fromDegrees(ahrs.getYaw() - yawOffset))); - - for (int i = 0; i < 4; i++) { - moduleStates[i].speedMetersPerSecond *= 0.1; - swerveWheels[i].set(moduleStates[i]); - } - } - - public void update() { - CommonData.robotPitch = ahrs.getPitch(); - CommonData.robotRoll = ahrs.getRoll(); - - // Calabrate The NavX - if (CommonData.calibrate == true) { - CommonData.calibrate = false; - yawOffset = ahrs.getYaw(); - } - - if (CommonData.battenDownTheHatches) { - for (int i = 0; i < 4; i++) { - swerveWheels[i].defense(); - } - } - else if (CommonData.balance) { - balance(); - } - else { - final var desiredTranslationSpeedX = CommonData.forwardSpeed * maximumSpeed; // This code uses '+x' as toward opposing alliance wall - final var desiredTranslationSpeedY = -CommonData.sideSpeed * maximumSpeed; // This code uses '+y' as toward driver's right - final var desiredRotationSpeed = -CommonData.desiredTurn * maximumRotation; - var moduleStates = kinematics.toSwerveModuleStates(ChassisSpeeds.fromFieldRelativeSpeeds(desiredTranslationSpeedX, desiredTranslationSpeedY, desiredRotationSpeed, Rotation2d.fromDegrees(ahrs.getYaw()))); - - for (int i = 0; i < 4; i++) { - swerveWheels[i].set(moduleStates[i]); - } - } - } -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/components/SwerveWheel.java b/2022-2023/main-bot/src/main/java/frc/components/SwerveWheel.java deleted file mode 100755 index 25f4d31..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/SwerveWheel.java +++ /dev/null @@ -1,70 +0,0 @@ -package frc.components; - -import com.ctre.phoenix.motorcontrol.ControlMode; -import com.ctre.phoenix.motorcontrol.can.TalonFX; -import com.ctre.phoenix.sensors.CANCoder; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import frc.settings.SwerveWheelSettings; -import frc.settings.SwerveWheelSettings.Location; - -public class SwerveWheel { - TalonFX turnMotor; - TalonFX driveMotor; - CANCoder encoder; - - // 0.238125 Meters - // 0.365125 Meters - - Translation2d modulePos; - - double defensiveAngle; - - Location location; - - public SwerveWheel(SwerveWheelSettings settings) { - turnMotor = new TalonFX(settings.turnID); - driveMotor = new TalonFX(settings.driveID); - encoder = new CANCoder(settings.encoderID); - - location = settings.location; - defensiveAngle = settings.defensiveAngle; - - modulePos = new Translation2d(settings.posX, settings.posY); - } - - public void set(SwerveModuleState swerveModuleState) { - swerveModuleState = SwerveModuleState.optimize(swerveModuleState, Rotation2d.fromDegrees(turnMotor.getSelectedSensorPosition() / 11.3777778)); - double maximumSpeed = (6380 * 0.3191858136) / 60 / 3; - - final double desiredTurnPos = swerveModuleState.angle.getDegrees() * 11.3777778; // conversion from degrees to native encoder value - - turnMotor.set(ControlMode.Position, desiredTurnPos); - - driveMotor.set(ControlMode.PercentOutput, swerveModuleState.speedMetersPerSecond / maximumSpeed); - // Using Velocity Can Be Used For Better Control But Percent Output Is Better Used For Practice - } - - public void defense() { - turnMotor.set(ControlMode.Position, defensiveAngle * 11.77777777); - driveMotor.set(ControlMode.PercentOutput, 0); - } - - public TalonFX getTurnMotor() { - return turnMotor; - } - - public TalonFX getDriveMotor() { - return driveMotor; - } - - public Translation2d getSwervePos() { - return modulePos; - } - - // public void battenDownTheHatches() - // { - // set(defensiveAngle, 0, 0); - // } -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState1.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState1.java deleted file mode 100755 index 97c82f9..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState1.java +++ /dev/null @@ -1,43 +0,0 @@ -package frc.components.autonomous; - -import frc.CommonData; -// import frc.robot.Utility; -import frc.state_machine.State; - -public class ArmState1 extends State { - - private static final double targetShoulderAngle = -75563; - private static final double targetElbowAngle = 109928; - - private static final double shoulderThreshold = 500; - private static final double elbowThreshold = 500; - - private static final double shoulderPower = 0.2; - private static final double elbowPower = 0.2; - - @Override - public void onEnter() { - System.out.println("Arm State 1 entered"); - } - - @Override - public void onExit() { - System.out.println("Arm State 1 exited"); - } - - @Override - public boolean run() { - CommonData.desiredShoulderAngle = targetShoulderAngle; - CommonData.desiredElbowAngle = targetElbowAngle; - - final double shoulderError = targetShoulderAngle - CommonData.shoulderAngle; - final double elbowError = targetElbowAngle - CommonData.elbowAngle; - - if (Math.abs(elbowError) < 400 && Math.abs(shoulderError) < 400) { - return true; - } - else { - return false; - } - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState2.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState2.java deleted file mode 100755 index aa7a65b..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState2.java +++ /dev/null @@ -1,34 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.wpilibj.Timer; -import frc.CommonData; -import frc.components.Claw; -import frc.state_machine.State; - -public class ArmState2 extends State { - Timer timer = new Timer(); - - @Override - public void onEnter() { - System.out.println("Arm State 2 entered"); - timer.start(); - } - - @Override - public void onExit() { - System.out.println("Arm State 2 exited"); - } - - @Override - public boolean run() { - if (timer.hasElapsed(1)) { - CommonData.counter++; - return true; - } - else if (timer.hasElapsed(0.5)) { - CommonData.clawState = Claw.State.kOpen; - } - - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState3.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState3.java deleted file mode 100755 index acafd99..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/ArmState3.java +++ /dev/null @@ -1,41 +0,0 @@ -package frc.components.autonomous; - -import frc.CommonData; -import frc.state_machine.State; - -public class ArmState3 extends State { - private static final double targetShoulderAngle = -18610; // Placeholder - private static final double targetElbowAngle = -645; // Placeholder - - private static final double shoulderThreshold = 500; - private static final double elbowThreshold = 500; - - private static final double shoulderPower = 0.2; - private static final double elbowPower = 0.2; - - @Override - public void onEnter() { - System.out.println("Arm State 3 entered"); - } - - @Override - public void onExit() { - System.out.println("Arm State 3 exited"); - } - - @Override - public boolean run() { - CommonData.desiredShoulderAngle = targetShoulderAngle; - CommonData.desiredElbowAngle = targetElbowAngle; - - final double shoulderError = targetShoulderAngle - CommonData.shoulderAngle; - final double elbowError = targetElbowAngle - CommonData.elbowAngle; - - if (Math.abs(elbowError) < 400 && Math.abs(shoulderError) < 400) { - return true; - } - else { - return false; - } - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/Autonomous.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/Autonomous.java deleted file mode 100755 index 7321b91..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/Autonomous.java +++ /dev/null @@ -1,28 +0,0 @@ -package frc.components.autonomous; - -import frc.components.IComponent; -import frc.state_machine.StateMachine; - -public class Autonomous implements IComponent { - StateMachine m_stateMachine = new StateMachine(); - - public Autonomous() { - // m_driveStateMachine.addState(new DriveState1()); - // m_driveStateMachine.addState(new DriveState2()); - - // VV Balancing code -- UNCOMMENT TO TEST THIS CODE AT AN OFFICIAL COMPETITION - COMMENT AGAIN IF IT DOES NOT WORK - // m_driveStateMachine.addState(new DriveState5()); - // ^^ Balancing code - - m_stateMachine.addState(new ArmState1()); // Move arm to drop box - m_stateMachine.addState(new ArmState2()); // Drop box - m_stateMachine.addState(new ArmState3()); // Move arm to reset - m_stateMachine.addState(new DriveState3()); // Move to balance or taxi - m_stateMachine.addState(new DriveState6()); // Balance - } - - @Override - public void update() { - m_stateMachine.run(); - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState1.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState1.java deleted file mode 100755 index 5fb12ff..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState1.java +++ /dev/null @@ -1,44 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.networktables.NetworkTableEntry; -import edu.wpi.first.networktables.NetworkTableInstance; -import edu.wpi.first.wpilibj.Timer; -import frc.CommonData; -import frc.state_machine.State; - -public class DriveState1 extends State { - NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); - NetworkTableEntry tv = table.getEntry("tv"); - - Timer timer; - - @Override - public void onEnter() { - System.out.println("Drive State 1 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 1 exited"); - } - - @Override - public boolean run() { - CommonData.forwardSpeed = -0.1; - - boolean targetFound = tv.getDouble(0) == 1; - if (targetFound) { - if (timer == null) { - timer = new Timer(); - timer.start(); - } - else if (timer.hasElapsed(0.1)) { - return true; - } - } - else { - timer = null; - } - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState2.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState2.java deleted file mode 100755 index c0f918a..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState2.java +++ /dev/null @@ -1,68 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.networktables.NetworkTableEntry; -import edu.wpi.first.networktables.NetworkTableInstance; -import frc.CommonData; -import frc.robot.Utility; -import frc.state_machine.State; - -public class DriveState2 extends State { - - NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); - NetworkTableEntry tv = table.getEntry("tv"); - NetworkTableEntry array = table.getEntry("camerapose_targetspace"); - - @Override - public void onEnter() { - System.out.println("Drive State 2 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 2 exited"); - } - - @Override - public boolean run() { - boolean found = tv.getDouble(0) == 1; - - double tx = 0; - double tz = 0; - double ry = 0; - // CommonData.desiredHeading = 0; - // CommonData.desiredPower = 0; - CommonData.desiredTurn = 0; - if (found) { - Double[] targetInfo = array.getDoubleArray(new Double[0]); - - tx = targetInfo[0]; // tx - tz = targetInfo[2] + .5; // tz - ry = targetInfo[4]; // ry - - tx = Utility.sigmoid(tx * 2) * 2 - 1; - tz = Utility.clamp(tz, -1.0, 1.0); - ry = Utility.sigmoid(ry / 10) * 2 - 1; - Utility.printLn("TX: " + tx + " TZ: " + tz + " RY: " + ry); - - if ((Math.abs(tz) < 0.1) && (Math.abs(tx) < 0.15) && (Math.abs(ry) < 0.6)) { - CommonData.counter++; - return true; - } - else { - // Drive Until Center And Lined Up With The April Tag - double theta = Math.atan2(tx, tz); - double degrees = Math.toDegrees(theta) + 180; - double power = Math.sqrt(Math.pow(tx, 2) + Math.pow(tz, 2)); - - if (tx == 0 && tz == 0) { - degrees = 0; - } - - // CommonData.desiredHeading = degrees; - // CommonData.desiredPower = power; - CommonData.desiredTurn = ry; - } - } - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState3.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState3.java deleted file mode 100755 index dc4cf1f..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState3.java +++ /dev/null @@ -1,53 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.networktables.NetworkTableEntry; -import edu.wpi.first.networktables.NetworkTableInstance; -import edu.wpi.first.wpilibj.Timer; -import frc.CommonData; -import frc.state_machine.State; - -public class DriveState3 extends State { - NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); - NetworkTableEntry tid = table.getEntry("tid"); - NetworkTableEntry tv = table.getEntry("tv"); - Timer timer; - Timer timer2; - - @Override - public void onEnter() { - System.out.println("Drive State 3 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 3 exited"); - } - - @Override - public boolean run() { - CommonData.forwardSpeed = -0.35; - CommonData.desiredTurn = 0; - - if (CommonData.robotPitch > 10 || CommonData.robotRoll > 10) { - if (timer2 == null) { - System.out.println("Pitch: " + CommonData.robotPitch + " Roll: " + CommonData.robotRoll); - timer2 = new Timer(); - timer2.start(); - } - if (timer2.hasElapsed(1)) { - System.out.println("Tilted!"); - return true; - } - } - - if (timer == null) { - timer = new Timer(); - timer.start(); - } - else if (timer.hasElapsed(3)) { - return true; - } - - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState4.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState4.java deleted file mode 100755 index 50b4ee2..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState4.java +++ /dev/null @@ -1,68 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.networktables.NetworkTableEntry; -import edu.wpi.first.networktables.NetworkTableInstance; -import frc.CommonData; -import frc.robot.Utility; -import frc.state_machine.State; - -public class DriveState4 extends State { - NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); - NetworkTableEntry tv = table.getEntry("tv"); - NetworkTableEntry tid = table.getEntry("tid"); - NetworkTableEntry array = table.getEntry("camerapose_targetspace"); - - @Override - public void onEnter() { - System.out.println("Drive State 4 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 4 exited"); - } - - @Override - public boolean run() { - boolean found = tv.getDouble(0) == 1; - double id = tid.getDouble(-1); - - double tx = 0; - double tz = 0; - double ry = 0; - // CommonData.desiredHeading = 0; - // CommonData.desiredPower = 0; - CommonData.desiredTurn = 0; - if (found && (id == 2) || (id == 7)) { - Double[] targetInfo = array.getDoubleArray(new Double[0]); - - tx = targetInfo[0]; // tx - tz = targetInfo[2] + .5; // tz - ry = targetInfo[4]; // ry - - tx = Utility.sigmoid(tx * 2) * 2 - 1; - tz = Utility.clamp(tz, -1.0, 1.0); - ry = Utility.sigmoid(ry / 10) * 2 - 1; - - if ((Math.abs(tz) < 0.1) && (Math.abs(tx) < 0.15) && (Math.abs(ry) < 0.6)) { - return true; - } - else { - // Drive Until Center And Lined Up With The April Tag - double theta = Math.atan2(tx, tz); - double degrees = Math.toDegrees(theta) + 180; - double power = Math.sqrt(Math.pow(tx, 2) + Math.pow(tz, 2)); - - if (tx == 0 && tz == 0) - { - degrees = 0; - } - - // CommonData.desiredHeading = degrees; - // CommonData.desiredPower = power; - CommonData.desiredTurn = ry; - } - } - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState5.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState5.java deleted file mode 100755 index 920d3d4..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState5.java +++ /dev/null @@ -1,36 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.networktables.NetworkTableEntry; -import edu.wpi.first.networktables.NetworkTableInstance; -import frc.CommonData; -import frc.robot.Utility; -import frc.state_machine.State; - -public class DriveState5 extends State { - NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); - NetworkTableEntry tv = table.getEntry("tv"); - NetworkTableEntry tid = table.getEntry("tid"); - NetworkTableEntry array = table.getEntry("camerapose_targetspace"); - - @Override - public void onEnter() { - System.out.println("Drive State 5 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 5 exited"); - } - - @Override - public boolean run() { - if (CommonData.robotPitch > 2 || CommonData.robotRoll > 2) { - return true; - } - else { - CommonData.forwardSpeed = -0.3; - CommonData.desiredTurn = 0; - return false; - } - } -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState6.java b/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState6.java deleted file mode 100755 index 02e5d48..0000000 --- a/2022-2023/main-bot/src/main/java/frc/components/autonomous/DriveState6.java +++ /dev/null @@ -1,21 +0,0 @@ -package frc.components.autonomous; - -import frc.CommonData; -import frc.state_machine.State; - -public class DriveState6 extends State { - @Override - public void onEnter() { - System.out.println("Drive State 6 entered"); - } - @Override - public void onExit() { - System.out.println("Drive State 6 exited"); - } - - @Override - public boolean run() { - CommonData.balance = true; - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/controllers/LogitechF310.java b/2022-2023/main-bot/src/main/java/frc/controllers/LogitechF310.java deleted file mode 100755 index 78c4848..0000000 --- a/2022-2023/main-bot/src/main/java/frc/controllers/LogitechF310.java +++ /dev/null @@ -1,150 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.Joystick; -import java.lang.Math; - -public class LogitechF310 { - // Imported From Code/2022/stingr/main-bot - - private final int kIdButtonA = 1; - private final int kIdButtonB = 2; - private final int kIdButtonX = 3; - private final int kIdButtonY = 4; - private final int kIdButtonBumperLeft = 5; - private final int kIdButtonBumperRight = 6; - private final int kIdAxisleftX = 0; - private final int kIdAxisleftY = 1; - private final int kIdAxisrightX = 4; - private final int kIdAxisrightY = 5; - private final int kIdlefttrigger = 2; - private final int kIdrighttrigger = 3; - private final int kIdDpad = 0; - - // ... - - private Joystick controller; - - public double deadBand(double value) { - return Math.abs(value) < 0.2 ? 0 : value; - } - - public LogitechF310(int id) { - controller = new Joystick(id); - } - - public boolean getA() { - return controller.getRawButton(kIdButtonA); - } - - public boolean getB() { - return controller.getRawButton(kIdButtonB); - } - - public boolean getX() { - return controller.getRawButton(kIdButtonX); - } - - public boolean getY() { - return controller.getRawButton(kIdButtonY); - } - - public boolean getLeftBumper() { - return controller.getRawButton(kIdButtonBumperLeft); - } - - public boolean getRightBumper() { - return controller.getRawButton(kIdButtonBumperRight); - } - - public double getLeftStickX() { - return deadBand(controller.getRawAxis(kIdAxisleftX)); - } - - public double getLeftStickY() { - return deadBand(controller.getRawAxis(kIdAxisleftY)); - } - - public double getRightStickX() { - return deadBand(controller.getRawAxis(kIdAxisrightX)); - } - - public double getRightStickY() { - return deadBand(controller.getRawAxis(kIdAxisrightY)); - } - - public double getLeftTrigger() { - return controller.getRawAxis(kIdlefttrigger); - } - - public double getRightTrigger() { - return controller.getRawAxis(kIdrighttrigger); - } - - public boolean getDUp() { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 315) { - return true; - } - - if (degrees == 0) { - return true; - } - - if (degrees == 45) { - return true; - } - - return false; - } - - public boolean getDRight() { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 45) { - return true; - } - - if (degrees == 90) { - return true; - } - - if (degrees == 135) { - return true; - } - - return false; - } - - public boolean getDDown() { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 135) { - return true; - } - - if (degrees == 180) { - return true; - } - - if (degrees == 225) { - return true; - } - - return false; - } - - public boolean getDLeft() { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 225) { - return true; - } - - if (degrees == 270) { - return true; - } - - if (degrees == 315) { - return true; - } - - return false; - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/controllers/Xbox360.java b/2022-2023/main-bot/src/main/java/frc/controllers/Xbox360.java deleted file mode 100755 index 69d026d..0000000 --- a/2022-2023/main-bot/src/main/java/frc/controllers/Xbox360.java +++ /dev/null @@ -1,146 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.GenericHID.RumbleType; -import edu.wpi.first.wpilibj.Joystick; -import java.lang.Math; - -public class Xbox360 -{ - - public Xbox360(int ID) { - joystick = new Joystick(ID); - } - - Joystick joystick; - - public double deadBand(double value) { - return Math.abs(value) < 0.175 ? 0 : value; - } - - public double getLeftStickX() { - return deadBand(joystick.getRawAxis(0)); - } - - public double getLeftStickY() { - return deadBand(joystick.getRawAxis(1)); - } - - public double getRightStickX() { - return deadBand(joystick.getRawAxis(4)); - } - - public double getRightStickY() { - return deadBand(joystick.getRawAxis(5)); - } - - public boolean getA() { - return joystick.getRawButton(1); - } - - public boolean getB() { - return joystick.getRawButton(2); - } - - public boolean getX() { - return joystick.getRawButton(3); - } - - public boolean getY() { - return joystick.getRawButton(4); - } - - public boolean getLB() { - return joystick.getRawButton(5); - } - - public boolean getRB() { - return joystick.getRawButton(6); - } - - public boolean getBack() { - return joystick.getRawButton(7); - } - - public boolean getStart() { - return joystick.getRawButton(8); - } - - public boolean getLeftStick() { - return joystick.getRawButton(9); - } - - public boolean getRightStick() { - return joystick.getRawButton(10); - } - - public double getLeftTrigger() { - return joystick.getRawAxis(2); - } - - public double getRightTrigger() { - return joystick.getRawAxis(3); - } - - public enum dPad { - up, - down, - left, - right, - upright, - upleft, - downright, - downleft, - none - } - - public dPad getPad() { - switch (joystick.getPOV()) - { - case 0: - return dPad.up; - - case 360: - return dPad.up; - - case 90: - return dPad.right; - - case 180: - return dPad.down; - - case 270: - return dPad.left; - - case 45: - return dPad.upright; - - case 135: - return dPad.downright; - - case 225: - return dPad.downleft; - - case 315: - return dPad.upleft; - - default: - return dPad.none; - } - } - - public void rumbleHigh() { - joystick.setRumble(RumbleType.kRightRumble, 1); - } - - public void rumbleLow() { - joystick.setRumble(RumbleType.kLeftRumble, 1); - } - - public void letsGetReadyToRumble() { - joystick.setRumble(RumbleType.kBothRumble, 1); - } - - public void rumbleOff() { - joystick.setRumble(RumbleType.kBothRumble, 0); - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/controllers/XboxOne.java b/2022-2023/main-bot/src/main/java/frc/controllers/XboxOne.java deleted file mode 100644 index 029b779..0000000 --- a/2022-2023/main-bot/src/main/java/frc/controllers/XboxOne.java +++ /dev/null @@ -1,147 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.GenericHID.RumbleType; -import edu.wpi.first.wpilibj.Joystick; -import java.lang.Math; - -public class XboxOne -{ - - public XboxOne(int ID) { - joystick = new Joystick(ID); - } - - Joystick joystick; - - public double deadBand(double value) { - return Math.abs(value) < 0 ? 0 : value; // Set deadband to 0 as this controller doesn't have drift - } - - public double getLeftStickX() { - return deadBand(joystick.getRawAxis(0)); - } - - public double getLeftStickY() { - return deadBand(joystick.getRawAxis(1)); - } - - public double getRightStickX() { - return deadBand(joystick.getRawAxis(4)); - } - - public double getRightStickY() { - return deadBand(joystick.getRawAxis(5)); - } - - public boolean getA() { - return joystick.getRawButton(1); - } - - public boolean getB() { - return joystick.getRawButton(2); - } - - public boolean getX() { - return joystick.getRawButton(3); - } - - public boolean getY() { - return joystick.getRawButton(4); - } - - public boolean getLB() { - return joystick.getRawButton(5); - } - - public boolean getRB() { - return joystick.getRawButton(6); - } - - public boolean getBack() { - return joystick.getRawButton(7); - } - - public boolean getStart() { - return joystick.getRawButton(8); - } - - public boolean getLeftStick() - { - return joystick.getRawButton(9); - } - - public boolean getRightStick() { - return joystick.getRawButton(10); - } - - public double getLeftTrigger() { - return joystick.getRawAxis(2); - } - - public double getRightTrigger() { - return joystick.getRawAxis(3); - } - - public enum dPad { - up, - down, - left, - right, - upright, - upleft, - downright, - downleft, - none - } - - public dPad getPad() { - switch (joystick.getPOV()) - { - case 0: - return dPad.up; - - case 360: - return dPad.up; - - case 90: - return dPad.right; - - case 180: - return dPad.down; - - case 270: - return dPad.left; - - case 45: - return dPad.upright; - - case 135: - return dPad.downright; - - case 225: - return dPad.downleft; - - case 315: - return dPad.upleft; - - default: - return dPad.none; - } - } - - public void rumbleHigh() { - joystick.setRumble(RumbleType.kRightRumble, 1); - } - - public void rumbleLow() { - joystick.setRumble(RumbleType.kLeftRumble, 1); - } - - public void letsGetReadyToRumble() { - joystick.setRumble(RumbleType.kBothRumble, 1); - } - - public void rumbleOff() { - joystick.setRumble(RumbleType.kBothRumble, 0); - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/robot/Main.java b/2022-2023/main-bot/src/main/java/frc/robot/Main.java deleted file mode 100755 index 8776e5d..0000000 --- a/2022-2023/main-bot/src/main/java/frc/robot/Main.java +++ /dev/null @@ -1,25 +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 frc.robot; - -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/2022-2023/main-bot/src/main/java/frc/robot/Robot.java b/2022-2023/main-bot/src/main/java/frc/robot/Robot.java deleted file mode 100755 index 2d5b738..0000000 --- a/2022-2023/main-bot/src/main/java/frc/robot/Robot.java +++ /dev/null @@ -1,200 +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 frc.robot; - -import com.fasterxml.jackson.databind.ObjectMapper; -import edu.wpi.first.wpilibj.Compressor; -import edu.wpi.first.wpilibj.Filesystem; -import edu.wpi.first.wpilibj.PneumaticsModuleType; -import edu.wpi.first.wpilibj.TimedRobot; -import frc.CommonData; -import frc.components.Arm; -import frc.components.Claw; -import frc.components.IComponent; -import frc.components.SwerveDrive; -import frc.components.autonomous.Autonomous; -import frc.controllers.LogitechF310; -import frc.controllers.Xbox360; -import frc.settings.Settings; -import java.io.IOException; - -/** - * The VM is configured to automatically run this class, and to call the functions corresponding to - * each mode, as described in the TimedRobot documentation. If you change the name of this class or - * the package after creating this project, you must also update the build.gradle file in the - * project. - */ -public class Robot extends TimedRobot { - /* - * Constants should go here. For example: - * - * final int kMainControllerId = 0; - * final int kAuxControllerId = 1; - * - * final int kDriveMotorTopLeftId = 1; - * final int kDriveMotorTopRightId = 2; - * ... - * - * Each constant should start with 'k'. This is a convention. - * Each Id should be given its own constant. - * Each constant should clearly say what it is for. - */ - - public static Settings settings; - static { - ObjectMapper mapper = new ObjectMapper(); - try { - var filepath = Filesystem.getDeployDirectory().toPath().resolve("robot_settings.json"); - settings = mapper.readValue(filepath.toFile(), Settings.class); - } - catch (IOException ex) { - System.out.println(ex.toString()); - } - } - - final int kPneumaticsModuleId = 0; - - final int kClawOpeningPortId = 0; - final int kClawClosingPortId = 1; - - Xbox360 xbox360 = new Xbox360(settings.controllerID); - LogitechF310 logitechF310 = new LogitechF310(settings.auxControllerID); - - Autonomous autonomous; - - Compressor compressor = new Compressor(settings.clawSettings.pneumaticsModuleId, PneumaticsModuleType.REVPH); - - // IComponent[] sensorComponents; - IComponent[] actuatorComponents = new IComponent[] { - new Claw(settings.clawSettings), - new Arm(settings.armSettings), - new SwerveDrive(settings.swerveDrive) - - }; - - boolean driverIsAnna = false; - - /** - * This function is run when the robot is first started up and should be used for any - * initialization code. - */ - @Override - public void robotInit() - { - // compressor.disable(); - } - - @Override - public void robotPeriodic() { - // for(var sensor : sensorComponents) - //{ - // sensor.update(); - // } - - for (var actuator : actuatorComponents) { - actuator.update(); - } - } - - @Override - public void autonomousInit() { - autonomous = new Autonomous(); - CommonData.calibrate = true; - } - - @Override - public void autonomousPeriodic() { - autonomous.update(); - } - - @Override - public void teleopInit() { - } - - // 18.75 -> 0.47625 - // 28.75 -> 0.73025 - - // 0.238125 Meters - // 0.365125 Meters - - @Override - public void teleopPeriodic() - { - CommonData.balance = xbox360.getB(); - CommonData.battenDownTheHatches = xbox360.getX(); - CommonData.sideSpeed = xbox360.getLeftStickX(); - CommonData.forwardSpeed = xbox360.getLeftStickY(); - CommonData.desiredTurn = Utility.snapToEdge(-xbox360.getRightStickX(), -1, 1, 0.9); - - CommonData.desiredShoulderAngle = CommonData.shoulderAngle + (logitechF310.getLeftStickY() * 35000); // 10000 - CommonData.desiredElbowAngle = CommonData.elbowAngle + (logitechF310.getRightStickY() * 10000); // 10000 - - if (logitechF310.getDUp()) { - CommonData.desiredShoulderAngle = Arm.Position.kTopShelf.shoulderPos; - CommonData.desiredElbowAngle = Arm.Position.kTopShelf.elbowPos; - } - else if (logitechF310.getDDown()) { - CommonData.desiredShoulderAngle = Arm.Position.kMiddleShelfOrHumanPlayer.shoulderPos; - CommonData.desiredElbowAngle = Arm.Position.kMiddleShelfOrHumanPlayer.elbowPos; - } - else if (logitechF310.getA()) { - CommonData.desiredShoulderAngle = Arm.Position.kGroundPickup.shoulderPos; - CommonData.desiredElbowAngle = Arm.Position.kGroundPickup.elbowPos; - } - else if (logitechF310.getB()) { - CommonData.desiredShoulderAngle = Arm.Position.kHome.shoulderPos; - CommonData.desiredElbowAngle = Arm.Position.kHome.elbowPos; - } - else if (logitechF310.getY()) - { - CommonData.desiredShoulderAngle = Arm.Position.kHumanPlayerStation.shoulderPos; - CommonData.desiredElbowAngle = Arm.Position.kHumanPlayerStation.elbowPos; - } - - if (logitechF310.getLeftBumper()) { - CommonData.clawState = Claw.State.kOpen; - } - else if (logitechF310.getRightBumper()) { - CommonData.clawState = Claw.State.kClosed; - } - } - - @Override - public void disabledInit() { - CommonData.clawState = Claw.State.kClosed; - CommonData.sideSpeed = 0; - CommonData.desiredTurn = 0; - CommonData.forwardSpeed = 0; - CommonData.balance = false; - - autonomous = null; - xbox360.rumbleOff(); - - CommonData.counter = 0; - - // "Zero" out the rest of the variables (as they are added) to safe, sensible default values - } - - @Override - public void disabledPeriodic() { - } - - @Override - public void testInit() { - CommonData.calibrate = true; - } - - @Override - public void testPeriodic() { - } - - @Override - public void simulationInit() { - } - - @Override - public void simulationPeriodic() { - } -} diff --git a/2022-2023/main-bot/src/main/java/frc/robot/Utility.java b/2022-2023/main-bot/src/main/java/frc/robot/Utility.java deleted file mode 100755 index 7bfabf5..0000000 --- a/2022-2023/main-bot/src/main/java/frc/robot/Utility.java +++ /dev/null @@ -1,36 +0,0 @@ -package frc.robot; - -import java.lang.Math; - -public class Utility { - static int printCounter = 0; - - public static void printLn(String messageString) { - if (printCounter == 50) { - System.out.println(messageString); - printCounter = 0; - } - else { - printCounter++; - } - } - - public static double sigmoid(double x) { - return 1 / (1 + Math.pow(Math.E, -x)); - } - - public static double clamp(double value, double min, double max) { - return value < min ? min : value > max ? max - : value; - } - - public static double snapToEdge(double value, double min, double max, double threshold) { - if (value < -threshold) { - return min; - } - if (value > threshold) { - return max; - } - return value; - } -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/settings/ArmSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/ArmSettings.java deleted file mode 100755 index bba8fdb..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/ArmSettings.java +++ /dev/null @@ -1,6 +0,0 @@ -package frc.settings; - -public class ArmSettings { - public int shoulderMotorID; - public int elbowMotorID; -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/settings/ClawSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/ClawSettings.java deleted file mode 100755 index 5ea966d..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/ClawSettings.java +++ /dev/null @@ -1,9 +0,0 @@ -package frc.settings; - -public class ClawSettings { - - public int openingPortId; - public int closingPortId; - public int pneumaticsModuleId; - -} diff --git a/2022-2023/main-bot/src/main/java/frc/settings/LimitedMotorSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/LimitedMotorSettings.java deleted file mode 100755 index fe28273..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/LimitedMotorSettings.java +++ /dev/null @@ -1,8 +0,0 @@ -package frc.settings; - -public class LimitedMotorSettings { - - public int motorID; - - public double[] limits; -} diff --git a/2022-2023/main-bot/src/main/java/frc/settings/Settings.java b/2022-2023/main-bot/src/main/java/frc/settings/Settings.java deleted file mode 100755 index c5f3e73..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/Settings.java +++ /dev/null @@ -1,11 +0,0 @@ -package frc.settings; - -public class Settings { - - public SwerveDriveSettings swerveDrive; - public ClawSettings clawSettings; - public ArmSettings armSettings; - - public int controllerID; - public int auxControllerID; -} diff --git a/2022-2023/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java deleted file mode 100755 index 298a4de..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java +++ /dev/null @@ -1,9 +0,0 @@ -package frc.settings; - -public class SwerveDriveSettings { - - public SwerveWheelSettings FLSwerve; - public SwerveWheelSettings FRSwerve; - public SwerveWheelSettings BLSwerve; - public SwerveWheelSettings BRSwerve; -} diff --git a/2022-2023/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java deleted file mode 100755 index 3cc9110..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java +++ /dev/null @@ -1,20 +0,0 @@ -package frc.settings; - -public class SwerveWheelSettings { - - public int driveID; - public int turnID; - public int encoderID; - - public enum Location { - front, - back - } - - public Location location; - - public double defensiveAngle; - - public double posX; - public double posY; -} \ No newline at end of file diff --git a/2022-2023/main-bot/src/main/java/frc/settings/WristSettings.java b/2022-2023/main-bot/src/main/java/frc/settings/WristSettings.java deleted file mode 100755 index 3d99e4d..0000000 --- a/2022-2023/main-bot/src/main/java/frc/settings/WristSettings.java +++ /dev/null @@ -1,11 +0,0 @@ -package frc.settings; - -public class WristSettings { - - public int wristMotorId; - public double wristMotorPower; - public double wristEncoderOffset; - - public int[] wristLimits; - -} diff --git a/2022-2023/main-bot/src/main/java/frc/state_machine/State.java b/2022-2023/main-bot/src/main/java/frc/state_machine/State.java deleted file mode 100755 index f0764f3..0000000 --- a/2022-2023/main-bot/src/main/java/frc/state_machine/State.java +++ /dev/null @@ -1,17 +0,0 @@ -package frc.state_machine; - -public abstract class State { - - public void onEnter() { - } - - public void onExit() { - } - - public boolean isValid() { - return true; - } - - // Returns 'true' when state is finished - public abstract boolean run(); -} diff --git a/2022-2023/main-bot/src/main/java/frc/state_machine/StateMachine.java b/2022-2023/main-bot/src/main/java/frc/state_machine/StateMachine.java deleted file mode 100755 index 83f8364..0000000 --- a/2022-2023/main-bot/src/main/java/frc/state_machine/StateMachine.java +++ /dev/null @@ -1,31 +0,0 @@ -package frc.state_machine; - -import java.util.ArrayList; -import java.util.List; - -public class StateMachine { - - State m_currentState; - List m_states = new ArrayList(); - - public void addState(State state) { - m_states.add(state); - } - - public void run() { - if (!m_states.isEmpty()) { - if (m_currentState == null && m_states.get(0).isValid()) { - m_currentState = m_states.get(0); - m_currentState.onEnter(); - m_states.remove(0); - } - } - - if (m_currentState != null) { - if (m_currentState.run()) { - m_currentState.onExit(); - m_currentState = null; - } - } - } -} diff --git a/2022-2023/main-bot/vendordeps/NavX.json b/2022-2023/main-bot/vendordeps/NavX.json deleted file mode 100755 index 29ec93a..0000000 --- a/2022-2023/main-bot/vendordeps/NavX.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "fileName": "NavX.json", - "name": "KauaiLabs_navX_FRC", - "version": "2023.0.3", - "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", - "mavenUrls": [ - "https://dev.studica.com/maven/release/2023/" - ], - "jsonUrl": "https://dev.studica.com/releases/2023/NavX.json", - "javaDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-java", - "version": "2023.0.3" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-cpp", - "version": "2023.0.3", - "headerClassifier": "headers", - "sourcesClassifier": "sources", - "sharedLibrary": false, - "libName": "navx_frc", - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "linuxraspbian", - "linuxarm32", - "linuxarm64", - "linux86-64", - "osxuniversal", - "windowsx86-64" - ] - } - ] -} \ No newline at end of file diff --git a/2022-2023/main-bot/vendordeps/PhoenixProAnd5.json b/2022-2023/main-bot/vendordeps/PhoenixProAnd5.json deleted file mode 100755 index 3975753..0000000 --- a/2022-2023/main-bot/vendordeps/PhoenixProAnd5.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "fileName": "PhoenixProAnd5.json", - "name": "CTRE-Phoenix (Pro And v5)", - "version": "23.0.5", - "frcYear": 2023, - "uuid": "3fcf3402-e646-4fa6-971e-18afe8173b1a", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixProAnd5-frc2023-latest.json", - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.30.4" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.30.4" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "wpiapi-java", - "version": "23.0.5" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.30.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.30.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "tools", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProCANcoder", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProPigeon2", - "version": "23.0.5", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.30.4", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.30.4", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.30.4", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "tools", - "version": "23.0.5", - "libName": "CTRE_PhoenixTools", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "5.30.4", - "libName": "CTRE_Phoenix_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "api-cpp-sim", - "version": "5.30.4", - "libName": "CTRE_PhoenixSim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.30.4", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.5", - "libName": "CTRE_PhoenixTools_Sim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.5", - "libName": "CTRE_SimTalonSRX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.5", - "libName": "CTRE_SimTalonFX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.5", - "libName": "CTRE_SimVictorSPX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.5", - "libName": "CTRE_SimPigeonIMU", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.5", - "libName": "CTRE_SimCANCoder", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.5", - "libName": "CTRE_SimProTalonFX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProCANcoder", - "version": "23.0.5", - "libName": "CTRE_SimProCANcoder", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProPigeon2", - "version": "23.0.5", - "libName": "CTRE_SimProPigeon2", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "wpiapi-cpp", - "version": "23.0.5", - "libName": "CTRE_PhoenixPro_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "23.0.5", - "libName": "CTRE_PhoenixPro_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - } - ] -} \ No newline at end of file diff --git a/2022-2023/main-bot/vendordeps/WPILibNewCommands.json b/2022-2023/main-bot/vendordeps/WPILibNewCommands.json deleted file mode 100755 index da4bc52..0000000 --- a/2022-2023/main-bot/vendordeps/WPILibNewCommands.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "fileName": "WPILibNewCommands.json", - "name": "WPILib-New-Commands", - "version": "1.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", - "linuxarm32", - "linuxarm64", - "windowsx86-64", - "windowsx86", - "linuxx86-64", - "osxuniversal" - ] - } - ] -} diff --git a/2023-2024/main-bot/.gitignore b/2023-2024/main-bot/.gitignore deleted file mode 100644 index 3325f5c..0000000 --- a/2023-2024/main-bot/.gitignore +++ /dev/null @@ -1,172 +0,0 @@ -# This gitignore has been specially created by the WPILib team. -# If you remove items from this file, intellisense might break. - -### C++ ### -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### Gradle ### -.gradle -/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -# # VS Code Specific Java Settings -# DO NOT REMOVE .classpath and .project -.classpath -.project -.settings/ -bin/ - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ -out/ - -# Fleet -.fleet - -# Simulation GUI and other tools window save file -*-window.json diff --git a/2023-2024/main-bot/.wpilib/wpilib_preferences.json b/2023-2024/main-bot/.wpilib/wpilib_preferences.json deleted file mode 100644 index c9d5bc0..0000000 --- a/2023-2024/main-bot/.wpilib/wpilib_preferences.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "enableCppIntellisense": false, - "currentLanguage": "java", - "projectYear": "2024beta", - "teamNumber": 5098 -} \ No newline at end of file diff --git a/2023-2024/main-bot/gradle/wrapper/gradle-wrapper.jar b/2023-2024/main-bot/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7f93135..0000000 Binary files a/2023-2024/main-bot/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/2023-2024/main-bot/networktables.json b/2023-2024/main-bot/networktables.json deleted file mode 100644 index fe51488..0000000 --- a/2023-2024/main-bot/networktables.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/2023-2024/main-bot/simgui-ds.json b/2023-2024/main-bot/simgui-ds.json deleted file mode 100644 index 73cc713..0000000 --- a/2023-2024/main-bot/simgui-ds.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "keyboardJoysticks": [ - { - "axisConfig": [ - { - "decKey": 65, - "incKey": 68 - }, - { - "decKey": 87, - "incKey": 83 - }, - { - "decKey": 69, - "decayRate": 0.0, - "incKey": 82, - "keyRate": 0.009999999776482582 - } - ], - "axisCount": 3, - "buttonCount": 4, - "buttonKeys": [ - 90, - 88, - 67, - 86 - ], - "povConfig": [ - { - "key0": 328, - "key135": 323, - "key180": 322, - "key225": 321, - "key270": 324, - "key315": 327, - "key45": 329, - "key90": 326 - } - ], - "povCount": 1 - }, - { - "axisConfig": [ - { - "decKey": 74, - "incKey": 76 - }, - { - "decKey": 73, - "incKey": 75 - } - ], - "axisCount": 2, - "buttonCount": 4, - "buttonKeys": [ - 77, - 44, - 46, - 47 - ], - "povCount": 0 - }, - { - "axisConfig": [ - { - "decKey": 263, - "incKey": 262 - }, - { - "decKey": 265, - "incKey": 264 - } - ], - "axisCount": 2, - "buttonCount": 6, - "buttonKeys": [ - 260, - 268, - 266, - 261, - 269, - 267 - ], - "povCount": 0 - }, - { - "axisCount": 0, - "buttonCount": 0, - "povCount": 0 - } - ] -} diff --git a/2023-2024/main-bot/simgui.json b/2023-2024/main-bot/simgui.json deleted file mode 100644 index 449f4b1..0000000 --- a/2023-2024/main-bot/simgui.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "NTProvider": { - "types": { - "/FMSInfo": "FMSInfo" - } - } -} diff --git a/2023-2024/main-bot/src/main/deploy/example.txt b/2023-2024/main-bot/src/main/deploy/example.txt deleted file mode 100644 index bb82515..0000000 --- a/2023-2024/main-bot/src/main/deploy/example.txt +++ /dev/null @@ -1,3 +0,0 @@ -Files placed in this directory will be deployed to the RoboRIO into the -'deploy' directory in the home folder. Use the 'Filesystem.getDeployDirectory' wpilib function -to get a proper path relative to the deploy directory. \ No newline at end of file diff --git a/2023-2024/main-bot/src/main/deploy/robot_settings.json b/2023-2024/main-bot/src/main/deploy/robot_settings.json deleted file mode 100755 index 755d3d0..0000000 --- a/2023-2024/main-bot/src/main/deploy/robot_settings.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "controllerID": 0, - "auxControllerID": 1, - "swerveDrive": { - "FLSwerve": { - "driveID": 1, - "turnID": 2, - "encoderID": 10, - "location": "front", - "defensiveAngle": 315, - "posY": -0.23, - "posX": 0.36 - }, - "FRSwerve": { - "driveID": 7, - "turnID": 8, - "encoderID": 12, - "location": "front", - "defensiveAngle": 45, - "posY": 0.23, - "posX": 0.36 - }, - "BLSwerve": { - "driveID": 3, - "turnID": 4, - "encoderID": 11, - "location": "back", - "defensiveAngle": 45, - "posY": -0.23, - "posX": -0.36 - }, - "BRSwerve": { - "driveID": 5, - "turnID": 6, - "encoderID": 9, - "location": "back", - "defensiveAngle": 315, - "posY": 0.23, - "posX": -0.36 - } - } -} \ No newline at end of file diff --git a/2023-2024/main-bot/src/main/java/frc/CommonData.java b/2023-2024/main-bot/src/main/java/frc/CommonData.java deleted file mode 100644 index fe2b21a..0000000 --- a/2023-2024/main-bot/src/main/java/frc/CommonData.java +++ /dev/null @@ -1,164 +0,0 @@ -package frc; - -/** -* Data used by other classes. -*

-* This is used to store data that needs to be accessed by multiple classes. -*

-*/ -public final class CommonData { - - // Swerve Drive Variables // - - /** - * desiredTurn is the desired angle of the robot. - */ - private static double desiredTurn; - - /** - * forwardSpeed is the desired forward and backward speed of the robot. - */ - private static double forwardSpeed; - - /** - * sideSpeed is the desired left and right speed of the robot. - */ - private static double sideSpeed; - - /** - * battenDownTheHatches is used to control the defensive stance. - */ - private static boolean battenDownTheHatches; - - // NavX Variables // - - /** - * calibrate is used to determine if the NavX should be calibrated. - */ - private static boolean calibrate; - - // Autonomous Varaibles // - - /** - * counter is used in the state machine to see what state the robot is in. - */ - private static int counter; - - // Constructor // - // This is set to private as this is a utility class and - // should not be instantiated - private CommonData() { - throw new UnsupportedOperationException( - "This is a utility class and cannot be instantiated"); - } - - // Accesor Methods // - - /** - * Method for returning desiredTurn. - *s - * @return desiredTurn - */ - public static double getDesiredTurn() { - return desiredTurn; - } - - /** - * Method for setting the desiredTurn. - * - * @param value value to set desiredTurn - */ - public static void setDesiredTurn(final double value) { - desiredTurn = value; - } - - /** - * Method for returning forwardSpeed. - * - * @return forwardSpeed - */ - public static double getForwardSpeed() { - return forwardSpeed; - } - - /** - * Method for setting forwardSpeed. - * - * @param value value to set forwardSpeed - */ - public static void setForwardSpeed(final double value) { - forwardSpeed = value; - } - - /** - * Method for returning sideSpeed. - * - * @return sideSpeed - */ - public static double getSideSpeed() { - return sideSpeed; - } - - /** - * Method for setting sideSpeed. - * - * @param value value to set sideSpeed - */ - public static void setSideSpeed(final double value) { - sideSpeed = value; - } - - /** - * Method for returning battenDownTheHatches. - * - * @return battenDownTheHatches - */ - public static boolean getBattenDownTheHatches() { - return battenDownTheHatches; - } - - /** - * Method for setting battenDownTheHatches. - * - * @param value value to set battenDownTheHatches - */ - public static void setBattenDownTheHatches(final boolean value) { - battenDownTheHatches = value; - } - - /** - * Method for returning calibrate. - * - * @return calibrate - */ - public static boolean getCalibrate() { - return calibrate; - } - - /** - * Method for setting calibrate. - * - * @param value value to set calibrate - */ - public static void setCalibrate(final boolean value) { - calibrate = value; - } - - /** - * Method for returning counter. - * - * @return counter - */ - public static int getCounter() { - return counter; - } - - /** - * Method for setting counter. - * - * @param value value to set counter - */ - public static void setCounter(final int value) { - counter = value; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/components/IComponent.java b/2023-2024/main-bot/src/main/java/frc/components/IComponent.java deleted file mode 100755 index 2f57cf7..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/IComponent.java +++ /dev/null @@ -1,18 +0,0 @@ -package frc.components; - -/** - * Interface for components. - */ -public interface IComponent { - - // This is an interface. - // If a class implements any interface, - // it must have all of the methods in that interface. - // The methods defined in an interface are abstract, - // meaning they have no body. - - /** - * Method for updating the component. - */ - void update(); -} diff --git a/2023-2024/main-bot/src/main/java/frc/components/SwerveDrive.java b/2023-2024/main-bot/src/main/java/frc/components/SwerveDrive.java deleted file mode 100755 index 38ff9db..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/SwerveDrive.java +++ /dev/null @@ -1,132 +0,0 @@ -package frc.components; - -import com.kauailabs.navx.frc.AHRS; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.kinematics.SwerveDriveKinematics; -import edu.wpi.first.wpilibj.SPI; -import frc.CommonData; -import frc.settings.SwerveDriveSettings; - -public class SwerveDrive implements IComponent { - - /** - * Overall Equation: - * - * Motor roations per second: - * Motor rotations per minute / 60 - * - * Wheel rotations per second: - * Motor rotations per second / gear ratio - * - * Wheel radius (in ft): - * Wheel diameter (in ft) / 2 - * or - * Wheel radius (in inches) / 12 - * - * Wheel circumference (in ft): - * Wheel radius (in ft) * 2 * pi - * - * Speed (in ft/s): - * Wheel rotations per second * wheel circumference (in ft) - * - * Total Equation: - * (Motor rotations per minute / 60) / gear ratio * wheel circumference - * (in ft) - * - * Note: The way it is lined out in the code is different but it still - * functions the same. - * - * Note: Phoenix 6 has a Swerve Drive API that can be utilized. - * It may be worth looking into. - * - * Note: These values are *not* correct for our current frame. - * These are for the 2022-2023 robot, they need to be updated. - */ - - /** - * The Falcon 500's RPM. - */ - private final static int FALCON_RPM = 6380; - - /** - * Gear ratio of the swerve modules. - */ - private final static double GEAR_RATIO = 3; - - /** - * Wheel circumference in feet. - */ - private final static double WHEEL_CIRCUMFERENCE = 0.3191858136; - - /** - * The maximum speed of the robot. - * - *

- * 60 is used to convert from minutes to seconds. - *

- */ - private final static double MAX_SPEED = (FALCON_RPM * WHEEL_CIRCUMFERENCE) / 60 / GEAR_RATIO; - - /** - * The maximum rotation of the robot. - */ - private final static double MAX_ROTATION = (MAX_SPEED * 2 * Math.PI) / 2.7389195456 / 2; - - // The 2.7389195456 value still needs to be documented - - /** - * The offset of the yaw. - */ - double yawOffset = 0; - - /** - * The constructor for the SwerveDrive class. - * @param settings The settings for the swerve drive. - */ - public SwerveDrive(final SwerveDriveSettings settings) { - swerveWheels = new SwerveWheel[] { - new SwerveWheel(settings.getFLSwerveSettings()), - new SwerveWheel(settings.getFRSwerveSettings()), - new SwerveWheel(settings.getBLSwerveSettings()), - new SwerveWheel(settings.getBRSwerveSettings()) - }; - - kinematics = new SwerveDriveKinematics(swerveWheels[0].getSwervePos(), swerveWheels[1].getSwervePos(), swerveWheels[2].getSwervePos(), swerveWheels[3].getSwervePos()); - } - - SwerveWheel[] swerveWheels; - - double leftOrRight; - double forwardOrBack; // This is the forward or back speed - - private AHRS ahrs = new AHRS(SPI.Port.kMXP); - - private SwerveDriveKinematics kinematics; - - public void update() { - - // Calabrate The NavX - if (CommonData.getCalibrate()) { - CommonData.setCalibrate(false); - yawOffset = ahrs.getYaw(); - } - - // Set to an if statement so the defensive code takes priority over driving - if (CommonData.getBattenDownTheHatches()) { - for (int i = 0; i < 4; i++) { - swerveWheels[i].defense(); - } - } - else { - final var desiredTranslationSpeedX = CommonData.getForwardSpeed() * MAX_SPEED; // This code uses '+x' as toward opposing alliance wall - final var desiredTranslationSpeedY = -CommonData.getSideSpeed() * MAX_SPEED; // This code uses '+y' as toward driver's right - final var desiredRotationSpeed = -CommonData.getDesiredTurn() * MAX_ROTATION; - var moduleStates = kinematics.toSwerveModuleStates(ChassisSpeeds.fromFieldRelativeSpeeds(desiredTranslationSpeedX, desiredTranslationSpeedY, desiredRotationSpeed, Rotation2d.fromDegrees(ahrs.getYaw()))); - - for (int i = 0; i < 4; i++) { - swerveWheels[i].set(moduleStates[i]); - } - } - } // Man that's a lot of curly braces -} diff --git a/2023-2024/main-bot/src/main/java/frc/components/SwerveWheel.java b/2023-2024/main-bot/src/main/java/frc/components/SwerveWheel.java deleted file mode 100755 index c845d21..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/SwerveWheel.java +++ /dev/null @@ -1,76 +0,0 @@ -package frc.components; - -import com.ctre.phoenix.motorcontrol.ControlMode; -import com.ctre.phoenix.motorcontrol.can.TalonFX; -import com.ctre.phoenix.sensors.CANCoder; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import frc.settings.SwerveWheelSettings; -import frc.settings.SwerveWheelSettings.Location; - -public class SwerveWheel -{ - TalonFX turnMotor; - TalonFX driveMotor; - CANCoder encoder; - - // 0.238125 Meters - // 0.365125 Meters - - Translation2d modulePos; - - double defensiveAngle; - - Location location; - - public SwerveWheel(SwerveWheelSettings settings) - { - turnMotor = new TalonFX(settings.getTurnID()); - driveMotor = new TalonFX(settings.getDriveID()); - encoder = new CANCoder(settings.getEncoderID()); - - location = settings.getLocation(); - defensiveAngle = settings.getDefensiveAngle(); - - modulePos = new Translation2d(settings.getPosX(), settings.getPosY()); - } - - public void set(SwerveModuleState swerveModuleState) { - - // TODO: Add documentation for this so each value is explained - swerveModuleState = SwerveModuleState.optimize(swerveModuleState, Rotation2d.fromDegrees(turnMotor.getSelectedSensorPosition() / 11.3777778)); - double maximumSpeed = (6380 * 0.3191858136) / 60 / 3; - - final double desiredTurnPos = swerveModuleState.angle.getDegrees() * 11.3777778; // conversion from degrees to native encoder value - - turnMotor.set(ControlMode.Position, desiredTurnPos); - - driveMotor.set(ControlMode.PercentOutput, swerveModuleState.speedMetersPerSecond / maximumSpeed); - // Using Velocity Can Be Used For Better Control But Percent Output Is Better Used For Practice - } - - public void defense() { - - // TODO: Add documentation for the 11.77777777 value - turnMotor.set(ControlMode.Position, defensiveAngle * 11.77777777); - driveMotor.set(ControlMode.PercentOutput, 0); - } - - public TalonFX getTurnMotor() { - return turnMotor; - } - - public TalonFX getDriveMotor() { - return driveMotor; - } - - public Translation2d getSwervePos() { - return modulePos; - } - - // public void battenDownTheHatches() - // { - // set(defensiveAngle, 0, 0); - // } -} \ No newline at end of file diff --git a/2023-2024/main-bot/src/main/java/frc/components/autonomous/Autonomous.java b/2023-2024/main-bot/src/main/java/frc/components/autonomous/Autonomous.java deleted file mode 100755 index 79a1cce..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/autonomous/Autonomous.java +++ /dev/null @@ -1,58 +0,0 @@ -package frc.components.autonomous; - -import frc.components.IComponent; -import frc.state_machine.StateMachine; - -/** - * Autonomous component. - *

- * This class is used for autonomous mode. - * It sets up a state machine and excutes the states contained. - *

- *

- * If you want to add a new state, see the constructor. - * {@link frc.components.autonomous.Autonomous#Autonomous()} - *

- * This class implements the - * {@link frc.components.IComponent IComponent} interface. - *

- * - * @see frc.state_machine.StateMachine - */ -public final class Autonomous implements IComponent { - - - /** - * State machine object. - */ - private StateMachine stateMachine = new StateMachine(); - - /** - * Autonomous constructor. - *

- * This is where new states are added to the state machine. - * Any state added here will be run during autonomous in - * the order they are added. - *

- *

- * You can add states by using the following code: - * - *

-     * stateMachine.addState(new StateName());
-     * 
- * - * Any added states must also exist in this directory as separate - * classes. - *

- * - * @see frc.components.autonomous.DriveState1 - */ - public Autonomous() { - stateMachine.addState(new DriveState1()); - } - - @Override - public void update() { - stateMachine.run(); - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/components/autonomous/DriveState1.java b/2023-2024/main-bot/src/main/java/frc/components/autonomous/DriveState1.java deleted file mode 100644 index 2f8576c..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/autonomous/DriveState1.java +++ /dev/null @@ -1,60 +0,0 @@ -package frc.components.autonomous; - -import edu.wpi.first.wpilibj.Timer; -import frc.CommonData; -import frc.state_machine.State; - -/** - * The first drive state during autonomous mode. - *

- * This state drives the robot forward at 35% speed for 3 seconds - *

- */ -public final class DriveState1 extends State { - - /** - * The forward speed of the robot. - */ - private static final double FORWARD_SPEED = 0.35; - - /** - * The time the robot drives forward. - */ - private static final int DRIVE_TIME = 3; - - /** - * Timer object. - */ - private Timer timer; - - @Override - public void onEnter() { - // Mainly used for debugging - System.out.println("Drive State 1 entered"); - } - - @Override - public void onExit() { - // Mainly used for debugging - System.out.println("Drive State 1 exited"); - } - - @Override - public boolean run() { - - // Set the values so it drives forward at a speed of 35% in reverse - CommonData.setForwardSpeed(-FORWARD_SPEED); - CommonData.setDesiredTurn(0); - - // Set a new timer if one doesn't exist already - if (timer == null) { - timer = new Timer(); - timer.start(); - // If the timer has elapses 3 seconds, exit the state - } else if (timer.hasElapsed(DRIVE_TIME)) { - return true; - } - - return false; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/components/autonomous/package-info.java b/2023-2024/main-bot/src/main/java/frc/components/autonomous/package-info.java deleted file mode 100644 index 8fa5a28..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/autonomous/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains classes that are used to run autonomous. - */ -package frc.components.autonomous; diff --git a/2023-2024/main-bot/src/main/java/frc/components/package-info.java b/2023-2024/main-bot/src/main/java/frc/components/package-info.java deleted file mode 100644 index 74893cd..0000000 --- a/2023-2024/main-bot/src/main/java/frc/components/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Package used to organize all of the components of the robot. - *

- * These components can include the drivetrain, an arm, an intake, etc. - *

- */ -package frc.components; diff --git a/2023-2024/main-bot/src/main/java/frc/controllers/LogitechF310.java b/2023-2024/main-bot/src/main/java/frc/controllers/LogitechF310.java deleted file mode 100755 index 74a8997..0000000 --- a/2023-2024/main-bot/src/main/java/frc/controllers/LogitechF310.java +++ /dev/null @@ -1,463 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.Joystick; - -/** - * This class is used to create an LogitechF310 controller object. - *

- * This class uses the {@code Joystick} class from the wpilibj library. - *

- *

- * This uses a deadband that can be set if needed. This helps control drift. - * This value can be in a range of 0 to 1. The higher the value, the more the - * stick has to move to register. This value is set in the constructor and is - * set alongside the controller ID. As a note: The deadband is only applied - * to the joystick axes. - *

- * - * @see PS4 - * @see Xbox - * - * @see edu.wpi.first.wpilibj.Joystick - */ -public class LogitechF310 { - - // Button IDs // - - /** - * The axis ID for the left joystick x. - */ - private static final int JOYSTICK_LEFT_X = 0; - - /** - * The axis ID for the left joystick y. - */ - private static final int JOYSTICK_LEFT_Y = 1; - - /** - * The axis ID for the left trigger. - */ - private static final int TRIGGER_LEFT = 2; - - /** - * The axis ID for the right trigger. - */ - private static final int TRIGGER_RIGHT = 3; - - /** - * The axis ID for the right joystick x. - */ - private static final int JOYSTICK_RIGHT_X = 4; - - /** - * The axis ID for the right joystick y. - */ - private static final int JOYSTICK_RIGHT_Y = 5; - - /** - * The button ID for the A button. - */ - private static final int BUTTON_A = 1; - - /** - * The button ID for the B button. - */ - private static final int BUTTON_B = 2; - - /** - * The button ID for the X button. - */ - private static final int BUTTON_X = 3; - - /** - * The button ID for the Y button. - */ - private static final int BUTTON_Y = 4; - - /** - * The button ID for the left bumper. - */ - private static final int BUTTON_LEFT_BUMPER = 5; - - /** - * The button ID for the right bumper. - */ - private static final int BUTTON_RIGHT_BUMPER = 6; - - /** - * The button ID for the start button. - */ - private static final int BUTTON_START = 7; - - /** - * The button ID for the back button. - */ - private static final int BUTTON_BACK = 8; - - /** - * The controller object. - * In this case, a {@code Joystick} object. - * - * @see edu.wpi.first.wpilibj.Joystick - */ - private Joystick controller; - - /** - * The deadband value. - */ - private double deadBand; - - /** - * Constructor for the LogitechF310 class. - *

- * This constructor is used to create a LogitechF310 object. - * This takes in the controller ID and the deadband value. - *

- * - * @param id Controller ID (Port) - * @param deadBandValue Deadband value - */ - public LogitechF310(final int id, final double deadBandValue) { - controller = new Joystick(id); - deadBand = deadBandValue; - } - - // Deadband Method // - - /** - * Method for setting the deadband of the controller on the X and Y axes. - *

- * This sets a threshold the joystick must pass before registering a value. - * This value can be in a range of 0 to 1. The higher the value, - * the more the joystick has to move to register. - *

- * - * @return Deadbanded value - * - * @param value Value to be deadbanded - */ - private double deadBand(final double value) { - return Math.abs(value) < deadBand ? 0 : value; - } - - // Joystick Methods // - - /** - * Method for returning the X value of the left joystick. - * - * @return X value of the left joystick - * - * @see LogitechF310#getRightX - * @see LogitechF310#getRightY - * @see LogitechF310#getLeftY - */ - public double getLeftX() { - return deadBand(controller.getRawAxis(JOYSTICK_LEFT_X)); - } - - /** - * Method for returning the Y value of the left joystick. - * - * @return Y value of the left joystick - * - * @see LogitechF310#getRightX - * @see LogitechF310#getRightY - * @see LogitechF310#getLeftX - */ - public double getLeftY() { - return deadBand(controller.getRawAxis(JOYSTICK_LEFT_Y)); - } - - /** - * Method for returning the X value of the right joystick. - * - * @return X value of the right joystick - * - * @see LogitechF310#getRightY - * @see LogitechF310#getLeftX - * @see LogitechF310#getLeftY - */ - public double getRightX() { - return deadBand(controller.getRawAxis(JOYSTICK_RIGHT_X)); - } - - /** - * Method for returning the Y value of the right joystick. - * - * @return Y value of the right joystick - * - * @see LogitechF310#getRightX - * @see LogitechF310#getLeftX - * @see LogitechF310#getLeftY - */ - public double getRightY() { - return deadBand(controller.getRawAxis(JOYSTICK_RIGHT_Y)); - } - - // Trigger Methods // - - /** - * Method for returning the value of the left trigger. - * - * @return Value of the left trigger - * - * @see LogitechF310#getRightTrigger - */ - public double getLeftTrigger() { - return deadBand(controller.getRawAxis(TRIGGER_LEFT)); - } - - /** - * Method for returning the value of the right trigger. - * - * @return Value of the right trigger - * - * @see LogitechF310#getLeftTrigger - */ - public double getRightTrigger() { - return deadBand(controller.getRawAxis(TRIGGER_RIGHT)); - } - - // Button Methods // - - /** - * Method for returning the value of the A button. - * - * @return Value of the A button - * - * @see LogitechF310#getBButton - * @see LogitechF310#getXButton - * @see LogitechF310#getYButton - */ - public boolean getAButton() { - return controller.getRawButton(BUTTON_A); - } - - /** - * Method for returning the value of the B button. - * - * @return Value of the B button - * - * @see LogitechF310#getAButton - * @see LogitechF310#getXButton - * @see LogitechF310#getYButton - */ - public boolean getBButton() { - return controller.getRawButton(BUTTON_B); - } - - /** - * Method for returning the value of the X button. - * - * @return Value of the X button - * - * @see LogitechF310#getAButton - * @see LogitechF310#getBButton - * @see LogitechF310#getYButton - */ - public boolean getXButton() { - return controller.getRawButton(BUTTON_X); - } - - /** - * Method for returning the value of the Y button. - * - * @return Value of the Y button - * - * @see LogitechF310#getAButton - * @see LogitechF310#getBButton - * @see LogitechF310#getXButton - */ - public boolean getYButton() { - return controller.getRawButton(BUTTON_Y); - } - - /** - * Method for returning the value of the back button. - * - * @return Value of the back button - * - * @see LogitechF310#getStartButton - */ - public boolean getBackButton() { - return controller.getRawButton(BUTTON_START); - } - - /** - * Method for returning the value of the start button. - * - * @return Value of the start button - * - * @see LogitechF310#getBackButton - */ - public boolean getStartButton() { - return controller.getRawButton(BUTTON_BACK); - } - - /** - * Method for returning the value of the left bumper. - * - * @return Value of the left bumper - * - * @see LogitechF310#getRightBumper - */ - public boolean getLeftBumper() { - return controller.getRawButton(BUTTON_LEFT_BUMPER); - } - - /** - * Method for returning the value of the right bumper. - * - * @return Value of the right bumper - * - * @see LogitechF310#getLeftBumper - */ - public boolean getRightBumper() { - return controller.getRawButton(BUTTON_RIGHT_BUMPER); - } - - // D-Pad Methods // - - public enum DPad { - /** - * Up on the D-Pad. - */ - up, - - /** - * Down on the D-Pad. - */ - down, - - /** - * Right on the D-Pad. - */ - left, - - /** - * Left on the D-Pad. - */ - right, - - /** - * Up-Right on the D-Pad. - */ - upright, - - /** - * Up-Left on the D-Pad. - */ - upleft, - - /** - * Down-Right on the D-Pad. - */ - downright, - - /** - * Down-Left on the D-Pad. - */ - downleft, - - /** - * No direction on the D-Pad. - */ - none - } - - /** - * Upright D-Pad POV value. - */ - private static final int DPAD_UPRIGHT = 45; - - /** - * Right D-Pad POV value. - */ - private static final int DPAD_RIGHT = 90; - - /** - * Downright D-Pad POV value. - */ - private static final int DPAD_DOWNRIGHT = 135; - - /** - * Down POV D-Pad value. - */ - private static final int DPAD_DOWN = 180; - - /** - * Downleft D-Pad POV value. - */ - private static final int DPAD_DOWNLEFT = 225; - - /** - * Left D-Pad POV value. - */ - private static final int DPAD_LEFT = 270; - - /** - * Upleft D-Pad POV value. - */ - private static final int DPAD_UPLEFT = 315; - - /** - * Up D-Pad POV value. - */ - private static final int DPAD_UP = 360; - - /** - * Method for returning the value of the D-Pad. - * - * @return value of the D-Pad - * - * @see LogitechF310.DPad - */ - public DPad getDPad() { - switch (controller.getPOV()) { - case 0: - return DPad.up; - case DPAD_UPRIGHT: - return DPad.upright; - case DPAD_RIGHT: - return DPad.right; - case DPAD_DOWNRIGHT: - return DPad.downright; - case DPAD_DOWN: - return DPad.down; - case DPAD_DOWNLEFT: - return DPad.downleft; - case DPAD_LEFT: - return DPad.left; - case DPAD_UPLEFT: - return DPad.upleft; - case DPAD_UP: - return DPad.up; - default: - return DPad.none; - } - } - - // Rumble Methods // - - // This controller does not have rumble functionality :( - - // General Methods // - - /** - * Method for checking if the controller is connected. - * - * @return true if the controller is connected, false if not - */ - public boolean isConnected() { - return (controller.isConnected()); - } - - /** - * Method for getting the name of the controller. - * - * @return name of the controller - */ - public String getName() { - return controller.getName(); - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/controllers/PS4.java b/2023-2024/main-bot/src/main/java/frc/controllers/PS4.java deleted file mode 100644 index cef2652..0000000 --- a/2023-2024/main-bot/src/main/java/frc/controllers/PS4.java +++ /dev/null @@ -1,498 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.PS4Controller; -import edu.wpi.first.wpilibj.GenericHID.RumbleType; - -/** - * This class is used to create an PS4 controller object. - *

- * This class uses the {@code PS4Controller} class from the wpilibj library. - *

- *

- * This uses a deadband that can be set if needed. This helps control drift. - * This value can be in a range of 0 to 1. The higher the value, the more the - * stick has to move to register. This value is set in the constructor and is - * set alongside the controller ID. As a note: The deadband is only applied - * to the joystick axes. - *

- * - * @see LogitechF310 - * @see Xbox - * - * @see edu.wpi.first.wpilibj.PS4Controller - */ -public class PS4 { - - /** - * The controller object. - * In this case, a {@code PS4Controller} object. - * - * @see edu.wpi.first.wpilibj.PS4Controller - */ - private PS4Controller controller; - - /** - * The deadband value. - */ - private double deadBand; - - /** - * Constructor for the PS4 class. - *

- * This constructor is used to create a LogitechF310 object. - * This takes in the controller ID and the deadband value. - *

- * - * @param id Controller ID (Port) - * @param deadBandValue Deadband value - */ - public PS4(final int id, final double deadBandValue) { - controller = new PS4Controller(id); - deadBand = deadBandValue; - } - - // Deadband Method // - - // Although this isn't really needed for newer controllers, - // it's still here just in case one might develop drift - - /** - * Method for setting the deadband of the controller on the X and Y axes. - *

- * This sets a threshold the joystick must pass before registering a value. - * This value can be in a range of 0 to 1. The higher the value, - * the more the joystick has to move to register. - *

- * - * @return Deadbanded value - * - * @param value Value to be deadbanded - */ - private double deadBand(final double value) { - return Math.abs(value) < deadBand ? 0 : value; - } - - // Joystick Methods // - - /** - * Method for returning the X value of the left joystick. - * - * @return X value of the left joystick - * - * @see PS4#getRightX - * @see PS4#getRightY - * @see PS4#getLeftY - */ - public double getLeftX() { - return deadBand(controller.getLeftX()); - } - - /** - * Method for returning the Y value of the left joystick. - * - * @return Y value of the left joystick - * - * @see PS4#getRightX - * @see PS4#getRightY - * @see PS4#getLeftX - */ - public double getLeftY() { - return deadBand(controller.getLeftY()); - } - - /** - * Method for returning the X value of the right joystick. - * - * @return X value of the right joystick - * - * @see PS4#getLeftX - * @see PS4#getRightY - * @see PS4#getLeftY - */ - public double getRightX() { - return deadBand(controller.getRightX()); - } - - /** - * Method for returning the Y value of the right joystick. - * - * @return Y value of the right joystick - * - * @see PS4#getRightX - * @see PS4#getLeftX - * @see PS4#getLeftY - */ - public double getRightY() { - return deadBand(controller.getRightY()); - } - - // Trigger Methods // - - /** - * Method for returning the value of the left trigger. - * - * @return value of the left trigger - * - * @see PS4#getRightTrigger - */ - public double getLeftTrigger() { - return deadBand(controller.getL2Axis()); - } - - /** - * Method for returning the value of the right trigger. - * - * @return value of the right trigger - * - * @see PS4#getLeftTrigger - */ - public double getRightTrigger() { - return deadBand(controller.getR2Axis()); - } - - // Button Methods // - - /** - * Method for returning the value of the X button. - * - * @return value of the X button - * - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getXButton() { - return controller.getCrossButton(); - } - - /** - * Method for returning the value of the Square button. - * - * @return value of the Square button - * - * @see PS4#getXButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getSquareButton() { - return controller.getSquareButton(); - } - - /** - * Method for returning the value of the Circle button. - * - * @return value of the Circle button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getCircleButton() { - return controller.getCircleButton(); - } - - /** - * Method for returning the value of the Triangle button. - * - * @return value of the Triangle button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getTriangleButton() { - return controller.getTriangleButton(); - } - - /** - * Method for returning the value of the Share button. - * - * @return value of the Share button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getShareButton() { - return controller.getShareButton(); - } - - /** - * Method for returning the value of the Options button. - * - * @return value of the Options button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getPlayStationButton - * @see PS4#getTouchpadButton - */ - public boolean getOptionsButton() { - return controller.getOptionsButton(); - } - - /** - * Method for returning the value of the PlayStation button. - * - * @return value of the PlayStation button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getTouchpadButton - */ - public boolean getPlayStationButton() { - return controller.getPSButton(); - } - - /** - * Method for returning the value of the left bumper. - * - * @return value of the left bumper - * - * @see PS4#getRightBumper - */ - public boolean getLeftBumper() { - return controller.getL1Button(); - } - - /** - * Method for returning the value of the right bumper. - * - * @return value of the right bumper - * - * @see PS4#getLeftBumper - */ - public boolean getRightBumper() { - return controller.getR1Button(); - } - - /** - * Method for returning the value of the left joystick button. - * - * @return value of the left joystick button - * - * @see PS4#getRightJoystickButton - */ - public boolean getLeftJoystickButton() { - return controller.getL3Button(); - } - - /** - * Method for returning the value of the right joystick button. - * - * @return value of the right joystick button - * - * @see PS4#getLeftJoystickButton - */ - public boolean getRightJoystickButton() { - return controller.getR3Button(); - } - - // Touchpad Methods // - - /** - * Method for returning the value of the Touchpad button. - * - * @return value of the Touchpad button - * - * @see PS4#getXButton - * @see PS4#getSquareButton - * @see PS4#getCircleButton - * @see PS4#getTriangleButton - * @see PS4#getShareButton - * @see PS4#getOptionsButton - * @see PS4#getPlayStationButton - */ - public boolean getTouchpadButton() { - return controller.getTouchpad(); - } - - // There is a 'touchpad' that uses an event loop - // but for the purpose of this class, it is not needed - // It might be added in a future version if there becomes a need for it - // If you have a need for it or have added it yourself, - // Submit a pull request or submit an issue on the GitHub repository - // https://github.com/J-The-Fox/FRC-Team-5098 - - // D-Pad Methods // - - public enum DPad { - /** - * Up on the D-Pad. - */ - up, - - /** - * Down on the D-Pad. - */ - down, - - /** - * Right on the D-Pad. - */ - left, - - /** - * Left on the D-Pad. - */ - right, - - /** - * Up-Right on the D-Pad. - */ - upright, - - /** - * Up-Left on the D-Pad. - */ - upleft, - - /** - * Down-Right on the D-Pad. - */ - downright, - - /** - * Down-Left on the D-Pad. - */ - downleft, - - /** - * No direction on the D-Pad. - */ - none - } - - /** - * Upright D-Pad POV value. - */ - private static final int DPAD_UPRIGHT = 45; - - /** - * Right D-Pad POV value. - */ - private static final int DPAD_RIGHT = 90; - - /** - * Downright D-Pad POV value. - */ - private static final int DPAD_DOWNRIGHT = 135; - - /** - * Down POV D-Pad value. - */ - private static final int DPAD_DOWN = 180; - - /** - * Downleft D-Pad POV value. - */ - private static final int DPAD_DOWNLEFT = 225; - - /** - * Left D-Pad POV value. - */ - private static final int DPAD_LEFT = 270; - - /** - * Upleft D-Pad POV value. - */ - private static final int DPAD_UPLEFT = 315; - - /** - * Up D-Pad POV value. - */ - private static final int DPAD_UP = 360; - - /** - * Method for returning the value of the D-Pad. - * - * @return value of the D-Pad - * - * @see PS4.DPad - */ - public DPad getDPad() { - switch (controller.getPOV()) { - case 0: - return DPad.up; - case DPAD_UPRIGHT: - return DPad.upright; - case DPAD_RIGHT: - return DPad.right; - case DPAD_DOWNRIGHT: - return DPad.downright; - case DPAD_DOWN: - return DPad.down; - case DPAD_DOWNLEFT: - return DPad.downleft; - case DPAD_LEFT: - return DPad.left; - case DPAD_UPLEFT: - return DPad.upleft; - case DPAD_UP: - return DPad.up; - default: - return DPad.none; - } - } - - // Rumble Methods // - - /** - * Method for setting the rumble of the controller. - * - * @param type type of rumble to set - * @param value value to set the rumble to - * - * @see edu.wpi.first.wpilibj.GenericHID.RumbleType - */ - public void setRumble(final RumbleType type, final double value) { - controller.setRumble(type, value); - } - - // General Methods // - - /** - * Method for checking if the controller is connected. - * - * @return true if the controller is connected, false if not - */ - public boolean isConnected() { - return (controller.isConnected()); - } - - /** - * Method for getting the name of the controller. - * - * @return name of the controller - */ - public String getName() { - return controller.getName(); - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/controllers/Xbox.java b/2023-2024/main-bot/src/main/java/frc/controllers/Xbox.java deleted file mode 100644 index c8cc131..0000000 --- a/2023-2024/main-bot/src/main/java/frc/controllers/Xbox.java +++ /dev/null @@ -1,425 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.XboxController; -import edu.wpi.first.wpilibj.GenericHID.RumbleType; - -/** - * This class is used to create an Xbox controller object. - *

- * This class uses the {@code XboxController} class from the wpilibj library. - *

- *

- * This uses a deadband that can be set if needed. This helps control drift. - * This value can be in a range of 0 to 1. The higher the value, the more the - * stick has to move to register. This value is set in the constructor and is - * set alongside the controller ID. As a note: The deadband is only applied - * to the joystick axes. - *

- * - * @see LogitechF310 - * @see PS4 - * - * @see edu.wpi.first.wpilibj.XboxController - */ -public class Xbox { - - /** - * The controller object. - * In this case, a {@code XboxController} object. - */ - private XboxController controller; - - /** - * The deadband value. - */ - private double deadBand; - - /** - * Constructor for the Xbox class. - *

- * This constructor is used to create a LogitechF310 object. - * This takes in the controller ID and the deadband value. - *

- * - * @param id Controller ID (Port) - * @param deadBandValue Deadband value - */ - public Xbox(final int id, final double deadBandValue) { - controller = new XboxController(id); - deadBand = deadBandValue; - } - - // Deadband Method // - - // Although this isn't really needed for newer controllers, - // it's still here just in case one might develop drift - - /** - * Method for setting the deadband of the controller on the X and Y axes. - *

- * This sets a threshold the joystick must pass before registering a value. - * This value can be in a range of 0 to 1. The higher the value, - * the more the joystick has to move to register. - *

- * - * @return Deadbanded value - * - * @param value Value to be deadbanded - */ - private double deadBand(final double value) { - return Math.abs(value) < deadBand ? 0 : value; - } - - // Joystick Methods // - - /** - * Method for returning the X value of the left joystick. - * - * @return X value of the left joystick - * - * @see Xbox#getRightX - * @see Xbox#getRightY - * @see Xbox#getLeftY - */ - public double getLeftX() { - return deadBand(controller.getLeftX()); - } - - /** - * Method for returning the Y value of the left joystick. - * - * @return Y value of the left joystick - * - * @see Xbox#getRightX - * @see Xbox#getRightY - * @see Xbox#getLeftX - */ - public double getLeftY() { - return deadBand(controller.getLeftY()); - } - - /** - * Method for returning the X value of the right joystick. - * - * @return X value of the right joystick - * - * @see Xbox#getRightY - * @see Xbox#getLeftX - * @see Xbox#getLeftY - */ - public double getRightX() { - return deadBand(controller.getRightX()); - } - - /** - * Method for returning the Y value of the right joystick. - * - * @return Y value of the right joystick - * - * @see Xbox#getRightX - * @see Xbox#getLeftX - * @see Xbox#getLeftY - */ - public double getRightY() { - return deadBand(controller.getRightY()); - } - - // Trigger Methods // - - /** - * Method for returning the value of the left trigger. - * - * @return value of the left trigger - * - * @see Xbox#getRightTrigger - */ - public double getLeftTrigger() { - return controller.getLeftTriggerAxis(); - } - - /** - * Method for returning the value of the right trigger. - * - * @return value of the right trigger - * - * @see Xbox#getLeftTrigger - */ - public double getRightTrigger() { - return controller.getRightTriggerAxis(); - } - - // Button Methods // - - /** - * Method for returning the value of the A button. - * - * @return value of the A button - * - * @see Xbox#getBButton - * @see Xbox#getXButton - * @see Xbox#getYButton - */ - public boolean getAButton() { - return controller.getAButton(); - } - - /** - * Method for returning the value of the B button. - * - * @return value of the B button - * - * @see Xbox#getAButton - * @see Xbox#getXButton - * @see Xbox#getYButton - */ - public boolean getBButton() { - return controller.getBButton(); - } - - /** - * Method for returning the value of the X button. - * - * @return value of the X button - * - * @see Xbox#getAButton - * @see Xbox#getBButton - * @see Xbox#getYButton - */ - public boolean getXButton() { - return controller.getXButton(); - } - - /** - * Method for returning the value of the Y button. - * - * @return value of the Y button - * - * @see Xbox#getAButton - * @see Xbox#getBButton - * @see Xbox#getXButton - */ - public boolean getYButton() { - return controller.getYButton(); - } - - /** - * Method for returning the value of the start button. - * - * @return value of the start button - * - * @see Xbox#getBackButton - */ - public boolean getStartButton() { - return controller.getStartButton(); - } - - /** - * Method for returning the value of the back button. - * - * @return value of the back button - * - * @see Xbox#getStartButton - */ - public boolean getBackButton() { - return controller.getBackButton(); - } - - /** - * Method for returning the value of the left bumper. - * - * @return value of the left bumper - * - * @see Xbox#getRightBumper - */ - public boolean getLeftBumper() { - return controller.getLeftBumper(); - } - - /** - * Method for returning the value of the right bumper. - * - * @return value of the right bumper - * - * @see Xbox#getLeftBumper - */ - public boolean getRightBumper() { - return controller.getRightBumper(); - } - - /** - * Method for returning the value of the left stick button. - * - * @return value of the left stick button - * - * @see Xbox#getRightStickButton - */ - public boolean getLeftStickButton() { - return controller.getLeftStickButton(); - } - - /** - * Method for returning the value of the right stick button. - * - * @return value of the right stick button - * - * @see Xbox#getLeftStickButton - */ - public boolean getRightStickButton() { - return controller.getRightStickButton(); - } - - // D-Pad Methods // - - public enum DPad { - /** - * Up on the D-Pad. - */ - up, - - /** - * Down on the D-Pad. - */ - down, - - /** - * Right on the D-Pad. - */ - left, - - /** - * Left on the D-Pad. - */ - right, - - /** - * Up-Right on the D-Pad. - */ - upright, - - /** - * Up-Left on the D-Pad. - */ - upleft, - - /** - * Down-Right on the D-Pad. - */ - downright, - - /** - * Down-Left on the D-Pad. - */ - downleft, - - /** - * No direction on the D-Pad. - */ - none - } - - /** - * Upright D-Pad POV value. - */ - private static final int DPAD_UPRIGHT = 45; - - /** - * Right D-Pad POV value. - */ - private static final int DPAD_RIGHT = 90; - - /** - * Downright D-Pad POV value. - */ - private static final int DPAD_DOWNRIGHT = 135; - - /** - * Down POV D-Pad value. - */ - private static final int DPAD_DOWN = 180; - - /** - * Downleft D-Pad POV value. - */ - private static final int DPAD_DOWNLEFT = 225; - - /** - * Left D-Pad POV value. - */ - private static final int DPAD_LEFT = 270; - - /** - * Upleft D-Pad POV value. - */ - private static final int DPAD_UPLEFT = 315; - - /** - * Up D-Pad POV value. - */ - private static final int DPAD_UP = 360; - - /** - * Method for returning the value of the D-Pad. - * - * @return value of the D-Pad - * - * @see Xbox.DPad - */ - public DPad getDPad() { - switch (controller.getPOV()) { - case 0: - return DPad.up; - case DPAD_UPRIGHT: - return DPad.upright; - case DPAD_RIGHT: - return DPad.right; - case DPAD_DOWNRIGHT: - return DPad.downright; - case DPAD_DOWN: - return DPad.down; - case DPAD_DOWNLEFT: - return DPad.downleft; - case DPAD_LEFT: - return DPad.left; - case DPAD_UPLEFT: - return DPad.upleft; - case DPAD_UP: - return DPad.up; - default: - return DPad.none; - } - } - - // Rumble Methods // - - /** - * Method for setting the rumble of the controller. - * - * @param type type of rumble to set - * @param value value to set the rumble to - * - * @see edu.wpi.first.wpilibj.GenericHID.RumbleType - */ - public void setRumble(final RumbleType type, final double value) { - controller.setRumble(type, value); - } - - // General Methods // - - /** - * Method for checking if the controller is connected. - * - * @return true if the controller is connected, false if not - */ - public boolean isConnected() { - return (controller.isConnected()); - } - - /** - * Method for getting the name of the controller. - * - * @return name of the controller - */ - public String getName() { - return controller.getName(); - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/controllers/package-info.java b/2023-2024/main-bot/src/main/java/frc/controllers/package-info.java deleted file mode 100644 index 80793a8..0000000 --- a/2023-2024/main-bot/src/main/java/frc/controllers/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Holds controller classes - *

- * This can be used to hold both custom and pre-made controller classes. - *

- */ -package frc.controllers; diff --git a/2023-2024/main-bot/src/main/java/frc/package-info.java b/2023-2024/main-bot/src/main/java/frc/package-info.java deleted file mode 100644 index 36e2dec..0000000 --- a/2023-2024/main-bot/src/main/java/frc/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Main package for robot code. - *

- * All code that is deployed to the robot would be located under this package. - *

- */ -package frc; diff --git a/2023-2024/main-bot/src/main/java/frc/robot/Robot.java b/2023-2024/main-bot/src/main/java/frc/robot/Robot.java deleted file mode 100644 index a48cbab..0000000 --- a/2023-2024/main-bot/src/main/java/frc/robot/Robot.java +++ /dev/null @@ -1,176 +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 frc.robot; - -// Imports // -import java.io.IOException; -import com.fasterxml.jackson.databind.ObjectMapper; -import edu.wpi.first.wpilibj.Filesystem; -import edu.wpi.first.wpilibj.TimedRobot; -import frc.CommonData; -import frc.components.IComponent; -import frc.components.SwerveDrive; -import frc.components.autonomous.Autonomous; -import frc.controllers.Xbox; -import frc.controllers.PS4; -import edu.wpi.first.wpilibj.GenericHID.RumbleType; -import frc.settings.Settings; - -/** -* The VM is configured to automatically run this class, -* and to call the functions corresponding to -* each mode, as described in the TimedRobot documentation. -* If you change the name of this class or -* the package after creating this project, -* you must also update the build.gradle file in the -* project. -*/ -public final class Robot extends TimedRobot { - - /** - * The settings object. - * This is used to store the settings from the robot_settings.json file. - */ - private static Settings settings; - static { - ObjectMapper mapper = new ObjectMapper(); - try { - var filepath = Filesystem.getDeployDirectory().toPath().resolve( - "robot_settings.json" - ); - settings = mapper.readValue(filepath.toFile(), Settings.class); - } - catch (IOException ex) { - System.out.println(ex.toString()); - } - } - - // Initialize the controllers // - // NOTE: This might be used for a more dynamic way of selecting controllers - - /** - * The main controller. - * This is used for the main driver. - *

- * This is an {@code Xbox} object. - *

- *

- * Notice: This might be changed in the future. - *

- */ - private Xbox controller = new Xbox(settings.getControllerID(), 0); - /** - * The auxiliary controller. - * This is used for the auxiliary driver. - *

- * This is a {@code PS4} object. - *

- *

- * Notice: This might be changed in the future. - *

- */ - private PS4 auxController = new PS4(settings.getAuxControllerID(), 0); - - // Set up the components - /** - * The components array. - * This is used to store all of the components. - *

- * This is an array of {@code IComponent} objects. - *

- *

- * Note: More components will be added here. - *

- */ - private IComponent[] components = new IComponent[] { - new SwerveDrive(settings.getSwerveDriveSettings()) - }; - - /** - * The autonomous object. - */ - private Autonomous autonomous; - - @Override - public void robotInit() { - } - - @Override - public void robotPeriodic() { - - // For each component in the components array, update it - // This calls the update method in each of the component classes - // Since this in the robotPeriodic method, - // this will apply to all modes (autonomous, teleop, etc.) - for (var actuator : components) - { - actuator.update(); - } - } - - @Override - public void autonomousInit() { - autonomous = new Autonomous(); - // Calibrate the gyro before autonomous to ensure that it is accurate - CommonData.setCalibrate(true); - } - - @Override - public void autonomousPeriodic() { - // Update the autonomous states - autonomous.update(); - } - - @Override - public void teleopInit() { - } - - @Override - public void teleopPeriodic() { - - // Update the controller values // - - // Update values for the Swerve Drive - CommonData.setBattenDownTheHatches(controller.getXButton()); - CommonData.setSideSpeed(controller.getLeftX()); - CommonData.setForwardSpeed(controller.getLeftY()); - CommonData.setDesiredTurn(Utility.snapToEdge(-controller.getRightX(), -1, 1, 0.9)); - } - - @Override - public void disabledInit() { - - // "Turn off" all functions of the robot // - - CommonData.setDesiredTurn(0); // Set the turn speed to 0 - CommonData.setForwardSpeed(0); // Set the drive speed to 0 - - // Turn off the rumble on any controllers - controller.setRumble(RumbleType.kBothRumble, 0); - auxController.setRumble(RumbleType.kBothRumble, 0); - - CommonData.setCounter(0); // Set the counter to 0 (used in autonomous) - } - - @Override - public void disabledPeriodic() { - } - - @Override - public void testInit() { - } - - @Override - public void testPeriodic() { - } - - @Override - public void simulationInit() { - } - - @Override - public void simulationPeriodic() { - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/robot/Utility.java b/2023-2024/main-bot/src/main/java/frc/robot/Utility.java deleted file mode 100755 index 24e4f9b..0000000 --- a/2023-2024/main-bot/src/main/java/frc/robot/Utility.java +++ /dev/null @@ -1,88 +0,0 @@ -package frc.robot; - -/** - * The {@code Utility} class is used to store general methods that are used - * throughout the code. - *

- * Current methods include: - *

- * Additional methods may be added in the future if and when they are needed. - *

- */ -public final class Utility { - - // Constructor // - // This is set to private as this is a utility class and - // should not be instantiated - private Utility() { - throw new UnsupportedOperationException( - "This is a utility class and cannot be instantiated"); - } - - /** - * The {@code printCounter} variable is used to count how many times the - * {@code System.out.println} method has been called. - * This is used in the {@link Utility#printLn} method. - */ - private static int printCounter = 0; - - /** - * The {@code printLn} method is used to print a message to the - * console every 50 times it is called. - * This is to slow down the messages as it overwhlems the roboRIO - * and causes the console to lag. - * - * @param messageString String to print to the console - * - * @see Utility#printCounter - */ - public static void printLn(final String messageString) { - if (printCounter == 50) { - System.out.println(messageString); - printCounter = 0; - } else { - printCounter++; - } - } - - /** - * The {@code clamp} method is used to clamp a value between a minimum and - * maximum value. - *

- * If the value is less than the minimum, the minimum is returned. - * If the value is greater than the maximum, the maximum is returned. - * If the value is between the minimum and maximum, the value is returned. - *

- * - * @param value Value to clamp - * @param min Minimum value - * @param max Maximum value - * - * @return The clamped value - */ - public static double clamp(final double value, final double min, final double max) { - return value < min ? min : value > max ? max : value; - } - - /** - * Snap a value to the minimum or maximum value only if it is within a - * threshold. - * Although similar to the {@link Utility#clamp} method, - * this method is used to snap a value to the minimum or maximum value - * if it iswithin a threshold - * - * @param value Value to snap - * @param min Minimum value - * @param max Maximum value - * @param threshold Threshold to snap to - * - * @return The snapped value - */ - public static double snapToEdge(final double value, final double min, final double max, final double threshold) { - return value < -threshold ? min : value > threshold ? max : value; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/robot/package-info.java b/2023-2024/main-bot/src/main/java/frc/robot/package-info.java deleted file mode 100644 index 20c110b..0000000 --- a/2023-2024/main-bot/src/main/java/frc/robot/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Holds primary robot methods - *

- * This package is automatically created when creating a new robot project. - *

- */ -package frc.robot; diff --git a/2023-2024/main-bot/src/main/java/frc/settings/Settings.java b/2023-2024/main-bot/src/main/java/frc/settings/Settings.java deleted file mode 100755 index b7ddb3e..0000000 --- a/2023-2024/main-bot/src/main/java/frc/settings/Settings.java +++ /dev/null @@ -1,77 +0,0 @@ -package frc.settings; - -/** - * The settings object. - *

- * This is used to store the settings from the robot_settings.json file. - *

- */ -public class Settings { - - /** - * The swerve drive settings. - */ - private SwerveDriveSettings swerveDrive; - - // These might change to be more dynamic if possible - - /** - * The controller ID. - */ - private int controllerID; - - /** - * The auxiliary controller ID. - */ - private int auxControllerID; - - // Accessor Methods // - - /** - * Get the swerve drive settings. - * @return The swerve drive settings. - */ - public SwerveDriveSettings getSwerveDriveSettings() { - return swerveDrive; - } - - /** - * Set the swerve drive settings. - * @param settings The swerve drive settings. - */ - public void setSwerveDriveSettings(final SwerveDriveSettings settings) { - swerveDrive = settings; - } - - /** - * Get the controller ID. - * @return The controller ID. - */ - public int getControllerID() { - return controllerID; - } - - /** - * Set the controller ID. - * @param id The controller ID. - */ - public void setControllerID(final int id) { - controllerID = id; - } - - /** - * Get the auxiliary controller ID. - * @return The auxiliary controller ID. - */ - public int getAuxControllerID() { - return auxControllerID; - } - - /** - * Set the auxiliary controller ID. - * @param id The auxiliary controller ID. - */ - public void setAuxControllerID(final int id) { - auxControllerID = id; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java b/2023-2024/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java deleted file mode 100755 index db1dfb4..0000000 --- a/2023-2024/main-bot/src/main/java/frc/settings/SwerveDriveSettings.java +++ /dev/null @@ -1,116 +0,0 @@ -package frc.settings; - -/** - * The swerve drive settings. - *

- * This is used to store the settings for the swerve drive. - * Each wheel has its own settings located in the {@link SwerveWheelSettings} - * class. - */ -public class SwerveDriveSettings { - - // NOTE: In this change from public to private, the way we currently read - // the settings file might be broken. This is because it relies on - // the fields being public as it has to be able to access them. These - // values have to be the same as what is in the JSON file. Since they - // are now private and have accessors, we might have to change the - // way we read these values. An alternative might be to use the - // SimpleJSON library instead of the Jackson library as it might - // allow us to access the fields without them being public. - // This needs further testing. - // - // - Jay - - /** - * The swerve wheel settings for the front left wheel. - */ - private SwerveWheelSettings flSwerve; - - /** - * The swerve wheel settings for the front right wheel. - */ - private SwerveWheelSettings frSwerve; - - /** - * The swerve wheel settings for the back left wheel. - */ - private SwerveWheelSettings blSwerve; - - /** - * The swerve wheel settings for the back right wheel. - */ - private SwerveWheelSettings brSwerve; - - // Accessor Methods // - - /** - * Get the swerve wheel settings for the front left wheel. - * @return The swerve wheel settings for the front left wheel. - */ - public SwerveWheelSettings getFLSwerveSettings() { - return flSwerve; - } - - /** - * Set the swerve wheel settings for the front left wheel. - * - * @param settings The swerve wheel settings for the front left wheel. - */ - public void setFLSwerveSettings(final SwerveWheelSettings settings) { - flSwerve = settings; - } - - /** - * Get the swerve wheel settings for the front right wheel. - * - * @return The swerve wheel settings for the front right wheel. - */ - public SwerveWheelSettings getFRSwerveSettings() { - return frSwerve; - } - - /** - * Set the swerve wheel settings for the front right wheel. - * - * @param settings The swerve wheel settings for the front right wheel. - */ - public void setFRSwerveSettings(final SwerveWheelSettings settings) { - frSwerve = settings; - } - - /** - * Get the swerve wheel settings for the back left wheel. - * - * @return The swerve wheel settings for the back left wheel. - */ - public SwerveWheelSettings getBLSwerveSettings() { - return blSwerve; - } - - /** - * Set the swerve wheel settings for the back left wheel. - * - * @param settings The swerve wheel settings for the back left wheel. - */ - public void setBLSwerveSettings(final SwerveWheelSettings settings) { - blSwerve = settings; - } - - /** - * Get the swerve wheel settings for the back right wheel. - * - * @return The swerve wheel settings for the back right wheel. - */ - public SwerveWheelSettings getBRSwerveSettings() { - return brSwerve; - } - - /** - * Set the swerve wheel settings for the back right wheel. - * - * @param settings The swerve wheel settings for the back right wheel. - */ - public void setBRSwerveSettings(final SwerveWheelSettings settings) { - brSwerve = settings; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java b/2023-2024/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java deleted file mode 100755 index 6a21874..0000000 --- a/2023-2024/main-bot/src/main/java/frc/settings/SwerveWheelSettings.java +++ /dev/null @@ -1,187 +0,0 @@ -package frc.settings; - -/** - * The swerve wheel settings. - *

- * This is used to store the settings for each swerve wheel. - *

- */ -public class SwerveWheelSettings { - - /** - * The drive motor ID. - */ - private int driveID; - - /** - * The turn motor ID. - */ - private int turnID; - - /** - * The encoder ID. - */ - private int encoderID; - - public enum Location { - /** - * Front of the robot. - */ - front, - - /** - * Back of the robot. - */ - back - } - - /** - * The location of the swerve wheel. - */ - private Location location; - - /** - * The angle of the swerve wheel to be in during defensive mode. - */ - private double defensiveAngle; - - /** - * The location of the swerve wheel in relation to the center of the robot. - * This is the X position. - */ - private double posX; - - /** - * The location of the swerve wheel in relation to the center of the robot. - * This is the Y position. - */ - private double posY; - - // Accessor Methods // - - /** - * Get the drive motor ID. - * - * @return The drive motor ID. - */ - public int getDriveID() { - return driveID; - } - - /** - * Set the drive motor ID. - * - * @param id The drive motor ID. - */ - public void setDriveID(final int id) { - driveID = id; - } - - /** - * Get the turn motor ID. - * - * @return The turn motor ID. - */ - public int getTurnID() { - return turnID; - } - - /** - * Set the turn motor ID. - * - * @param id The turn motor ID. - */ - public void setTurnID(final int id) { - turnID = id; - } - - /** - * Get the encoder ID. - * - * @return The encoder ID. - */ - public int getEncoderID() { - return encoderID; - } - - /** - * Set the encoder ID. - * - * @param id The encoder ID. - */ - public void setEncoderID(final int id) { - encoderID = id; - } - - /** - * Get the location of the swerve wheel. - * - * @return The location of the swerve wheel. - */ - public Location getLocation() { - return location; - } - - /** - * Set the location of the swerve wheel. - * - * @param loc The location of the swerve wheel. - */ - public void setLocation(final Location loc) { - location = loc; - } - - /** - * Get the angle of the swerve wheel to be in during defensive mode. - * - * @return The angle of the swerve wheel to be in during defensive mode. - */ - public double getDefensiveAngle() { - return defensiveAngle; - } - - /** - * Set the angle of the swerve wheel to be in during defensive mode. - * - * @param angle The angle of the swerve wheel - */ - public void setDefensiveAngle(final double angle) { - defensiveAngle = angle; - } - - /** - * Get the location of the swerve wheel. - * - * @return The location of the swerve wheel on the X axis. - */ - public double getPosX() { - return posX; - } - - /** - * Set the location of the swerve wheel. - * - * @param x The location of the swerve wheel on the X axis. - */ - public void setPosX(final double x) { - posX = x; - } - - /** - * Get the location of the swerve wheel. - * - * @return The location of the swerve wheel on the Y axis. - */ - public double getPosY() { - return posY; - } - - /** - * Set the location of the swerve wheel. - * - * @param y The location of the swerve wheel on the Y axis. - */ - public void setPosY(final double y) { - posY = y; - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/settings/package-info.java b/2023-2024/main-bot/src/main/java/frc/settings/package-info.java deleted file mode 100644 index 353657d..0000000 --- a/2023-2024/main-bot/src/main/java/frc/settings/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Holds settings for the robot. - *

- * These settings are gathered from the settings.json - * file located in the deploy directory. - *

- */ -package frc.settings; diff --git a/2023-2024/main-bot/src/main/java/frc/state_machine/State.java b/2023-2024/main-bot/src/main/java/frc/state_machine/State.java deleted file mode 100755 index d2450f0..0000000 --- a/2023-2024/main-bot/src/main/java/frc/state_machine/State.java +++ /dev/null @@ -1,37 +0,0 @@ -package frc.state_machine; - -/** -* Abstract class used to create states for the state machine. -*/ -public abstract class State { - - // Imported from 2022-2023 code - - /** - * Method called when a state is entered. - */ - public void onEnter() { - } - - /** - * Method called when a state is exited. - */ - public void onExit() { - } - - /** - * Method called to check if a state is valid. - * @return boolean - */ - public boolean isValid() { - return true; - } - - /** - * Method called to run a state. - * This method should return true when the state is finished - * - * @return boolean - */ - public abstract boolean run(); -} diff --git a/2023-2024/main-bot/src/main/java/frc/state_machine/StateMachine.java b/2023-2024/main-bot/src/main/java/frc/state_machine/StateMachine.java deleted file mode 100755 index 3d9e73f..0000000 --- a/2023-2024/main-bot/src/main/java/frc/state_machine/StateMachine.java +++ /dev/null @@ -1,52 +0,0 @@ -package frc.state_machine; - -import java.util.ArrayList; -import java.util.List; - -/** - * State Machine class for controlling a state machine. - * This is mainly used during auto. - * - * @see frc.components.autonomous.Autonomous - */ -public final class StateMachine { - - /** - * The current state of the state machine. - */ - private State currentState; - - /** - * The list of states to run. - */ - private List states = new ArrayList(); - - /** - * Adds a state to the state machine. - * - * @param state The state to add to the state machine. - */ - public void addState(final State state) { - states.add(state); - } - - /** - * Method called to run the state machine. - */ - public void run() { - if (!states.isEmpty()) { - if (currentState == null && states.get(0).isValid()) { - currentState = states.get(0); - currentState.onEnter(); - states.remove(0); - } - } - - if (currentState != null) { - if (currentState.run()) { - currentState.onExit(); - currentState = null; - } - } - } -} diff --git a/2023-2024/main-bot/src/main/java/frc/state_machine/package-info.java b/2023-2024/main-bot/src/main/java/frc/state_machine/package-info.java deleted file mode 100644 index 7486149..0000000 --- a/2023-2024/main-bot/src/main/java/frc/state_machine/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * State machine package. - *

- * This package contains all of the code for the state machine. - *

- */ -package frc.state_machine; diff --git a/2023-2024/main-bot/vendordeps/NavX.json b/2023-2024/main-bot/vendordeps/NavX.json deleted file mode 100644 index e978a5f..0000000 --- a/2023-2024/main-bot/vendordeps/NavX.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "fileName": "NavX.json", - "name": "NavX", - "version": "2024.1.0", - "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", - "frcYear": "2024", - "mavenUrls": [ - "https://dev.studica.com/maven/release/2024/" - ], - "jsonUrl": "https://dev.studica.com/releases/2024/NavX.json", - "javaDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-java", - "version": "2024.1.0" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-cpp", - "version": "2024.1.0", - "headerClassifier": "headers", - "sourcesClassifier": "sources", - "sharedLibrary": false, - "libName": "navx_frc", - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "linuxraspbian", - "linuxarm32", - "linuxarm64", - "linuxx86-64", - "osxuniversal", - "windowsx86-64" - ] - } - ] -} \ No newline at end of file diff --git a/2023-2024/main-bot/vendordeps/WPILibNewCommands.json b/2023-2024/main-bot/vendordeps/WPILibNewCommands.json deleted file mode 100644 index 67bf389..0000000 --- a/2023-2024/main-bot/vendordeps/WPILibNewCommands.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "fileName": "WPILibNewCommands.json", - "name": "WPILib-New-Commands", - "version": "1.0.0", - "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", - "frcYear": "2024", - "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", - "linuxarm32", - "linuxarm64", - "windowsx86-64", - "windowsx86", - "linuxx86-64", - "osxuniversal" - ] - } - ] -} diff --git a/Example_Project/.gitignore b/Example_Project/.gitignore deleted file mode 100644 index 3325f5c..0000000 --- a/Example_Project/.gitignore +++ /dev/null @@ -1,172 +0,0 @@ -# This gitignore has been specially created by the WPILib team. -# If you remove items from this file, intellisense might break. - -### C++ ### -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### Gradle ### -.gradle -/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -# # VS Code Specific Java Settings -# DO NOT REMOVE .classpath and .project -.classpath -.project -.settings/ -bin/ - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ -out/ - -# Fleet -.fleet - -# Simulation GUI and other tools window save file -*-window.json diff --git a/Example_Project/.wpilib/wpilib_preferences.json b/Example_Project/.wpilib/wpilib_preferences.json deleted file mode 100644 index 4062463..0000000 --- a/Example_Project/.wpilib/wpilib_preferences.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "enableCppIntellisense": false, - "currentLanguage": "java", - "projectYear": "2023", - "teamNumber": 5098 -} \ No newline at end of file diff --git a/Example_Project/WPILib-License.md b/Example_Project/WPILib-License.md deleted file mode 100644 index 064ccbe..0000000 --- a/Example_Project/WPILib-License.md +++ /dev/null @@ -1,26 +0,0 @@ -# WPILib License - -Copyright (c) 2009-2021 FIRST and other WPILib contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of FIRST, WPILib, nor the names of other WPILib - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Example_Project/build.gradle b/Example_Project/build.gradle deleted file mode 100644 index 5487988..0000000 --- a/Example_Project/build.gradle +++ /dev/null @@ -1,101 +0,0 @@ -plugins { - id "java" - id "edu.wpi.first.GradleRIO" version "2023.4.3" -} - -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 - -def ROBOT_MAIN_CLASS = "frc.robot.Main" - -// Define my targets (RoboRIO) and artifacts (deployable files) -// This is added by GradleRIO's backing project DeployUtils. -deploy { - targets { - roborio(getTargetTypeClass('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 = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) - - artifacts { - // First part is artifact name, 2nd is artifact type - // getTargetTypeClass is a shortcut to get the class type using a string - - frcJava(getArtifactTypeClass('FRCJavaArtifact')) { - } - - // Static files artifact - frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { - files = project.fileTree('src/main/deploy') - directory = '/home/lvuser/deploy' - } - } - } - } -} - -def deployArtifact = deploy.targets.roborio.artifacts.frcJava - -// Set to true to use debug for JNI. -wpi.java.debugJni = false - -// Set this to true to enable desktop support. -def includeDesktopSupport = false - -// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. -// Also defines JUnit 5. -dependencies { - implementation wpi.java.deps.wpilib() - implementation wpi.java.vendor.java() - - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) - - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) - - nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) - nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) - simulationDebug wpi.sim.enableDebug() - - nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) - nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) - simulationRelease wpi.sim.enableRelease() - - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' - - implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2' -} - -test { - useJUnitPlatform() - systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' -} - -// Simulation configuration (e.g. environment variables). -wpi.sim.addGui().defaultEnabled = true -wpi.sim.addDriverstation() - -// 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) - duplicatesStrategy = DuplicatesStrategy.INCLUDE -} - -// Configure jar and deploy tasks -deployArtifact.jarTask = jar -wpi.java.configureExecutableTasks(jar) -wpi.java.configureTestTasks(test) - -// Configure string concat to always inline compile -tasks.withType(JavaCompile) { - options.compilerArgs.add '-XDstringConcat=inline' -} diff --git a/Example_Project/gradle/wrapper/gradle-wrapper.jar b/Example_Project/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e583..0000000 Binary files a/Example_Project/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/Example_Project/gradle/wrapper/gradle-wrapper.properties b/Example_Project/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 7414769..0000000 --- a/Example_Project/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=permwrapper/dists diff --git a/Example_Project/gradlew b/Example_Project/gradlew deleted file mode 100755 index a69d9cb..0000000 --- a/Example_Project/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original 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 POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${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 "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# 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 ;; #( - MSYS* | 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" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/Example_Project/gradlew.bat b/Example_Project/gradlew.bat deleted file mode 100644 index 53a6b23..0000000 --- a/Example_Project/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@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 Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@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% equ 0 goto execute - -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 execute - -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 - -: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 %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 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! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/Example_Project/settings.gradle b/Example_Project/settings.gradle deleted file mode 100644 index ae1af1c..0000000 --- a/Example_Project/settings.gradle +++ /dev/null @@ -1,27 +0,0 @@ -import org.gradle.internal.os.OperatingSystem - -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - String frcYear = '2023' - 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/Example_Project/src/main/deploy/README.md b/Example_Project/src/main/deploy/README.md deleted file mode 100644 index 1f23064..0000000 --- a/Example_Project/src/main/deploy/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Deploy Directory - -> Copied from 'example.txt' - -Files placed in this directory will be deployed to the RoboRIO into the -'deploy' directory in the home folder. Use the 'Filesystem.getDeployDirectory' wpilib function -to get a proper path relative to the deploy directory. - -## Current Files - -The file `robot_settings.json` is stored in this directory as we need to read the settings from it, and so it needs to be deployed to the robot. -The `robot_settings.json` file works hand in hand with the `frc/settings` directory. Anything in the `robot_settings.json` file must also be in the `Settings.java` file as a type decleration for the setting to be pulled. -This is because of how we implemeted the library to read the json file. -In Python this would be done with the `json` module however Java has no library equivilant so it needs to be used differently. The settings are read and used in the `Robot.java` file. \ No newline at end of file diff --git a/Example_Project/src/main/deploy/robot_settings.json b/Example_Project/src/main/deploy/robot_settings.json deleted file mode 100755 index ad32576..0000000 --- a/Example_Project/src/main/deploy/robot_settings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "controllerID": 0, - "auxControllerID": 1, - "pneumaticSettings" : { - "pneumaticID": 0, - "largeSolenoidForwardChannelID": 0, - "largeSolenoidReverseChannelID": 1, - "smallSolenoidForwardChannelID": 2, - "smallSolenoidReverseChannelID": 3 - }, - "NavXSettings": { - "navXID": 0, - "navXPort": "kMXP", - "navXUpdateRate": 50 - }, - "ShuffleBoardSettings": { - "shuffleBoardPort": 5800 - } -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/CommonData.java b/Example_Project/src/main/java/frc/CommonData.java deleted file mode 100644 index e084fa0..0000000 --- a/Example_Project/src/main/java/frc/CommonData.java +++ /dev/null @@ -1,27 +0,0 @@ -package frc; - -import frc.components.Pneumatics; - -/** - * This is mainly for storing varaiables that are accessed by multiple classes that write and read to the same variable - * This is useful for storing things like a position of a motor, the location of a sensor, or a constant value - * This is also used as a means of organization - */ - -// import frc.components.Pneumatics.State; - -public class CommonData { - - // Pneumatics states - public static Pneumatics.State largeSolenoidState; - public static Pneumatics.State smallSolenoidState; - - // Gyro data from the NavX2 - public static double robotPitch; - public static double robotRoll; - public static double robotYaw; - - // Encoder data from the Spark Max and CANCoder - public static double canCoderPosition; - public static double sparkMaxEncoderPosition; -} diff --git a/Example_Project/src/main/java/frc/components/IComponent.java b/Example_Project/src/main/java/frc/components/IComponent.java deleted file mode 100644 index cb691b4..0000000 --- a/Example_Project/src/main/java/frc/components/IComponent.java +++ /dev/null @@ -1,14 +0,0 @@ -package frc.components; - -public interface IComponent { - - /** - * This is the interface for all components in this directory. - * It contains the update method that is called every 20 milliseconds during the robot's operation. - * This method is used to update the component with new data. - * - * It is called in the Robot.java file in the periodic() method. - */ - - public void update(); -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/components/Pneumatics.java b/Example_Project/src/main/java/frc/components/Pneumatics.java deleted file mode 100644 index d2bbf18..0000000 --- a/Example_Project/src/main/java/frc/components/Pneumatics.java +++ /dev/null @@ -1,53 +0,0 @@ -package frc.components; - -// Imports // -import edu.wpi.first.wpilibj.DoubleSolenoid; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; -import edu.wpi.first.wpilibj.PneumaticsModuleType; -import frc.CommonData; -import frc.settings.PneumaticsSettings; - -public class Pneumatics implements IComponent{ - - // Create an enum for the states of the solenoids - public enum State { - kOpen, - kClosed, - } - - // Create a new solenoid object - private DoubleSolenoid m_solenoidLarge; - private DoubleSolenoid m_solenoidSmall; - - public Pneumatics(PneumaticsSettings settings) { - // Set the settings for the solenoids using the settings in PneumaticsSettings.java - m_solenoidLarge = new DoubleSolenoid(settings.pneumaticsModuleID, PneumaticsModuleType.REVPH, settings.largeSolenoidForwardChannelID, settings.largeSolenoidReverseChannelID); - m_solenoidSmall = new DoubleSolenoid(settings.pneumaticsModuleID, PneumaticsModuleType.REVPH, settings.smallSolenoidForwardChannelID, settings.smallSolenoidReverseChannelID); - }; - - public void update(){ - - // Note: This assumes that the CommonData values are updated elsewhere - - // Update the solenoid state for the small solenoid - switch (CommonData.smallSolenoidState) - { - case kOpen: - m_solenoidSmall.set(Value.kForward); - break; - case kClosed: - m_solenoidSmall.set(Value.kReverse); - } - - // Update the solenoid state for the large solenoid - switch (CommonData.largeSolenoidState) - { - case kOpen: - m_solenoidLarge.set(Value.kForward); - break; - case kClosed: - m_solenoidLarge.set(Value.kReverse); - } - } -} - diff --git a/Example_Project/src/main/java/frc/components/ShuffleBoardController.java b/Example_Project/src/main/java/frc/components/ShuffleBoardController.java deleted file mode 100644 index 3e77d16..0000000 --- a/Example_Project/src/main/java/frc/components/ShuffleBoardController.java +++ /dev/null @@ -1,20 +0,0 @@ -package frc.components; - -// Local Imports -import frc.settings.ShuffleBoardSettings; -import frc.CommonData; - -public class ShuffleBoardController implements IComponent{ - // This is the ShuffleBoard Class. It contains methods and functions that are used to display data on the ShuffleBoard. - - - public ShuffleBoardController(ShuffleBoardSettings settings) { - // This is the ShuffleBoardSettings object. It contains all of the settings for the ShuffleBoard. - // It is initialized in the Settings.java file. - }; - - public void update(){ - // Place any Shuffleboard values here - } - -} diff --git a/Example_Project/src/main/java/frc/controllers/LogitechAttack3.java b/Example_Project/src/main/java/frc/controllers/LogitechAttack3.java deleted file mode 100755 index 3e220ed..0000000 --- a/Example_Project/src/main/java/frc/controllers/LogitechAttack3.java +++ /dev/null @@ -1,90 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.Joystick; - -// Imported From Code/2022/stingr/main-bot - -public class LogitechAttack3 -{ - private final Joystick controller; - - // These are the button and axis IDs for the Logitech F310 controller. - // They are constants because they will never change. - // They always start with a k as a naming convention. - private final int kXAxis = 0; - private final int kYAxis = 1; - private final int kSlider = 2; - private final int kTrigger = 1; - private final int kButton2 = 2; - private final int kButton3 = 3; - private final int kButton4 = 4; - private final int kButton5 = 5; - private final int kButton6 = 6; - private final int kButton7 = 7; - private final int kButton8 = 8; - private final int kButton9 = 9; - private final int kButton10 = 10; - private final int kButton11 = 11; - - public double getX() - { - return controller.getRawAxis(kXAxis); - } - public double getY() - { - return controller.getRawAxis(kYAxis); - } - public double getSlider() - { - return controller.getRawAxis(kSlider); - } - public boolean getTrigger() - { - return controller.getRawButton(kTrigger); - } - public boolean getButton2() - { - return controller.getRawButton(kButton2); - } - public boolean getButton3() - { - return controller.getRawButton(kButton3); - } - public boolean getButton4() - { - return controller.getRawButton(kButton4); - } - public boolean getButton5() - { - return controller.getRawButton(kButton5); - } - public boolean getButton6() - { - return controller.getRawButton(kButton6); - } - public boolean getButton7() - { - return controller.getRawButton(kButton7); - } - public boolean getButton8() - { - return controller.getRawButton(kButton8); - } - public boolean getButton9() - { - return controller.getRawButton(kButton9); - } - public boolean getButton10() - { - return controller.getRawButton(kButton10); - } - public boolean getButton11() - { - return controller.getRawButton(kButton11); - } - - public LogitechAttack3(int controllerPort) - { - controller = new Joystick(controllerPort); - } -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/controllers/LogitechF310.java b/Example_Project/src/main/java/frc/controllers/LogitechF310.java deleted file mode 100755 index 6e47c08..0000000 --- a/Example_Project/src/main/java/frc/controllers/LogitechF310.java +++ /dev/null @@ -1,184 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.Joystick; -import java.lang.Math; - -// Imported From Code/2022/stingr/main-bot -// Note: This is modified from the original code to add deadbanding - -public class LogitechF310 -{ - - // These are the button and axis IDs for the Logitech F310 controller. - // They are constants because they will never change. - // They always start with a k as a naming convention. - private final int kIdButtonA = 1; - private final int kIdButtonB = 2; - private final int kIdButtonX = 3; - private final int kIdButtonY = 4; - private final int kIdButtonBumperLeft = 5; - private final int kIdButtonBumperRight = 6; - private final int kIdAxisleftX = 0; - private final int kIdAxisleftY = 1; - private final int kIdAxisrightX = 4; - private final int kIdAxisrightY = 5; - private final int kIdlefttrigger = 2; - private final int kIdrighttrigger = 3; - private final int kIdDpad = 0; - - private Joystick controller; - - public double deadBand(double value) - { - return Math.abs(value) < 0.2 ? 0 : value; - } - - public LogitechF310(int id) - { - controller = new Joystick(id); - } - - public boolean getA() - { - return controller.getRawButton(kIdButtonA); - } - - public boolean getB() - { - return controller.getRawButton(kIdButtonB); - } - - public boolean getX() - { - return controller.getRawButton(kIdButtonX); - } - - public boolean getY() - { - return controller.getRawButton(kIdButtonY); - } - - public boolean getLeftBumper() - { - return controller.getRawButton(kIdButtonBumperLeft); - } - - public boolean getRightBumper() - { - return controller.getRawButton(kIdButtonBumperRight); - } - - public double getLeftStickX() - { - return deadBand(controller.getRawAxis(kIdAxisleftX)); - } - - public double getLeftStickY() - { - return deadBand(controller.getRawAxis(kIdAxisleftY)); - } - - public double getRightStickX() - { - return deadBand(controller.getRawAxis(kIdAxisrightX)); - } - - public double getRightStickY() - { - return deadBand(controller.getRawAxis(kIdAxisrightY)); - } - - public double getLeftTrigger() - { - return controller.getRawAxis(kIdlefttrigger); - } - - public double getRightTrigger() - { - return controller.getRawAxis(kIdrighttrigger); - } - - public boolean getDUp() - { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 315) - { - return true; - } - - if (degrees == 0) - { - return true; - } - - if (degrees == 45) - { - return true; - } - - return false; - } - - public boolean getDRight() - { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 45) - { - return true; - } - - if (degrees == 90) - { - return true; - } - - if (degrees == 135) - { - return true; - } - - return false; - } - - public boolean getDDown() - { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 135) - { - return true; - } - - if (degrees == 180) - { - return true; - } - - if (degrees == 225) - { - return true; - } - - return false; - } - - public boolean getDLeft() - { - int degrees = controller.getPOV(kIdDpad); - if (degrees == 225) - { - return true; - } - - if (degrees == 270) - { - return true; - } - - if (degrees == 315) - { - return true; - } - - return false; - } -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/controllers/README.md b/Example_Project/src/main/java/frc/controllers/README.md deleted file mode 100644 index b02e836..0000000 --- a/Example_Project/src/main/java/frc/controllers/README.md +++ /dev/null @@ -1,202 +0,0 @@ -# Controllers - -This folder is used to store the controller files that are used to intereact with the controllers we use to control the robot -Altough this folder is not required, it is useful for organization - -There are two main types of controllers that could be used. The standard controller such as an Xbox One, Logitech F310, etc and a joystick controller like the Logitech Attack 3. Both are similar to set up. Same functions and methods, just different IDs - -## Set Up - -There are few different types of inputs on a controller. Axis input for things like joysticks, Button input for standard buttons and POV input for d-pads. - -A few imports are used to set up a controller class: -- `edu.wpi.first.wpilibj.Joystick` - For getting input from the controller (Required) -- `edu.wpi.first.wpilibj.GenericHID.RumbleType` - For controlling rumble if the controller supports it (Optional) -- `java.lang.Math` - For adding a deadband if the controller drifts (Optional) - -**Setting Up The Joystick:** - -The Joystick import is responsible for getting all input from the controller. To set it up, you need to define an ID for that controller. (Which is set in the Driver Station by the order of the controllers. So the top one is ID 0, the second one is ID 1, etc.) - -The code below is used to set an ID for an Xbox360 controller when an Xbox360 instance is created - -> Remember to put the code in your class! - -Ex: -```java -public Xbox360(int ID) - { - joystick = new Joystick(ID); - } -``` - -Now that the joystick is created. It can be used to gather input from the controller. - -**Setting Up Buttons:** - -To take inputs from buttons on the controller you need to use the `joystick.getRawButton(ID)` method. -We can use this method inside of whatever function, in this case getA(), to get the input of the controller -The method will return a boolean so the function will also return a boolean - -> The ID for the getRawButton method will change depending on the button that you are getting. -> If you don't know the ID for the button, you can look online or check in the Driver Station. -> In the Driver Station, go to the controller menu and click on the desired controller. Hit the button you want to ID and look which square lights up. -> The position of the sqaure indicates the ID of the button - -Ex: -```java -public boolean getA() - { - return joystick.getRawButton(1); - } -``` - -You can repeat this for however many buttons you have on your controller, naming the functions accordingly - -**Setting Up Axis Inputs:** - -Setting up inputs for an axis is similar to that of a controller except using the `joystick.getRawAxis(ID)` method. -The method will return a double (from -1 to 1) so the function will also return a double - -> Checking the ID of the axis is almost the same for checking the ID of the buttons. -> Instead of looking at which squares lights up, look at which bar moves up and down when moved - -Ex: -```java -public double getLeftStickX() - { - return joystick.getRawAxis(0); - } -``` - -You can repeat this for each axis you have on your controller, naming the functions accordingly - -**Setting Up A D-Pad:** - -The D-Pad differs greatly from any other method as it uses a POV to get which position it is in. -As such, it needs some extra code to get it working - -```java -public enum dPad { - up, - down, - left, - right, - upright, - upleft, - downright, - downleft, - none - } -``` - -This is an enum that is used for all 9 possible inputs from the D-Pad (including no input). -It is required for the next bit of code that follows it - -```java -public dPad getPad() - { - switch (joystick.getPOV()) - { - case 0: - return dPad.up; - - case 360: - return dPad.up; - - case 90: - return dPad.right; - - case 180: - return dPad.down; - - case 270: - return dPad.left; - - case 45: - return dPad.upright; - - case 135: - return dPad.downright; - - case 225: - return dPad.downleft; - - case 315: - return dPad.upleft; - - default: - return dPad.none; - } - } -``` - -This bit of code uses a switch statement to see which state the D-Pad is in and ouputs the enum value accordingly. -This takes a little more work than a standard button or axis but it simplifies the output greatly - - - -**Rumble Control** - -> Not every controller supports rumble. You can check this if the Driver Station reports two extra sliders for controlling rumble manually -> Note: The Logitech F310 does support rumble but does *not* have the rumble motors -> Note: Setting up rumble for a controller that does not support rumble will not throw an error. It will be ignored when it tries to run - -Since there 2 types of rumble, you need to set up a case for each rumble motor. -This uses the `joystick.setRumble(RumbleType, double)` to use the rumble feature - -> Make sure you import `edu.wpi.first.wpilibj.GenericHID.RumbleType` to use rumble - -Ex: -```java -public void rumbleHigh() // High - { - joystick.setRumble(RumbleType.kRightRumble, 1); - } - -public void rumbleLow() // Low - { - joystick.setRumble(RumbleType.kLeftRumble, 1); - } - -public void letsGetReadyToRumble() // Both - { - joystick.setRumble(RumbleType.kBothRumble, 1); - } - -public void rumbleOff() // Off - { - joystick.setRumble(RumbleType.kBothRumble, 0); - } -``` - -> The values can be a double from 0 to 1. You can set your own values however this example just uses 1 and 0 for on and off - -**Setting Up A Deadband:** - -Setting up a deadband is mainly only used for a controller that has a slight drift to it. This is used to prevent drifting when in use -The deadband uses a custom value that you can change to whatever you may need to fix the drift on your controller with software - -Ex: -```java -public double deadBand(double value) - { - return Math.abs(value) < 0.175 ? 0 : value; - } -``` - -This sets up a deadband function with a deadband of plus or minus 0.175 -This is simplified by using a [ternary operator](https://github.com/J-The-Fox/FRC-Team-5098/wiki/Java-Operators#ternary-operator) - -```java -public double getLeftStickX() - { - return deadBand(joystick.getRawAxis(0)); - } -``` - -This is using the deadband funtion created earlier to add a deadband to this axis - -> The proccess is similar for both the standard controller and the joystick controller. Just make sure all the IDs are set correctly! \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/controllers/Xbox360.java b/Example_Project/src/main/java/frc/controllers/Xbox360.java deleted file mode 100755 index a4bbd19..0000000 --- a/Example_Project/src/main/java/frc/controllers/Xbox360.java +++ /dev/null @@ -1,171 +0,0 @@ -package frc.controllers; - -import edu.wpi.first.wpilibj.GenericHID.RumbleType; -import edu.wpi.first.wpilibj.Joystick; -import java.lang.Math; - -public class Xbox360 -{ - - public Xbox360(int ID) - { - joystick = new Joystick(ID); - } - - Joystick joystick; - - - // Create a deadBand method for the controller as it drifts a little - public double deadBand(double value) - { - return Math.abs(value) < 0.175 ? 0 : value; - } - - public double getLeftStickX() - { - return deadBand(joystick.getRawAxis(0)); - } - - public double getLeftStickY() - { - return deadBand(joystick.getRawAxis(1)); - } - - public double getRightStickX() - { - return deadBand(joystick.getRawAxis(4)); - } - - public double getRightStickY() - { - return deadBand(joystick.getRawAxis(5)); - } - - public boolean getA() - { - return joystick.getRawButton(1); - } - - public boolean getB() - { - return joystick.getRawButton(2); - } - - public boolean getX() - { - return joystick.getRawButton(3); - } - - public boolean getY() - { - return joystick.getRawButton(4); - } - - public boolean getLB() - { - return joystick.getRawButton(5); - } - - public boolean getRB() - { - return joystick.getRawButton(6); - } - - public boolean getBack() - { - return joystick.getRawButton(7); - } - - public boolean getStart() - { - return joystick.getRawButton(8); - } - - public boolean getLeftStick() - { - return joystick.getRawButton(9); - } - - public boolean getRightStick() - { - return joystick.getRawButton(10); - } - - public double getLeftTrigger() - { - return joystick.getRawAxis(2); - } - - public double getRightTrigger() - { - return joystick.getRawAxis(3); - } - - public enum dPad { - up, - down, - left, - right, - upright, - upleft, - downright, - downleft, - none - } - - public dPad getPad() - { - switch (joystick.getPOV()) - { - case 0: - return dPad.up; - - case 360: - return dPad.up; - - case 90: - return dPad.right; - - case 180: - return dPad.down; - - case 270: - return dPad.left; - - case 45: - return dPad.upright; - - case 135: - return dPad.downright; - - case 225: - return dPad.downleft; - - case 315: - return dPad.upleft; - - default: - return dPad.none; - } - } - - public void rumbleHigh() - { - joystick.setRumble(RumbleType.kRightRumble, 1); - } - - public void rumbleLow() - { - joystick.setRumble(RumbleType.kLeftRumble, 1); - } - - public void letsGetReadyToRumble() - { - joystick.setRumble(RumbleType.kBothRumble, 1); - } - - public void rumbleOff() - { - joystick.setRumble(RumbleType.kBothRumble, 0); - } -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/robot/Main.java b/Example_Project/src/main/java/frc/robot/Main.java deleted file mode 100644 index 8776e5d..0000000 --- a/Example_Project/src/main/java/frc/robot/Main.java +++ /dev/null @@ -1,25 +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 frc.robot; - -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/Example_Project/src/main/java/frc/robot/Robot.java b/Example_Project/src/main/java/frc/robot/Robot.java deleted file mode 100644 index b2dc458..0000000 --- a/Example_Project/src/main/java/frc/robot/Robot.java +++ /dev/null @@ -1,127 +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 frc.robot; - -// Imports // -import java.io.IOException; -import com.fasterxml.jackson.databind.ObjectMapper; -import edu.wpi.first.wpilibj.Filesystem; -import edu.wpi.first.wpilibj.PneumaticsModuleType; -import edu.wpi.first.wpilibj.TimedRobot; -import edu.wpi.first.wpilibj.Compressor; -import frc.CommonData; -import frc.components.IComponent; -import frc.components.ShuffleBoardController; -import frc.settings.Settings; - -/** - * The VM is configured to automatically run this class, and to call the functions corresponding to - * each mode, as described in the TimedRobot documentation. If you change the name of this class or - * the package after creating this project, you must also update the build.gradle file in the - * project. - */ - -public class Robot extends TimedRobot { - - // Read the robot_settings.json file and put it into the settings object. - public static Settings settings; - static { - ObjectMapper mapper = new ObjectMapper(); - // Try to read the robot_settings.json file and put it into the settings object. - try { - var filepath = Filesystem.getDeployDirectory().toPath().resolve("robot_settings.json"); - settings = mapper.readValue(filepath.toFile(), Settings.class); - } - // If there is an error, print the error to the console. - catch (IOException ex) { - System.out.println(ex.toString()); - } - } - - // Create a new compressor object to control the pneumatics. - - // This could possible be moved to the Pneumatics.java component. - // I would like to see if it's possbible to see what types of a pnematic module is currently plugged in. - // However I am not sure if that is possible. I may look into it in the future. - Compressor compressor = new Compressor(settings.pneumaticsSettings.pneumaticsModuleID, PneumaticsModuleType.REVPH); - - // Create a new IComponent array and add all of the components to it. - // This is used to call all the update methods in the periodic() method. - IComponent[] RobotComponents = new IComponent[] { - new ShuffleBoardController(settings.shuffleBoardSettings), - - }; - - @Override - public void robotInit() { - // This is ran when the robot is first turned on. This is where you should add any initialization code. - } - - @Override - public void robotPeriodic() { - // This is ran every 20ms while the robot is on. This is where you should add any code that needs to run constantly. - - // This calls all the update methods in the RobotComponents array to update all components. - for (IComponent component : RobotComponents) { - component.update(); - } - } - - @Override - public void autonomousInit() { - // This is ran when the robot is first put into autonomous mode. - // This is where you should add any code that needs to run when the robot is first put into autonomous mode. - } - - @Override - public void autonomousPeriodic() { - // This is ran every 20ms while the robot is in autonomous mode. - - for (IComponent component : RobotComponents) { - component.update(); - } - } - - @Override - public void teleopInit() { - // This is ran when the robot is first put into teleop mode. - // This is where you should add any code that needs to run when the robot is first put into teleop mode. - } - - @Override - public void teleopPeriodic() { - // This is ran every 20ms while the robot is in teleop mode. - } - - @Override - public void disabledInit() { - // This is ran when the robot is first put into disabled mode. - } - - @Override - public void disabledPeriodic() { - // This is ran every 20ms while the robot is in disabled mode. - } - - @Override - public void testInit() { - // This is ran when the robot is first put into test mode. - } - - @Override - public void testPeriodic() { - // This is ran every 20ms while the robot is in test mode. - } - - @Override - public void simulationInit() { - // This is ran when the robot is first put into simulation mode. - } - - @Override - public void simulationPeriodic() { - // This is ran every 20ms while the robot is in simulation mode. - } -} diff --git a/Example_Project/src/main/java/frc/robot/Utility.java b/Example_Project/src/main/java/frc/robot/Utility.java deleted file mode 100755 index 8b6fae1..0000000 --- a/Example_Project/src/main/java/frc/robot/Utility.java +++ /dev/null @@ -1,66 +0,0 @@ -package frc.robot; - -import java.lang.Math; - -public class Utility -/** - * This is the Utility Class. It contains methods and functions that don't fit into one specific class. - * This is where you should add any methods or functions that don't fit into one specific class. - * - * The functions and methods in this class were created for the 2022 - 2023 season. -*/ -{ - static int printCounter = 0; - - public static void printLn(String messageString) - /** - * This is a method that prints a message to the console every 50 times it is called. - * It is used to prevent the console from being flooded with messages as well as to prevent log messages being lost due to the connection speed - */ - { - if (printCounter == 50) - { - System.out.println(messageString); - printCounter = 0; - } - else - { - printCounter++; - // Increment the print counter by 1 - } - } - - public static double sigmoid(double x) - /** - * This is a sigmoid functinon. It is used to smooth out values as they approach 1 and 0. - * It resembles an S shape. - */ - { - return 1 / (1 + Math.pow(Math.E, -x)); - } - - public static double clamp(double value, double min, double max) - /** - * This is a clamp function. It is used to limit a value between a minimum and a maximum. - * If the value is above the maximum, it will be set to the maximum. - * If the value is below the minimum, it will be set to the minimum. - */ - { - // This is a ternary operator. It is a short way of writing an if statement. - return value < min ? min : value > max ? max - : value; - } - - public static double snapToEdge(double value, double min, double max, double threshold) - { - if (value < -threshold) - { - return min; - } - if (value > threshold) - { - return max; - } - return value; - } -} \ No newline at end of file diff --git a/Example_Project/src/main/java/frc/settings/NavXSettings.java b/Example_Project/src/main/java/frc/settings/NavXSettings.java deleted file mode 100644 index dcca5b6..0000000 --- a/Example_Project/src/main/java/frc/settings/NavXSettings.java +++ /dev/null @@ -1,5 +0,0 @@ -package frc.settings; - -public class NavXSettings { - -} diff --git a/Example_Project/src/main/java/frc/settings/PneumaticsSettings.java b/Example_Project/src/main/java/frc/settings/PneumaticsSettings.java deleted file mode 100644 index 4fe68b5..0000000 --- a/Example_Project/src/main/java/frc/settings/PneumaticsSettings.java +++ /dev/null @@ -1,13 +0,0 @@ -package frc.settings; - -public class PneumaticsSettings { - - // Pneumatics Control Module IDs - public int pneumaticsModuleID; - - // Solenoid IDs - public int largeSolenoidForwardChannelID; - public int largeSolenoidReverseChannelID; - public int smallSolenoidForwardChannelID; - public int smallSolenoidReverseChannelID; -} diff --git a/Example_Project/src/main/java/frc/settings/Settings.java b/Example_Project/src/main/java/frc/settings/Settings.java deleted file mode 100644 index d490711..0000000 --- a/Example_Project/src/main/java/frc/settings/Settings.java +++ /dev/null @@ -1,14 +0,0 @@ -package frc.settings; - -public class Settings { - - // Settings from the settings files in this directory - public PneumaticsSettings pneumaticsSettings; - public NavXSettings navXSettings; - public ShuffleBoardSettings shuffleBoardSettings; - - // Controller IDs - // We usually implement 2 controllers, an auxillary controller and a main controller. - public int controllerID; - public int auxControllerID; -} diff --git a/Example_Project/src/main/java/frc/settings/ShuffleBoardSettings.java b/Example_Project/src/main/java/frc/settings/ShuffleBoardSettings.java deleted file mode 100644 index 519bd2e..0000000 --- a/Example_Project/src/main/java/frc/settings/ShuffleBoardSettings.java +++ /dev/null @@ -1,6 +0,0 @@ -package frc.settings; - -public class ShuffleBoardSettings { - - -} diff --git a/Example_Project/src/main/java/frc/state_machine/State.java b/Example_Project/src/main/java/frc/state_machine/State.java deleted file mode 100755 index 7a4fb03..0000000 --- a/Example_Project/src/main/java/frc/state_machine/State.java +++ /dev/null @@ -1,19 +0,0 @@ -package frc.state_machine; - -public abstract class State -{ - public void onEnter() - { - } - public void onExit() - { - } - - public boolean isValid() - { - return true; - } - - // Returns 'true' when state is finished - public abstract boolean run(); -} diff --git a/Example_Project/src/main/java/frc/state_machine/StateMachine.java b/Example_Project/src/main/java/frc/state_machine/StateMachine.java deleted file mode 100755 index e5d0313..0000000 --- a/Example_Project/src/main/java/frc/state_machine/StateMachine.java +++ /dev/null @@ -1,45 +0,0 @@ -package frc.state_machine; - -import java.util.ArrayList; -import java.util.List; - -/** - * This is a state machine class. It is used to run a set of actions in order. - * A state will be ran when the state is invalid. - * The current state will keep running until the state is valid. - * Once the state is valid, the state will be removed from the list and the next state will be ran. - * Once the list is empty, the state machine will stop running. - */ - -public class StateMachine -{ - State m_currentState; - List m_states = new ArrayList(); - - public void addState(State state) - { - m_states.add(state); - } - - public void run() - { - if (!m_states.isEmpty()) - { - if (m_currentState == null && m_states.get(0).isValid()) - { - m_currentState = m_states.get(0); - m_currentState.onEnter(); - m_states.remove(0); - } - } - - if (m_currentState != null) - { - if (m_currentState.run()) - { - m_currentState.onExit(); - m_currentState = null; - } - } - } -} diff --git a/Example_Project/vendordeps/NavX.json b/Example_Project/vendordeps/NavX.json deleted file mode 100644 index 29ec93a..0000000 --- a/Example_Project/vendordeps/NavX.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "fileName": "NavX.json", - "name": "KauaiLabs_navX_FRC", - "version": "2023.0.3", - "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", - "mavenUrls": [ - "https://dev.studica.com/maven/release/2023/" - ], - "jsonUrl": "https://dev.studica.com/releases/2023/NavX.json", - "javaDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-java", - "version": "2023.0.3" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "com.kauailabs.navx.frc", - "artifactId": "navx-frc-cpp", - "version": "2023.0.3", - "headerClassifier": "headers", - "sourcesClassifier": "sources", - "sharedLibrary": false, - "libName": "navx_frc", - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "linuxraspbian", - "linuxarm32", - "linuxarm64", - "linux86-64", - "osxuniversal", - "windowsx86-64" - ] - } - ] -} \ No newline at end of file diff --git a/Example_Project/vendordeps/PhoenixProAnd5.json b/Example_Project/vendordeps/PhoenixProAnd5.json deleted file mode 100644 index 21206b0..0000000 --- a/Example_Project/vendordeps/PhoenixProAnd5.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "fileName": "PhoenixProAnd5.json", - "name": "CTRE-Phoenix (Pro And v5)", - "version": "23.0.12", - "frcYear": 2023, - "uuid": "3fcf3402-e646-4fa6-971e-18afe8173b1a", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixProAnd5-frc2023-latest.json", - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.30.4" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.30.4" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "wpiapi-java", - "version": "23.0.12" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.30.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.30.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "tools", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProCANcoder", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProPigeon2", - "version": "23.0.12", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.30.4", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.30.4", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.30.4", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "tools", - "version": "23.0.12", - "libName": "CTRE_PhoenixTools", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "5.30.4", - "libName": "CTRE_Phoenix_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "api-cpp-sim", - "version": "5.30.4", - "libName": "CTRE_PhoenixSim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.30.4", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.12", - "libName": "CTRE_PhoenixTools_Sim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.12", - "libName": "CTRE_SimTalonSRX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.12", - "libName": "CTRE_SimTalonFX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.12", - "libName": "CTRE_SimVictorSPX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.12", - "libName": "CTRE_SimPigeonIMU", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.12", - "libName": "CTRE_SimCANCoder", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.12", - "libName": "CTRE_SimProTalonFX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProCANcoder", - "version": "23.0.12", - "libName": "CTRE_SimProCANcoder", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProPigeon2", - "version": "23.0.12", - "libName": "CTRE_SimProPigeon2", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenixpro", - "artifactId": "wpiapi-cpp", - "version": "23.0.12", - "libName": "CTRE_PhoenixPro_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "23.0.12", - "libName": "CTRE_PhoenixPro_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ], - "simMode": "swsim" - } - ] -} \ No newline at end of file diff --git a/Example_Project/vendordeps/README.md b/Example_Project/vendordeps/README.md deleted file mode 100644 index 18dc487..0000000 --- a/Example_Project/vendordeps/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Vendor Deps - -This folder holds all the vendor dependencies for the hardware of robot. - -## Installing, Updating, and Removing - -**Installing (Offline)**: -To add a vendor library that has been installed by an offline installer, press `Ctrl+Shift+P` and type `WPILib` or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing `Manage Vendor Libraries`, then select it from the menu. Select the option to `Install new libraries (offline)`. - -**Installing (Online)**: -To add a vendor library online, press `Ctrl+Shift+P` and type `WPILib` or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing `Manage Vendor Libraries`, then select it from the menu. Select the option to `Install new libraries (online)`. Then paste in the URL. Most vendor libraries can be found [here](https://docs.wpilib.org/en/stable/docs/software/vscode-overview/3rd-party-libraries.html#libraries). However you can also install external libraries the same way, just paste in the URL and hit enter - -**Updating (Offline)**: -Since dependencies are version managed on a per-project basis, even when installed offline, you will need to go to Manage Vendor Libraries and select `Check for updates (offline)` for each project you wish to update. - -**Updating (Online)**: -Part of the JSON file that vendors may optionally populate is an online update location. If a library has an appropriate location specified, running `Check for updates (online)` will check if a newer version of the library is available from the remote location. - - -**Removing**: -To remove a library dependency from a project, select `Manage Current Libraries` from the Manage Vendor Libraries menu, check the box for any libraries to uninstall and click `OK`. These libraries will be removed as dependencies from the project. - - -## Files In This `vendordep` Folder - -| File | Description | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| NavX.json | Libraries for NavX-MXP, NavX-Micro, and Sensor Fusion | -| PhoenixProAnd5.json | Contains CANcoder, CANifier, CANdle, Pigeon IMU, Pigeon 2.0, Talon FX, Talon SRX, and Victor SPX Libraries and Phoenix Tuner program for configuring CTRE CAN devices | -| photonlib.json | Library for PhotonVision CV software | -| REVLib.json | Library for all REV devices including SPARK MAX and Color Sensor V3 | -| WPILibNewCommands.json | Libraries for WPILib new commands | - -More Info can be found in the [Wiki](https://github.com/J-The-Fox/FRC-Team-5098/wiki) - -Credit: Info parsed and copied from the [WPILib Docs](https://docs.wpilib.org/en/stable/) \ No newline at end of file diff --git a/Example_Project/vendordeps/photonlib.json b/Example_Project/vendordeps/photonlib.json deleted file mode 100644 index dad3105..0000000 --- a/Example_Project/vendordeps/photonlib.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "fileName": "photonlib.json", - "name": "photonlib", - "version": "v2023.4.2", - "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004 ", - "mavenUrls": [ - "https://maven.photonvision.org/repository/internal", - "https://maven.photonvision.org/repository/snapshots" - ], - "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/PhotonLib-json/1.0/PhotonLib-json-1.0.json", - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "org.photonvision", - "artifactId": "PhotonLib-cpp", - "version": "v2023.4.2", - "libName": "Photon", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxathena", - "linuxx86-64", - "osxuniversal" - ] - } - ], - "javaDependencies": [ - { - "groupId": "org.photonvision", - "artifactId": "PhotonLib-java", - "version": "v2023.4.2" - }, - { - "groupId": "org.photonvision", - "artifactId": "PhotonTargeting-java", - "version": "v2023.4.2" - } - ] -} \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Learning_Materials/Beginner_Level/Course_Intro.txt b/Learning_Materials/Beginner_Level/Course_Intro.txt deleted file mode 100644 index 22d7205..0000000 --- a/Learning_Materials/Beginner_Level/Course_Intro.txt +++ /dev/null @@ -1,58 +0,0 @@ -Welcome to the beginning of your programming journey! If you find anything -confusing, weird, or just plain wrong, please let one of us know! As this will -be the first year this course goes into actiion, and will likely have some -kinks that need to be worked out. - -Here are some extra resources! - - W3Schools - This website is an extremely helpful reference, if you have any - questions, this one could probably clear things up - Java - https://www.w3schools.com/java/ - Python - https://www.w3schools.com/python/default.asp - - CodeAcademy - This site offers free courses on most programming languages, - however, as I've found, you can get lost or not really understand what it's - trying to tell you. It is still a good resource if you don't understand - something and need another way of looking at it. Or if you don't like our - course and want to try it another way - Java - https://www.codecademy.com/catalog/language/java - Python - https://www.codecademy.com/catalog/language/python - -More resources to come - -Cheating policy - DO NOT CHEAT! - You obviously know this, however I will say it here anyway to make sure the - message gets through. Cheating will only make things harder for you in the - future, as by not understanding the concepts outlined in the beginner level, you - will be woefully unprepared for the intermediate course. Think of it like math, - How are you supposed to do algebra if you don't even know how to divide. - - But, what is cheating? - - Copying what someone else put down just to show you did it - - Finding the first solution on the internet and copy and pasting - - - Exceptions - - If you understand why and how what you put down works, then I would not - really consider it cheating. The purpose of this course is to help you - understand how programming works. I don't care how you get there, as long - as you get there. (This rule does not apply to quizes) - - Asking for help is not cheating. Copying what they said mindlessly down is. - Don't be afraid to ask, even if you asked 50 times before and the concept - just isn't getting through, we would still prefer you ask rather than carry - on and not understand. - -We will be learning about - Datatypes - Operators - If-Else-Statement - functions - Scope - Classes and objects - -Good luck! Remember, if you have any questions just ask the captains! \ No newline at end of file diff --git a/Learning_Materials/Beginner_Level/Java/B1DataTypes.java b/Learning_Materials/Beginner_Level/Java/B1DataTypes.java deleted file mode 100644 index 7f29e55..0000000 --- a/Learning_Materials/Beginner_Level/Java/B1DataTypes.java +++ /dev/null @@ -1,36 +0,0 @@ -public class B1DataTypes { // ignore for now - public static void main(String[] args) { // ignore for now - // Hello! Ths is the file for all the various data types in java! Here are - // the main ones that we will be focusing on right now - int myNum = 5; // Integer (whole number) - double myDoubleNum = 5.99; // Decimal point number - float myFloatNum = 5.99f; // Decimal point number (needs to have the f at the end) - char myLetter = 'D'; // Character - boolean myBool = true; // Boolean - String myText = "Hello"; // String - - // By now, you should notice that each of the data types follow a pattern. They - // have a name, equals sign, then a value. This forms what I like to call the - // "variable equation". - // data_type variable_name = value; - - // Now, let's try printing out the values of these variables. To do this, we - // will use the pre-made method System.out.println(). This method will print - // out whatever is inside the parentheses. For example: - - // We can print values - System.out.println("Is 2+2=4?"); - // Or we can print out variables - System.out.println(myBool); - - // We can also create variables with nothing in them and then assign them later - int myNum2; - myNum2 = 10; // Notice how we don't use the data type when we assign a value to a variable - // that's already been created - System.out.println(myNum2); - - // Now, why don't you try some of yourself? create a few variables, and print - // them out. Have fun with it! - - } // no code can be past this curly brace -} diff --git a/Learning_Materials/Beginner_Level/Java/B2Operators.java b/Learning_Materials/Beginner_Level/Java/B2Operators.java deleted file mode 100644 index dcd39e5..0000000 --- a/Learning_Materials/Beginner_Level/Java/B2Operators.java +++ /dev/null @@ -1,46 +0,0 @@ -public class B2Operators { - public static void main(String[] args) { - // This next section is going to go over what 'operators' are, and what they do! - // There are various operators, but the 4 main types are - // - Arithmetic: adding, subtracting, multiplying, dividing, etc. - // - Assignment: assigning a value to a variable - // - Comparison: comparing two values - // - Logical: if this AND this, then that, (hope that made sense, basically it's - // just "AND" or "OR") - - // Examples - - // ARITHMETIC (+, -, *, /, %) - - int x = 5 + 10; // the "+" is an example of an arithmatic operator - // however you can also use it to concatenate strings - String testString = "Hello" + " World!"; // this will store testString as "Hello World!" - // There is also another more unknown operator, the modulos operator - // the modulos operator returns the remainder of a division problem - int remainder = 10 % 3; // this will store remainder as 1 - - // ASSIGNMENT (=, +=, -=, *=, /=, %=) - - int y = 5; // the "=" is an example of an assignment operator - // the "+=" adds a value to a variable - y += 5; // this will add 5 to y, so y will now be 10 - - // COMPARISON (==, !=, >, <, >=, <=) - - // the next part contains if statements, which we will go over in the next - // section - // so for now just focus on the operators - if (x == y) { // the "==" is an example of a comparison operator - System.out.println("x is equal to y!"); - } - - // LOGICAL (&&, ||) - - if (x == 5 && y == 5) { // the "&&" is an example of a logical operator, representing "AND" - System.out.println("x and y are both equal to 5!"); - } - if (x == 5 || y == 5) { // the "||" is an example of a logical operator, representing "OR" - System.out.println("either x or y is equal to 5!"); - } - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B3IfElseStatement.java b/Learning_Materials/Beginner_Level/Java/B3IfElseStatement.java deleted file mode 100644 index f1cf989..0000000 --- a/Learning_Materials/Beginner_Level/Java/B3IfElseStatement.java +++ /dev/null @@ -1,37 +0,0 @@ -public class B3IfElseStatement { - - public static void main(String[] args) { - - String text; // This is an empty variable, that we will use later - - // If statements are used to check if a condition is true or false - // They are basically the bread and butter of programming, and are used in - // almost everything - - // This is an if statement, and it checks if 5 is greater than 2 - if (5 > 2) { - text = "value is greater than 2"; // If the condition is true, then this code will run - // notice how this line is inside the curly braces, this means that anything inside - // the curly braces will run if the condition is true - } - - // If-Else statements provide an alternative if the condition is false - if (text == "your mom") { - System.out.println("Your mom is the best and I would never say anything bad :)"); - } else { - System.out.println(text); // If the condition is false, then this code will run - } - - // If-Else-If statements provide multiple alternatives if the condition is false - if (text == "your mom") { - System.out.println("your mom is the best and I would never say anything bad :)"); - } else if (text == "value is greater than 2") { - System.out.println("Your doing good so far! (or are you???)");//If this condition is true, then this code will run - } else if (4903 < 0){ - System.out.println("This will never run, because the previous condition is true"); - } else { // you can still add an extra else statement at the end - System.out.println(text); - } - - } -} \ No newline at end of file diff --git a/Learning_Materials/Beginner_Level/Java/B4CheckIn.java b/Learning_Materials/Beginner_Level/Java/B4CheckIn.java deleted file mode 100644 index 3d25e22..0000000 --- a/Learning_Materials/Beginner_Level/Java/B4CheckIn.java +++ /dev/null @@ -1,14 +0,0 @@ -public class B4CheckIn { - // Hello! this is just a quick check in to see how you are doing with the course - // so far. - - // if you have any feedback, please let someone know! This whole thing is still - // very new and we are working out the kinks as we go along. - - // anyway, here are some little exercises you can do to make sure you are - // understanding the material so far - - // Question 1: How are Comparison and Logical Operators used in If statements? - - // Question 2: How many "else-if"s can you have in single if statement -} diff --git a/Learning_Materials/Beginner_Level/Java/B5Functions.java b/Learning_Materials/Beginner_Level/Java/B5Functions.java deleted file mode 100644 index 8dfc0f1..0000000 --- a/Learning_Materials/Beginner_Level/Java/B5Functions.java +++ /dev/null @@ -1,51 +0,0 @@ -public class B5Functions { - - // If you have a section of code that you need to use multiple times, you can - // put it in a function and call that function whenever you need to use that - // code. - // to create the function, you need to use the following syntax: - - // static void function_name() { - // code goes here - // } - - // the public/static part determines whether the function needs to be used in a - // object or not, we will go over this in more detail later - - // void determines whether the function returns a value or not, we will also go - // over this later in the file - - static void myFunction1() { - System.out.println("Hello World!"); - } - - static int myFunction2() { - return (50); // you use the return keyword to return a value - } - - static int myFunction3(int x, int y) { // this function takes in two parameters - return x + y; - } - - public static void main(String[] args) { - - // to have the code in the function run, you must "call" it - myFunction1(); // this will print out "Hello World!" - // you can also pass variables into functions - - // you can also have functions return a value - int value = myFunction2(); // this will return "Hello person I know!" - - // you can also pass variables into functions by createing parameters - // these parameters will be in the parentesis of the function - System.out.println(myFunction3(5, value)); // this will return 55 - - // built in functions - // there are many built in functions in java which don't require you to create - // them, an example is the "Math.max()" function - Math.max(5, 10); // returns the highest value of 5 and 10 - - // little food for thought, look at line 30... doesn't like kinda look like... a function? - // the main function is a special function that is called when you run the program - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B6Scope.java b/Learning_Materials/Beginner_Level/Java/B6Scope.java deleted file mode 100644 index c698aad..0000000 --- a/Learning_Materials/Beginner_Level/Java/B6Scope.java +++ /dev/null @@ -1,42 +0,0 @@ -public class B6Scope { - static void assignMethod() { - int numInFunction = 5; - } - - static int returnMethod() { - int numInFunction = 5; - return numInFunction; - } - - public static void main(String[] args) { - - // in this lesson we will be talking about scope. Scope is the area in which - // a variable is (visible) accessible. For example, if you declare (create) a - // variable inside a if-else statement, it will only be accessible inside that - // if-else statement. - - boolean bool = true; - if (bool) { - int numInIfStatement = 5; // creates the variable x and sets it to 5 in the If statement - System.out.println(numInIfStatement); // this will work because x is accessible here - } // the Curly brackects represent the end of the if statements scope - - System.pit.println(numInIfStatement); // this will not work because x is not accessible here - - // The same goes for Functions - myMethod(); - System.out.println(numInFunction); // this will not work because numInFunction is not accessible here - - // However, there are two simple ways to get around this. The first is to - // declare the variable outside of the function or if statement. - int y = 5; // variable is outside of if statement - if (bool) { - y -= 5; // modfies the variable y - } - System.out.println(y); // this will work because y is accessible here - // The second way is to return the variable from the function - System.out.print(returnMethod()); // this will work because the function returns the variable - - // This also goes for objects and classes, which we will cover next - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B71ClassesAndObjects.java b/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B71ClassesAndObjects.java deleted file mode 100644 index a817146..0000000 --- a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B71ClassesAndObjects.java +++ /dev/null @@ -1,66 +0,0 @@ -public class B71ClassesAndObjects { // look, a class! - - // Hey! Your almost at the end of the beginner level. Don't get too excited - // though - // As this part is a pretty confusing part of coding, and should have your full - // attention - - // Classes and Objects - // Classes are a way to group functions and variables together - // Objects are instances of classes - - // it's okay if that sounds super confusing. It's cause it is, but hopefully the - // example we're about to go over will help you understand - - public static void main(String[] args) { - // To help make this a bit simpler, let's use an example - // Let's say your building a neighborhood - - // you would need blueprints for the houses, which in our case, represent - // classes (go to B72BlueprintForHouse.java to see the class) - - // you would also need to build the houses, which in our case, represent objects - // the syntax (wording) for creating a class is as follows: - - // class name = new class(); - B72BlueprintForHouse house1 = new B72BlueprintForHouse(); - - // you can also access or modify the attibutes of the house (the object) - System.out.println("House 1 is the color " + house1.color); // this will print out "red" - house1.color = "blue"; // this will change the color of the house to blue - System.out.println("House 1 is now the color " + house1.color); // this will print out "blue" - - // However, this in itself is not all that useful, it would be useful though if - // we could change the attibutes of the house - // When we create the class, which we can do! (See the file - // B73RevisedBlueprintForHouse.java) - - // Now, we can create the house with the attributes we want - B73RevisedBlueprintForHouse house2 = new B73RevisedBlueprintForHouse("green", "large"); - B73RevisedBlueprintForHouse house3 = new B73RevisedBlueprintForHouse("yellow", "small"); - - System.out.println("House 2 is " + house2.color + " color and size " + house2.size + "\nHouse 3 is " + house3.color - + " color and size " + house3.size); - - // you can also create a function in classes - // let's say you created a basic function to revert a house the the industry - // norm (see B74AnotherRevisedBlueprint.java) - - B74AnotherRevisedBlueprint house4 = new B74AnotherRevisedBlueprint("orange", "medium"); - System.out.println("House 4 is " + house4.color + " color and size " + house4.size); - - house4.changeToBasicHouse(); // this is where we call the function! - // notice how you need to have the object name, then a period, then the function - - System.out.println("House 4 is now " + house4.color + " color and size " + house4.size + ", the industry norm!"); - - // Finally, let is return to the "public" keyword. This is called an access - // modifier, and it determines who can access the class or function - // public: anyone can access the class or function - // default: only classes or functions in the same package can access the class - - // no worries if the public is a bit confusing, we will cover it more in the - // intermediate level - - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B72BlueprintForHouse.java b/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B72BlueprintForHouse.java deleted file mode 100644 index ed9da2f..0000000 --- a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B72BlueprintForHouse.java +++ /dev/null @@ -1,6 +0,0 @@ -public class B72BlueprintForHouse { // This is the class (blueprint) for the house - // here are some attributesfor the house - String color = "red"; - String size = "meduium"; -} -// something to note, the class name must be the same as the file name \ No newline at end of file diff --git a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B73RevisedBlueprintForHouse.java b/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B73RevisedBlueprintForHouse.java deleted file mode 100644 index 37db323..0000000 --- a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B73RevisedBlueprintForHouse.java +++ /dev/null @@ -1,15 +0,0 @@ -public class B73RevisedBlueprintForHouse { // Blueprint (class) for the house - // attributes for the house - String color; - String size; - - // this is called a constructor, and is used to create the object, - // this is where you can input parameters, if-else statements, etc. - public B73RevisedBlueprintForHouse(String color, String size) { - this.color = color; - this.size = size; - // notice how there is a "this." before the variable name - // This is so the program knows that you are referring to the variable in this - // object, and not another variable that could be floating around - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B74AnotherRevisedBlueprint.java b/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B74AnotherRevisedBlueprint.java deleted file mode 100644 index b06ad0a..0000000 --- a/Learning_Materials/Beginner_Level/Java/B7ClassesAndObjects/B74AnotherRevisedBlueprint.java +++ /dev/null @@ -1,17 +0,0 @@ -public class B74AnotherRevisedBlueprint { // class - // attributes - String color; - String size; - - // constructor - public B74AnotherRevisedBlueprint(String color, String size) { - this.color = color; - this.size = size; - } - - // This is the function to change the house to the industry norm! - public void changeToBasicHouse() { - this.color = "purple"; - this.size = "small"; - } -} diff --git a/Learning_Materials/Beginner_Level/Java/B8FinalCheckIn.java b/Learning_Materials/Beginner_Level/Java/B8FinalCheckIn.java deleted file mode 100644 index aed7988..0000000 --- a/Learning_Materials/Beginner_Level/Java/B8FinalCheckIn.java +++ /dev/null @@ -1,21 +0,0 @@ -public class B8FinalCheckIn { - // Hello! Congrats, your done learning with the beginner level! - - // Here are some exercises you can do to make sure that you understand the material so far - - // What is the difference between a double and an integer? (B1) - - // What does the modulus operator do? How might it be useful? (B2) - - // What operator adds a value to itself? (B2) - - // How are functions useful? (B5) - - // What are parameters? (B5) - - // What is the difference between a class and a object? (B7) - - // Why do we use classes? (B7) - - // why do we sometimes use a constructor when creating classes? (B7) -} diff --git a/Learning_Materials/Beginner_Level/Python/B1DataTypes.py b/Learning_Materials/Beginner_Level/Python/B1DataTypes.py deleted file mode 100644 index ff6fd04..0000000 --- a/Learning_Materials/Beginner_Level/Python/B1DataTypes.py +++ /dev/null @@ -1,41 +0,0 @@ -# Hello! this is the data types file. Here we will learn about the data types in python. - -# Data types are the types of data that we can store in a variable. Python contains many data types. Some of them are: -# 1. int (any whole number) -a_number = 1 -# 2. float (any decimal number) -a_decimal = -0.57382 -# 3. str (any string) -a_string = "Hello World!" -# 4. char (any single character) -a_character = "a" -# 5. bool (A True or False) -a_boolean = True -the_other_boolean = False -# and many more! However for now we will focus only on these - -# By now, you should notice that each of the data types follow a pattern. They -# have a name, equals sign, then a value. This forms what I like to call the -# "variable equation". -# variable_name = value - -# (something to note is that in python, you can just assign a variable a value -# without declaring the data type. This will be different in java.) - -# Now, let's try printing out the values of these variables. To do this, we -# will use the pre-made method print(). This method will print out whatever -# is inside the parentheses. For example: - -# we can print a value -print("Hello world! is 2+2 = 4?") -# we can also print a variable -print(a_boolean) - -# You can also create a variable with no value, and assign it a value later. -a_num = None -a_num = 5 -print(a_num) - -# Now, if you want a bit of practice, try creating some of your own variables -# and printing them out. You may also consider writing a reference sheet for -# for those variables if you think you might forget them. diff --git a/Learning_Materials/Beginner_Level/Python/B2Operators.py b/Learning_Materials/Beginner_Level/Python/B2Operators.py deleted file mode 100644 index 355b8ee..0000000 --- a/Learning_Materials/Beginner_Level/Python/B2Operators.py +++ /dev/null @@ -1,39 +0,0 @@ -# This next section is going to go over what 'operators' are, and what they do! -# There are various operators, but the 4 main types are -# - Arithmetic: adding, subtracting, multiplying, dividing, etc. -# - Assignment: assigning a value to a variable -# - Comparison: comparing two values -# - Logical: if this AND this, then that, (hope that made sense, basically it's -# just "AND" or "OR") - -# Examples - -# ARITHMETIC (+, -, *, /, %) - -x = 5 + 4 # The "+" is an arithmetic operator -# however you can also use it to concatenate strings -testString = "Hello" + " World!" # this will store testString as "Hello World!" -# There is also another more unknown operator, the modulos operator -# the modulos operator returns the remainder of a division problem -remainder = 10 % 3 # this will store remainder as 1 - -# ASSIGNMENT (=, +=, -=, *=, /=, %=) - -y = 5 # The "=" is an assignment operator -# the "+=" adds a value to a variable -y += 5 # this will add 5 to y, so y will now be 10 - - -# COMPARISION (==, !=, >, <, >=, <=) - -# the next part contains "if statements", which are used to check if a condition is true\ -# We will cover these in more detail later, but for now just focus on the operators -if x == 5: # The "==" is a comparison operator - print("x is equal to 5!") - -# LOGICAL (and, or) - -if x == 5 and x > 4: # The "and" is a logical operator - print("x is equal to 5 and greater than 4!") -if x == 5 or x > 4: # The "or" is a logical operator - print("x is equal to 5 or greater than 4!") diff --git a/Learning_Materials/Beginner_Level/Python/B3IfElseStatement.py b/Learning_Materials/Beginner_Level/Python/B3IfElseStatement.py deleted file mode 100644 index c7da655..0000000 --- a/Learning_Materials/Beginner_Level/Python/B3IfElseStatement.py +++ /dev/null @@ -1,28 +0,0 @@ -# If statements are used to check if a condition is true or false -# They are basically the bread and butter of programming, and are used in -# almost everything -text = None - -if 5 > 2: # This is an if statement, and it checks if 5 is greater than 2 - # If the condition is true, then this code will run - text = "value is greater than 2" - # notice how this is indented, as opposed to - # other lines we've created. This means that it anything indented - # below the if statement is "inside" the if statement, and will run - - -# If-Else statements provide an alternative if the condition is false -if text == "your mom": - print("Your mom is very nice and I would never say anything bad about her :)") -else: - print(text) - -# If-Else-If statements provide other alternatives if the condition is false -if text == "your mom": - print("Your mom is very nice and I would never say anything bad about her :)") -elif text == "value is greater than 2": # elif statement - print("your doing good so far (or are you???)") -elif 48939018948 < 1: # you can have more than one elif statement - print("this will never run") -else: # You can also still have an else statement - print(text) diff --git a/Learning_Materials/Beginner_Level/Python/B4CheckIn.py b/Learning_Materials/Beginner_Level/Python/B4CheckIn.py deleted file mode 100644 index f6fe89c..0000000 --- a/Learning_Materials/Beginner_Level/Python/B4CheckIn.py +++ /dev/null @@ -1,10 +0,0 @@ -# Hello! This is just a quick check in to see how you are doing with the course so far. - -# If you have any feedback, please let someone know! -# This whole thing is still very new and we are working out the kinks as we go along. - -# Anyway, here are some little exercises you can do to make sure you are understanding the material so far - -# Question 1: How are Comparison and Logical Operators used in If statements? - -# Question 2: How many "else-if"s can you have in single if statement diff --git a/Learning_Materials/Beginner_Level/Python/B5Functions.py b/Learning_Materials/Beginner_Level/Python/B5Functions.py deleted file mode 100644 index da38b49..0000000 --- a/Learning_Materials/Beginner_Level/Python/B5Functions.py +++ /dev/null @@ -1,42 +0,0 @@ -# If you have a section of code that you need to use multiple times, -# you can put it in a function and call that function -# whenever you need to use that code. - -# To create the function, you need to use the keyword "def" -# followed by the name of the function and then a set of parentheses. -def testfunction(): - print("This is a function being called!") - - -# to have the code in the function run, you must "call" it -testfunction() - -# you can create parameters in the function, -# which are variables that you can pass into the function when you call it - - -def testfunction2(x): - print(x) - - -testfunction2("This is a function being called with a variable!") -testfunction2("Here it is being called again!") - -# you can have as many variables as you want, as long as you seperate them with a comma -# you can also have functions return a value - - -def testfunction3(x, y, z): - return x / y * z - - -print(testfunction3(10, 5, 2)) - -# there are also a few built in functions in python you can use, which don't require you to define them - -# Take, for example, the input() function -username = input("What is your name? ") -# This will display "What is your name?" -# Then, it will wait for the user to type something and press enter -# it will then store whatever the user typed into the variable "usersname" -print("Hello, " + username + "!") diff --git a/Learning_Materials/Beginner_Level/Python/B6Scope.py b/Learning_Materials/Beginner_Level/Python/B6Scope.py deleted file mode 100644 index 1d041ab..0000000 --- a/Learning_Materials/Beginner_Level/Python/B6Scope.py +++ /dev/null @@ -1,39 +0,0 @@ -# in this lesson we will be talking about scope. Scope is the area in which -# a variable is (visible) accessible. For example, if you declare (create) a -# variable inside a function, it will only be accessible inside that -# function. - - -def testfunction(): - x = 10 - return x - - -# testfunction() -# print( -# x -# ) -# If the above code was ran, this will cause an error, because x is not accessible outside of the function - -# there are two ways around this -# 1. you can declare the variable outside of the function -# 2. you can return the variable from the function - - -def anotherFunction(): - x = 5 - return x - - -print(anotherFunction()) # this will print 5 - -# This also goes for objects and classes, which we will cover later - -# FINAL NOTE! Python and java differ in how they handle scope. -# In java, variables create in if else statements and loops are subject to scope, -# and won't be visible (accessible) outside of there - -bool = True -if bool: - x = 10 -print(x) # this will cause an error in java, but not here, in python diff --git a/Learning_Materials/Beginner_Level/Python/B7ClassesAndObjects.py b/Learning_Materials/Beginner_Level/Python/B7ClassesAndObjects.py deleted file mode 100644 index 044dd88..0000000 --- a/Learning_Materials/Beginner_Level/Python/B7ClassesAndObjects.py +++ /dev/null @@ -1,73 +0,0 @@ -# Hey! Your almost at the end of the beginner level. Don't get too excited though -# As this part is a pretty confusing part of coding, and should have your full attention - -# Classes and Objects -# Classes are a way to group functions and variables together -# Objects are instances of classes - -# To help make this a bit simpler, let's use an example -# Let's say your building a neighborhood - -# you would need blueprints for the houses, which in our case, represent classes -class blueprintForHouse: - color = "red" - size = "medium" - - -# You can then build the actual houses, which in our case, represent objects -house1 = blueprintForHouse() -house2 = blueprintForHouse() -# Then you can use the variables in the objects for whatever you need -print("What is the color of house 1? ") -print("Why it's " + house1.color + " of course!") - -# you can also change the variables in the objects -# or in other words, change the color or size of the house -house2.color = "blue" -print("What is the color of house 2? ") -print("Why it's " + house2.color + " of course!") - -# There are also sometimes built in functions in the classes -# take, for example, the __init__ function, which allows you to adjust -# variables (or properties of the house) when you create the object (house) - - -class revisedBlueprintForHouse: - def __init__( - self, color, size - ): # ignore the self for now, just know it's necessary - self.color = color - self.size = size - - -newHouse1 = revisedBlueprintForHouse("green", "large") -newHouse2 = revisedBlueprintForHouse("yellow", "small") -print("house 1 is " + newHouse1.color + " and " + newHouse1.size) -print("house 2 is " + newHouse2.color + " and " + newHouse2.size) - -# You can also have functions in classes -# Take, for example, a function that changes the color of the house - - -class anotherBlueprintForHouse: - def __init__(self, color, size): - self.color = color - self.size = size - - def changeToBasicHouse(self): - self.color = "purple" - self.color = "small" - - # to digress for a sec, let us now look at the self keyword - # the self keyword is used to refer to the object itself - # for example, if you wanted to change the color of the house, - # you would need to use the self keyword - # as just saying "color = newColor" would just create a new variable, - # or change a pre-existing variable outside of the class - # but by using "self" the program knows that you are referring - # to the variable inside the class - - -newerHouse3 = anotherBlueprintForHouse("blue", "medium") -newerHouse3.changeToBasicHouse() -print("house 3 is " + newerHouse3.color + " & " + newerHouse3.size + " size!") diff --git a/Learning_Materials/Beginner_Level/Python/B8FinalCheckIn.py b/Learning_Materials/Beginner_Level/Python/B8FinalCheckIn.py deleted file mode 100644 index 2f3fed2..0000000 --- a/Learning_Materials/Beginner_Level/Python/B8FinalCheckIn.py +++ /dev/null @@ -1,19 +0,0 @@ -# Hello! Congrats, your done learning with the beginner level! - -# Here are some exercises you can do to make sure that you understand the material so far - -# what is the difference between a float and an integer? (B1) - -# what does the modulus operator do? How might it be useful? (B2) - -# what operator adds a value to itself? (B2) - -# How are functions useful? (B5) - -# What are parameters? (B5) - -# What is the difference between a class and a object? (B7) - -# Why do we use classes? (B7) - -# why do we use the __init__ function when creating classes? (B7) diff --git a/Learning_Materials/Intermediate_Level/Intermediate_Intro.txt b/Learning_Materials/Intermediate_Level/Intermediate_Intro.txt deleted file mode 100644 index a0a0016..0000000 --- a/Learning_Materials/Intermediate_Level/Intermediate_Intro.txt +++ /dev/null @@ -1,13 +0,0 @@ -Hey! Good to see you here! it means that your at least dedicated enough to -stick through a lot of boring reading files and wracking your brain at whatever -I meant. Now onto the second leg of your journey. This will include - - -Converting Data Types -Arrays -While and For Loops -Enums -More Class stuff -Importing Files and Libraries - -Transfering to Java if on Python \ No newline at end of file diff --git a/Learning_Materials/Intermediate_Level/Java/I0JavaCheatsheet.java b/Learning_Materials/Intermediate_Level/Java/I0JavaCheatsheet.java deleted file mode 100644 index 97df074..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I0JavaCheatsheet.java +++ /dev/null @@ -1,106 +0,0 @@ -// SKIP TO LINE 7 - -// to declare (create) a function, you must use the following syntax: -public class I0JavaCheatsheet { - static void function_name() { - // code goes here - } - static boolean test_function() { - System.out.println("Hello World!"); - return true; - } - static int add(int x, int y) { - return x + y; - } - public int myInt(int x) { - return x; - } - // this is the main function, which is called whenever you press run in the top right - public static void main(String[] args) { - // Hello! This is a cheatsheet for the Python programmers are trasitioning to - // Java - // I will be going over the basics of Java, and how they compare to Python - // Feel free to mess around and try out what you learn here! - - // ---------- Comments ---------- // - - // This is a single line comment - /* - * This is a multi-line comment - */ - - // ---------- Variables ---------- // - - // to create variables, you must specify the type of variable - String text = "Hello World!"; // This is a String variable, called text, which holds the value "hello world" - int number = 5; // This is an integer variable, called number, which holds the value 5 - - // ---------- Print statements ---------- // - - // Print statements are a tad bit more complicated than in Python - System.out.println("Hello World!"); // This is the basic print statement, which sets a new line to print - System.out.print("Hello World!"); // This is the same as the above, but does not set a new line to print - - // ---------- Indedentation and curly braces ---------- // - - // Indentation doesn't show the scope of a things in java, in fact white space is ignored - // To show the scope of something, java uses curly braces - if (true) { // This is the start of the scope of the if statement -System.out.println("This is true!"); - } // end of the scope of if statement - - - // this is a ton of white space, but it doesn't matter - - - - else { - System.out.println("This is false!"); - // This is still in the scope - } - - // However, with that said, it is still good practice to indent your code, as it - // makes it easier to read and understand - - // ---------- Logic Operators (and, or, not) ---------- // - - // instead of using and, or, and not, java uses &&, ||, and ! - if (true && false) { // and - System.out.println("This is true!"); - } else if (true || false) { // or - System.out.println("This is false!"); - } else if (!true) { // not - System.out.println("This is false!"); - } - // another note, Java doesn't use elif, it uses else if - - // ---------- Functions ---------- // - - // functions are pretty different in java. - // to start, they have to be created before the main function (see line 12) - - // to see the syntax to create a function, see line 5 - - // the public/static part determines whether the function needs to be used in a - // object or not, we will go over this in more detail later (use static for now) - - // void determines whether the function returns a value or not. In this case - // void means it doesn't, however if you want to return a string (see line 8) - - // if you want to take in parameters, you will also need to specify the variable type (see line 12) - int total = add(5, 10); // this will return 15 - - // ---------- Classes and Objects ---------- // - - // your best bet for this one is to just go through the files in the coures for classes, but the cliff notes version is... - - // Every class be the name of the file (see line 4) - // Instead of using the function __init__, you create a constructor function using the class name - // to create a new object, you use the following syntax - I0JavaCheatsheet myObjectName = new I0JavaCheatsheet(); // this creates a new object called myObject - // functions created with the "public" keyword need objects to be called,(see line 15) - // while functions created with the "static" keyword do not - System.out.println(myObjectName.myInt(5)); // this will return 5 - - } -} diff --git a/Learning_Materials/Intermediate_Level/Java/I1ConvertingDatatypes.java b/Learning_Materials/Intermediate_Level/Java/I1ConvertingDatatypes.java deleted file mode 100644 index f0a6b59..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I1ConvertingDatatypes.java +++ /dev/null @@ -1,36 +0,0 @@ -public class I1ConvertingDatatypes { - public static void main(String[] args) { - // Sometimes you need to convert data from one type to another to - // perform certain operations or to manipulate the data in a certain way. - - // for example, let's say you want to add these to variables together - int number = 1; - String text = "1"; - - // you can make the end result a string - String totalText = number + text; // the number variable is auto converted to a string - System.out.println(totalText); // totalNum is now the String "11" - - // or you can make the end result an int - Integer totalNum = number + Integer.parseInt(text); - // Notice how we had to use the Integer.parseInt() method to convert a string to an int - // unlike before, where the int was auto converted to a string, we have to manually convert the string to an int - System.out.println(totalNum); // totalNum is now the int 2 - - // each variable type has a function to convert it to a string - // for example, the int variable type has a function called Integer.toString() - - // each variable also has a function to convert a string to that variable type - // for example, the Float variable type has a function called Float.parseFloat() - // Just make sure it's possible to convert the String (you can't turn letters into numbers!) - - // regarding doubles/floats, converting to integer or lower data type will remove the decimal entirely - double decimalTest = 1.6; - int integerTest = (int) decimalTest; // this is called casting - // Notice how we specified the data type we wanted to convert to in the parenthesis - System.out.println(integerTest); // integer is now 1 - - // This is just the basics, if you'd like, do a bit of googling to learn more about converting data types - // as there is a lot out there, and sometimes the conversions are automatic, and sometimes they are tricky - } -} diff --git a/Learning_Materials/Intermediate_Level/Java/I2Arrays.java b/Learning_Materials/Intermediate_Level/Java/I2Arrays.java deleted file mode 100644 index e83f944..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I2Arrays.java +++ /dev/null @@ -1,37 +0,0 @@ -public class I2Arrays { - public static void main(String[] args) { - //quick note: /* */ are multiline comments - /* - Now we are going to learn about array on python - - array, in short, are a variable that holds multiple values (called elements) - - In order to create a array, you would type square brackets - */ - - String[] names = {"Justin", "Henry", "Regulus", "Brandon"}; - // to create a array, put square brackets after the variable - // then when you put in your values, put curly brackets and separate each value (element) with a comma - - // each element is assigned a number, called an index. the first element is 0, the second is 1, and so on - - // to access a value, you would type the array name, then the index number in square brackets - System.out.println(names[1]); // this will print out "Henry" - - // you can also reassign values using the index - names[3] = "Gunner"; // this will change the "Brandon" to "Gunner" - - // Finally, you can also have a array inside of array - // This is called a 2d array, or a multi dimensional array - // useful for storing stuff in a grid format - - // to do this, add two square brackets after the variable - String[][] grid = { - {"x", "0", "x"}, - {"0", "x", "0"}, - {"x", "0", "x"} - }; - - - } -} diff --git a/Learning_Materials/Intermediate_Level/Java/I3Loops.java b/Learning_Materials/Intermediate_Level/Java/I3Loops.java deleted file mode 100644 index ec63029..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I3Loops.java +++ /dev/null @@ -1,38 +0,0 @@ -public class I3Loops { - - public static void main(String[] args) { - - // loops are how we can easily repeat code - - // ------- While loop ------- // - - //the while loop repeats whenever the condition is true. - // you will need to be very careful, since this can lead to infinite loops - - int count = 0; - while (count < 5) { // while count is less than 5 - System.out.println(count); // print count - count++; // adds one to clap - } - - // Example of an infinite loop - // while (count < 6) { - // System.out.println("Hello World!"); - // } - - // ------- For loop ------- // - - // the for loop is a bit more complicated, but is safer than the while loop - // the for loop has three parts, the initialization, the condition, and the increment - for (int i = 0; i < 5; i++) { // i is initialized to 0, and is incremented by 1 every loop - System.out.println("take two: " + i); // prints i - } - - // Something fun you can do with for loops is also iterate (loop) through arrays - String[] names = {"John", "Bob", "Alice"}; - for (int i = 0; i < names.length; i++) { // i is initialized to 0, and is incremented by 1 every loop - System.out.println(names[i]); // prints the name at index i - } - - } -} \ No newline at end of file diff --git a/Learning_Materials/Intermediate_Level/Java/I4CheckIn.java b/Learning_Materials/Intermediate_Level/Java/I4CheckIn.java deleted file mode 100644 index 19d3fc2..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I4CheckIn.java +++ /dev/null @@ -1,18 +0,0 @@ -public class I4CheckIn { - public static void main(String[] args) { - // Hey! congrats on making it to the check in, hope the previous stuff wasn't too hard :) - // A small note, if you have any questions, or aren't completely sure how something works, now - // is a good time to ask! As we will be building on these concepts, and it is no fun to just - // get stuck super far ahead and have no idea what is going on. - - // anyways, here are some questions - - // 1. How do you convert a string to an integer? - // 2. How can you use a loop in a for loop? - // 3. How can a while loop (or for loop) get stuck in an infinite loop? - - // A fun exercise you can do - // Create a program that takes a word from the user, and it's definition, and stores it in a dictionary array - // Include an array, loop, and function - } -} diff --git a/Learning_Materials/Intermediate_Level/Java/I5Enums.java b/Learning_Materials/Intermediate_Level/Java/I5Enums.java deleted file mode 100644 index 4d42826..0000000 --- a/Learning_Materials/Intermediate_Level/Java/I5Enums.java +++ /dev/null @@ -1,27 +0,0 @@ -public class I5Enums { - - // Here is an example of an enum - enum Direction { - NORTH, - SOUTH, - EAST, - WEST - } - public static void main(String[] args) { - /** - * Enums aren't often as used as the other variables, but we still use them in robotics, so it's important to know what they are. - * They are basically a way to store a set of constants (variables that cannot be changed) - */ - - - // We know that the direction of a robot can only be one of the four directions, so we can use an enum to store the directions - Direction robotDirection = Direction.NORTH; // robotDirection is now NORTH - robotDirection = Direction.SOUTH; // robotDirection is now SOUTH - // this way, we can't accidentally set robotDirection to something that isn't a direction - - /** - * A good example would be the code that is used for the controller dpad. - * Ex: https://github.com/J-The-Fox/FRC-Team-5098/blob/main/Example_Project/src/main/java/frc/controllers/README.md - */ - } -} diff --git a/Learning_Materials/Intermediate_Level/Python/I1ConvertingDatatypes.py b/Learning_Materials/Intermediate_Level/Python/I1ConvertingDatatypes.py deleted file mode 100644 index 828aaa0..0000000 --- a/Learning_Materials/Intermediate_Level/Python/I1ConvertingDatatypes.py +++ /dev/null @@ -1,27 +0,0 @@ -# Sometimes you need to convert data from one type to another to -# perform certain operations or to manipulate the data in a certain way. - -# for example, let's say you want to add these to variables together -intVariable = 2 -strVariable = " is the number of fingers I have" -# print(intVariable + strVariable) # this will give you an error -# as you can see, you can't add an integer and a string together - -# so you need to convert the integer to a string -addedVariable = str(intVariable) + strVariable - -print(addedVariable) - -# you can do this with any data type -# int() converts to an integer -# str() converts to a string -# double() converts to a double -# bool() converts to a boolean - -# just make sure it is possible to convert the data type -# print(int(strVariable)) # this will give you an error -# as you can't convert letters to a number - -# regarding doubles to integers, it will round down when converted -var = 7.9 -print(int(var)) # this will give you 7 diff --git a/Learning_Materials/Intermediate_Level/Python/I2Lists.py b/Learning_Materials/Intermediate_Level/Python/I2Lists.py deleted file mode 100644 index 1db23ff..0000000 --- a/Learning_Materials/Intermediate_Level/Python/I2Lists.py +++ /dev/null @@ -1,35 +0,0 @@ -# Now we are going to learn about lists in python - -# Lists, in short, are a variable that holds multiple values - -# In order to create a list, you would type square brackets -mylist = [] # this is an empty list - -# You can also create a list with elements (values) in it -# Seperate each element with a comma -numList = [1, 2, 3, 4, 5, 6, 7, 8, 9] # This is a list of integers - -mixedList = [1, "Hello", 3.14, True] # This is a list of mixed data types - -# you can also add/remove things to a list after it's been created -mylist.append(1) # this will add the number 1 to the end of the list -mylist.append(2) # this will add the number 2 to the end of the list -mylist.append(3) # this will add the number 3 to the end of the list -mylist.remove(2) # this will remove the number 2 from the list - -# something to note is that the elements (data in the list) are indexed -# this means that each element has a number associated with it -# the first element is 0, the second is 1, the third is 2, etc. -# you can access the elements by using the index -print(mylist[0]) # this will print the first element in the list - -# you can also change the elements in the list -mylist[0] = 5 # this will change the first element in the list to 5 - -# you can also insert elements into the list at specific points -mylist.insert(1, 2) # this will insert the number 2 at index 1 - -# finally, you can also have lists inside of lists -# this is called a 2D list, or multi-dimensional list -# this is useful for storing data in a grid format -ticTacToe = [["X", "O", "X"], ["O", "X", "O"], ["X", "O", "X"]] diff --git a/Learning_Materials/Robot_Level/Robot_Intro.txt b/Learning_Materials/Robot_Level/Robot_Intro.txt deleted file mode 100644 index 6302071..0000000 --- a/Learning_Materials/Robot_Level/Robot_Intro.txt +++ /dev/null @@ -1 +0,0 @@ -Alrighty! looks like your ready to move to some of the big stuff! \ No newline at end of file diff --git a/README.md b/README.md index 0aaf020..158a338 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,27 @@ # FRC Team 5098 Sting-r + + ![FRC-Team-5098-GitHub](https://github.com/J-The-Fox/FRC-Team-5098/assets/116409406/5e9d98b5-ade7-4456-bec0-9831072bbb54) -![badge](https://img.shields.io/github/last-commit/J-The-Fox/FRC-Team-5098?color=ee7b1a&display_timestamp=committer&label=Last%20Commit&style=flat-square) -![badge](https://img.shields.io/github/issues-pr/J-The-Fox/FRC-Team-5098?color=ee7b1a&label=Pull%20Requests&style=flat-square) -![badge](https://img.shields.io/github/contributors/J-The-Fox/FRC-Team-5098?color=ee7b1a&label=Contributors&style=flat-square) -![badge](https://img.shields.io/github/issues-raw/J-The-Fox/FRC-Team-5098?color=ee7b1a&label=Open%20Issues&style=flat-square) -![badge](https://img.shields.io/github/issues-closed-raw/J-The-Fox/FRC-Team-5098?color=ee7b1a&label=Closed%20Issues&style=flat-square) +![Last Commit](https://img.shields.io/github/last-commit/Sting-R/FRC-Team-5098?color=700e9b&display_timestamp=committer&label=Last%20Commit&style=flat-square) +![Pull Requests](https://img.shields.io/github/issues-pr/Sting-R/FRC-Team-5098?color=ffd000&label=Pull%20Requests&style=flat-square) +![Contributors](https://img.shields.io/github/contributors/Sting-R/FRC-Team-5098?color=700e9b&label=Contributors&style=flat-square) +![Open Issues](https://img.shields.io/github/issues-raw/Sting-R/FRC-Team-5098?color=ffd000&label=Open%20Issues&style=flat-square) +![Closed Issues](https://img.shields.io/github/issues-closed-raw/Sting-R/FRC-Team-5098?color=700e9b&label=Closed%20Issues&style=flat-square) -[![Readme Card](https://github-readme-stats-sigma-five.vercel.app/api/pin/?username=J-The-Fox&repo=FRC-Team-5098&theme=dark)](https://github.com/J-The-Fox/FRC-Team-5098) +[![Readme Card](https://github-readme-stats-sigma-five.vercel.app/api/pin/?username=Sting-R&repo=FRC-Team-5098&theme=shades-of-purple&bg_color=00000000)](https://github.com/Sting-R/FRC-Team-5098) ## Contributing -This is free for **anyone** to contribute to! (Especailly if you are part of our team) +This is free for **anyone** to contribute to! (Especially if you are part of our team) If you would like to contribute to this repository; ✨amazing!✨ Just follow some rules: + + **Wiki** - Before you edit anything in the wiki, prepose your change in the [discussion](https://github.com/J-The-Fox/FRC-Team-5098/discussions/3) first - If you take images, text, screenshots, etc from somewhere else for the wiki, give credit to the original source or author! @@ -21,15 +29,26 @@ If you would like to contribute to this repository; ✨amazing!✨ Just follow s **Code** - If you're adding code, please make it well documented. We all would like to know what it is doing without digging around -- If you would like to add another WPILib project, make sure to ask before hand. -- Stick to Java and Python if possible but if you would like to use C++, make it well documented as our team uses Java primarily. (Would need to go in its own WPILib project) +- If you would like to add another WPILib project, make sure to ask beforehand. +- Stick to Java and Python if possible, but if you would like to use C++, make it well documented as our team uses Java primarily. (Would need to go in its own WPILib project) - Add any examples you would like, can be related to the WPILib API or not. Any examples will help further the understanding of others **General** -- Be cival and kind. Giving constructive critisim is okay but at least be kind about it +- Be civil and kind. Giving constructive criticism is okay, but at least be kind about it - If you have any questions or have an issue, feel free to start a discussion or open up an issue - Look in the [TODO discussion](https://github.com/J-The-Fox/FRC-Team-5098/discussions/4) to see what else needs to be completed. If you wanna add something or change something, feel free to ask ---- -Happy Programming! -\- [J-The-Fox](https://github.com/J-The-Fox) +## Robot Setup + +### Drive System + +The drive system used is the Swerve X[^1] +The motor that we use is most likely going to be the Kraken X60 + +However, due to issues with the Kraken X60s during the 2023-2024 year, we may revert back to Falcon 500s. The issue at hand was the Kraken X60s failing during matches where the motor would fail to spin at full rpm, sound terrible, and heat up very quickly. +During last season alone, we lost 3 Kraken X60s. Hopefully, during this year's 2024-2025 season, we won't experience as many issues. But the motors in use for the drive system are still up for discussion. + +> [!NOTE] +> Other information will be posted whenever we have a more up-to-date design of our robot (and whenever we know what the challenge will be!) + +[^1]: [Swerve X](https://wcproducts.com/products/swerve-x) diff --git a/2023-2024/main-bot/WPILib-License.md b/WPILib-License.md similarity index 59% rename from 2023-2024/main-bot/WPILib-License.md rename to WPILib-License.md index 3b9a563..e7cd597 100644 --- a/2023-2024/main-bot/WPILib-License.md +++ b/WPILib-License.md @@ -1,16 +1,16 @@ -Copyright (c) 2009-2023 FIRST and other WPILib contributors +Copyright (c) 2009-2024 FIRST and other WPILib contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of FIRST, WPILib, nor the names of other WPILib - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of FIRST, WPILib, nor the names of other WPILib + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/2023-2024/main-bot/build.gradle b/build.gradle similarity index 86% rename from 2023-2024/main-bot/build.gradle rename to build.gradle index df1e4bc..b9f0e50 100644 --- a/2023-2024/main-bot/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2024.3.2" + id "edu.wpi.first.GradleRIO" version "2025.2.1" } java { @@ -33,6 +33,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -50,6 +52,7 @@ def includeDesktopSupport = false // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -67,11 +70,8 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' - - implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..a4b76b9 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/2023-2024/main-bot/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties similarity index 91% rename from 2023-2024/main-bot/gradle/wrapper/gradle-wrapper.properties rename to gradle/wrapper/gradle-wrapper.properties index c5c2706..8e975a5 100644 --- a/2023-2024/main-bot/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/2023-2024/main-bot/gradlew b/gradlew similarity index 96% rename from 2023-2024/main-bot/gradlew rename to gradlew index 1aa94a4..f5feea6 100755 --- a/2023-2024/main-bot/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/2023-2024/main-bot/gradlew.bat b/gradlew.bat similarity index 88% rename from 2023-2024/main-bot/gradlew.bat rename to gradlew.bat index 6689b85..9b42019 100644 --- a/2023-2024/main-bot/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -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. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -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. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/2023-2024/main-bot/settings.gradle b/settings.gradle similarity index 93% rename from 2023-2024/main-bot/settings.gradle rename to settings.gradle index 3e30f84..7cab49b 100644 --- a/2023-2024/main-bot/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2024' + String frcYear = '2025' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') diff --git a/2022-2023/main-bot/src/main/deploy/example.txt b/src/main/deploy/example.txt old mode 100755 new mode 100644 similarity index 100% rename from 2022-2023/main-bot/src/main/deploy/example.txt rename to src/main/deploy/example.txt diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java new file mode 100644 index 0000000..6da57f3 --- /dev/null +++ b/src/main/java/frc/robot/Constants.java @@ -0,0 +1,26 @@ +// 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 frc.robot; + +/** + * 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 { + public static class OperatorConstants { + + /** + * An example constant. Any of those can be put in here + */ + public static final int kDriverControllerPort = 0; + } +} diff --git a/2023-2024/main-bot/src/main/java/frc/robot/Main.java b/src/main/java/frc/robot/Main.java similarity index 70% rename from 2023-2024/main-bot/src/main/java/frc/robot/Main.java rename to src/main/java/frc/robot/Main.java index 48b72ed..a9fe0d0 100644 --- a/2023-2024/main-bot/src/main/java/frc/robot/Main.java +++ b/src/main/java/frc/robot/Main.java @@ -7,10 +7,9 @@ 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. + * 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() { @@ -18,11 +17,12 @@ private Main() { /** * Main initialization function. Do not perform any initialization here. + * *

* If you change your main robot class, change the parameter type. *

* - * @param args arguments from command line + * @param args Any arguments passed into main */ public static void main(final String... args) { RobotBase.startRobot(Robot::new); diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java new file mode 100644 index 0000000..c2f9dbc --- /dev/null +++ b/src/main/java/frc/robot/Robot.java @@ -0,0 +1,116 @@ +// 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 frc.robot; + +import edu.wpi.first.wpilibj.TimedRobot; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.CommandScheduler; + +/** + * The methods in this class are called automatically corresponding to each + * mode, as described in the TimedRobot documentation. If you change the name + * of this class or the package after creating this project, you must also + * update the Main.java file in the project. + */ +public final class Robot extends TimedRobot { + private Command m_autonomousCommand; + + private final RobotContainer m_robotContainer; + + /** + * This function is run when the robot is first started up and should be used + * for any initialization code. + */ + public Robot() { + // Instantiate our RobotContainer. This will perform all our button + // bindings, and put our autonomous chooser on the dashboard. + m_robotContainer = new RobotContainer(); + } + + /** + * This function is called every 20 ms, 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() { + } + + @Override + public void disabledPeriodic() { + } + + /** This autonomous runs the autonomous command selected by your + * {@link RobotContainer} class. + */ + @Override + public void autonomousInit() { + m_autonomousCommand = m_robotContainer.getAutonomousCommand(); + + // schedule the autonomous command (example) + if (m_autonomousCommand != null) { + m_autonomousCommand.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 (m_autonomousCommand != null) { + m_autonomousCommand.cancel(); + } + } + + /** This function is called periodically during operator control. */ + @Override + public void teleopPeriodic() { + } + + @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() { + } + + /** This function is called once when the robot is first started up. */ + @Override + public void simulationInit() { + } + + /** This function is called periodically whilst in simulation. */ + @Override + public void simulationPeriodic() { + } +} diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java new file mode 100644 index 0000000..40a816f --- /dev/null +++ b/src/main/java/frc/robot/RobotContainer.java @@ -0,0 +1,77 @@ +// 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 frc.robot; + +import frc.robot.Constants.OperatorConstants; +import frc.robot.commands.Autos; +import frc.robot.commands.ExampleCommand; +import frc.robot.subsystems.ExampleSubsystem; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import edu.wpi.first.wpilibj2.command.button.Trigger; + +/** + * 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 trigger mappings) should be declared here. + */ +public class RobotContainer { + // The robot's subsystems and commands are defined here... + + /** + * This is where any subsystems would get initialized + */ + private final ExampleSubsystem m_exampleSubsystem = new ExampleSubsystem(); + + /** + * The controller to use as the drive controller + * + * This can be replace with CommandPS4Controller or CommandJoystick if needed + */ + private final CommandXboxController m_driverController = + new CommandXboxController(OperatorConstants.kDriverControllerPort); + + /** The container for the robot. Contains subsystems, OI devices, and + * commands. + */ + public RobotContainer() { + // Configure the trigger bindings + configureBindings(); + } + + /** + * Use this method to define your trigger->command mappings. Triggers can be + * created via the + * {@link Trigger#Trigger(java.util.function.BooleanSupplier)} constructor + * with an arbitrary predicate, or via the named factories in + * {@link edu.wpi.first.wpilibj2.command.button.CommandGenericHID}'s + * subclasses for {@link CommandXboxController Xbox}/ + * {@link edu.wpi.first.wpilibj2.command.button.CommandPS4Controller PS4} + * controllers or + * {@link edu.wpi.first.wpilibj2.command.button.CommandJoystick Flight + * joysticks}. + */ + private void configureBindings() { + // Schedule `ExampleCommand` when `exampleCondition` changes to `true` + new Trigger(m_exampleSubsystem::exampleCondition) + .onTrue(new ExampleCommand(m_exampleSubsystem)); + + // Schedule `exampleMethodCommand` when the Xbox controller's B button is + // pressed, cancelling on release. + m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); + } + + /** + * Use this to pass the autonomous command to the main {@link Robot} class. + * + * @return the command to run in autonomous + */ + public Command getAutonomousCommand() { + // An example command will be run in autonomous + return Autos.exampleAuto(m_exampleSubsystem); + } +} diff --git a/src/main/java/frc/robot/commands/Autos.java b/src/main/java/frc/robot/commands/Autos.java new file mode 100644 index 0000000..107aad7 --- /dev/null +++ b/src/main/java/frc/robot/commands/Autos.java @@ -0,0 +1,20 @@ +// 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 frc.robot.commands; + +import frc.robot.subsystems.ExampleSubsystem; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; + +public final class Autos { + /** Example static factory for an autonomous command. */ + public static Command exampleAuto(ExampleSubsystem subsystem) { + return Commands.sequence(subsystem.exampleMethodCommand(), new ExampleCommand(subsystem)); + } + + private Autos() { + throw new UnsupportedOperationException("This is a utility class!"); + } +} diff --git a/src/main/java/frc/robot/commands/ExampleCommand.java b/src/main/java/frc/robot/commands/ExampleCommand.java new file mode 100644 index 0000000..33d51b4 --- /dev/null +++ b/src/main/java/frc/robot/commands/ExampleCommand.java @@ -0,0 +1,52 @@ +// 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 frc.robot.commands; + +import frc.robot.subsystems.ExampleSubsystem; +import edu.wpi.first.wpilibj2.command.Command; + +/** An example command that uses an example subsystem. */ +public final class ExampleCommand extends Command { + @SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"}) + + /** + * This is an example subsystem that should be used with this command + */ + private final ExampleSubsystem m_subsystem; + // This would need to bbe surpressed as it's not an actual error and it quite + // standard in some use cases such as this one + + /** + * Creates a new ExampleCommand. + * + * @param subsystem The subsystem used by this command. + */ + public ExampleCommand(final ExampleSubsystem subsystem) { + m_subsystem = subsystem; + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(subsystem); + } + + // 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(final boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/package-info.java b/src/main/java/frc/robot/commands/package-info.java new file mode 100644 index 0000000..1f43eb0 --- /dev/null +++ b/src/main/java/frc/robot/commands/package-info.java @@ -0,0 +1,6 @@ +/** + * Base commands package. + * + * This holds all current commands that are used in the robot + */ +package frc.robot.commands; diff --git a/src/main/java/frc/robot/package-info.java b/src/main/java/frc/robot/package-info.java new file mode 100644 index 0000000..cccb4d7 --- /dev/null +++ b/src/main/java/frc/robot/package-info.java @@ -0,0 +1,7 @@ +/** + * Main robot package. + * + * This holds all the code that is ran on the robot. Any extra files are held + * outside of this package such as json files + */ +package frc.robot; diff --git a/src/main/java/frc/robot/subsystems/ExampleSubsystem.java b/src/main/java/frc/robot/subsystems/ExampleSubsystem.java new file mode 100644 index 0000000..5f2afe0 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/ExampleSubsystem.java @@ -0,0 +1,50 @@ +// 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 frc.robot.subsystems; + +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class ExampleSubsystem extends SubsystemBase { + + /** Creates a new ExampleSubsystem. */ + public ExampleSubsystem() { + } + + /** + * Example command factory method. + * + * @return a command + */ + public Command exampleMethodCommand() { + // Inline construction of command goes here. + // Subsystem::RunOnce implicitly requires `this` subsystem. + return runOnce( + () -> { + /* one-time action goes here */ + }); + } + + /** + * An example method querying a boolean state of the subsystem (for + * example, a digital sensor). + * + * @return value of some boolean subsystem state, such as a digital sensor. + */ + public boolean exampleCondition() { + // Query some boolean state, such as a digital sensor. + return false; + } + + @Override + public void periodic() { + // This method will be called once per scheduler run + } + + @Override + public void simulationPeriodic() { + // This method will be called once per scheduler run during simulation + } +} diff --git a/src/main/java/frc/robot/subsystems/package-info.java b/src/main/java/frc/robot/subsystems/package-info.java new file mode 100644 index 0000000..2092498 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/package-info.java @@ -0,0 +1,6 @@ +/** + * Main subsystem package. + * + * This holds all the subsystems that are used on the robot + */ +package frc.robot.subsystems; diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json new file mode 100644 index 0000000..2021898 --- /dev/null +++ b/vendordeps/PathplannerLib.json @@ -0,0 +1,38 @@ +{ + "fileName": "PathplannerLib.json", + "name": "PathplannerLib", + "version": "2025.2.3", + "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", + "frcYear": "2025", + "mavenUrls": [ + "https://3015rangerrobotics.github.io/pathplannerlib/repo" + ], + "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json", + "javaDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-java", + "version": "2025.2.3" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-cpp", + "version": "2025.2.3", + "libName": "PathplannerLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxathena", + "linuxarm32", + "linuxarm64" + ] + } + ] +} \ No newline at end of file diff --git a/2023-2024/main-bot/vendordeps/Phoenix5.json b/vendordeps/Phoenix5-frc2025-latest.json similarity index 74% rename from 2023-2024/main-bot/vendordeps/Phoenix5.json rename to vendordeps/Phoenix5-frc2025-latest.json index ff7359e..c1098dc 100644 --- a/2023-2024/main-bot/vendordeps/Phoenix5.json +++ b/vendordeps/Phoenix5-frc2025-latest.json @@ -1,43 +1,56 @@ { - "fileName": "Phoenix5.json", + "fileName": "Phoenix5-frc2025-latest.json", "name": "CTRE-Phoenix (v5)", - "version": "5.33.1", - "frcYear": 2024, + "version": "5.35.1", + "frcYear": "2025", "uuid": "ab676553-b602-441f-a38d-f1296eff6537", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2024-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2025-latest.json", "requires": [ { "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", - "offlineFileName": "Phoenix6.json", - "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2024-latest.json" + "offlineFileName": "Phoenix6-frc2025-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json" + } + ], + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" + }, + { + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", + "offlineFileName": "Phoenix5-replay-frc2025-latest.json" } ], "javaDependencies": [ { "groupId": "com.ctre.phoenix", "artifactId": "api-java", - "version": "5.33.1" + "version": "5.35.1" }, { "groupId": "com.ctre.phoenix", "artifactId": "wpiapi-java", - "version": "5.33.1" + "version": "5.35.1" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix", "artifactId": "cci", - "version": "5.33.1", + "version": "5.35.1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -45,12 +58,13 @@ { "groupId": "com.ctre.phoenix.sim", "artifactId": "cci-sim", - "version": "5.33.1", + "version": "5.35.1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -60,7 +74,7 @@ { "groupId": "com.ctre.phoenix", "artifactId": "wpiapi-cpp", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_Phoenix_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -68,6 +82,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -75,7 +90,7 @@ { "groupId": "com.ctre.phoenix", "artifactId": "api-cpp", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_Phoenix", "headerClassifier": "headers", "sharedLibrary": true, @@ -83,6 +98,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -90,7 +106,7 @@ { "groupId": "com.ctre.phoenix", "artifactId": "cci", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_PhoenixCCI", "headerClassifier": "headers", "sharedLibrary": true, @@ -98,6 +114,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -105,7 +122,7 @@ { "groupId": "com.ctre.phoenix.sim", "artifactId": "wpiapi-cpp-sim", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_Phoenix_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -113,6 +130,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -120,7 +138,7 @@ { "groupId": "com.ctre.phoenix.sim", "artifactId": "api-cpp-sim", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_PhoenixSim", "headerClassifier": "headers", "sharedLibrary": true, @@ -128,6 +146,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -135,7 +154,7 @@ { "groupId": "com.ctre.phoenix.sim", "artifactId": "cci-sim", - "version": "5.33.1", + "version": "5.35.1", "libName": "CTRE_PhoenixCCISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -143,6 +162,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" diff --git a/2023-2024/main-bot/vendordeps/Phoenix6.json b/vendordeps/Phoenix6-frc2025-latest.json similarity index 71% rename from 2023-2024/main-bot/vendordeps/Phoenix6.json rename to vendordeps/Phoenix6-frc2025-latest.json index 2b7d172..acc78db 100644 --- a/2023-2024/main-bot/vendordeps/Phoenix6.json +++ b/vendordeps/Phoenix6-frc2025-latest.json @@ -1,76 +1,94 @@ { - "fileName": "Phoenix6.json", + "fileName": "Phoenix6-frc2025-latest.json", "name": "CTRE-Phoenix (v6)", - "version": "24.2.0", - "frcYear": 2024, + "version": "25.2.2", + "frcYear": "2025", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2024-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json", "conflictsWith": [ { - "uuid": "3fcf3402-e646-4fa6-971e-18afe8173b1a", - "errorMessage": "The combined Phoenix-6-And-5 vendordep is no longer supported. Please remove the vendordep and instead add both the latest Phoenix 6 vendordep and Phoenix 5 vendordep.", - "offlineFileName": "Phoenix6And5.json" + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" } ], "javaDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "24.2.0" + "version": "25.2.2" } ], "jniDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "25.2.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "tools-sim", - "version": "24.2.0", + "artifactId": "api-cpp-sim", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simTalonSRX", - "version": "24.2.0", + "artifactId": "tools-sim", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simTalonFX", - "version": "24.2.0", + "artifactId": "simTalonSRX", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -78,12 +96,13 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -91,12 +110,13 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -104,12 +124,13 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -117,12 +138,27 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.2.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -130,12 +166,13 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -143,12 +180,27 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "25.2.2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.2.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -158,7 +210,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -166,6 +218,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -173,7 +226,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -181,6 +234,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -188,7 +242,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -196,6 +250,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -203,7 +258,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -211,6 +266,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -218,7 +274,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -226,81 +282,87 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simTalonFX", - "version": "24.2.0", - "libName": "CTRE_SimTalonFX", + "artifactId": "simVictorSPX", + "version": "25.2.2", + "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simVictorSPX", - "version": "24.2.0", - "libName": "CTRE_SimVictorSPX", + "artifactId": "simPigeonIMU", + "version": "25.2.2", + "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simPigeonIMU", - "version": "24.2.0", - "libName": "CTRE_SimPigeonIMU", + "artifactId": "simCANCoder", + "version": "25.2.2", + "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simCANCoder", - "version": "24.2.0", - "libName": "CTRE_SimCANCoder", + "artifactId": "simProTalonFX", + "version": "25.2.2", + "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProTalonFX", - "version": "24.2.0", - "libName": "CTRE_SimProTalonFX", + "artifactId": "simProTalonFXS", + "version": "25.2.2", + "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -308,7 +370,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -316,6 +378,7 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -323,7 +386,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "25.2.2", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -331,6 +394,23 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.2.2", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" diff --git a/Example_Project/vendordeps/REVLib.json b/vendordeps/REVLib-2025.0.0.json similarity index 88% rename from Example_Project/vendordeps/REVLib.json rename to vendordeps/REVLib-2025.0.0.json index f2d0b7d..cde6011 100644 --- a/Example_Project/vendordeps/REVLib.json +++ b/vendordeps/REVLib-2025.0.0.json @@ -1,24 +1,25 @@ { - "fileName": "REVLib.json", + "fileName": "REVLib-2025.0.0.json", "name": "REVLib", - "version": "2023.1.3", + "version": "2025.0.0", + "frcYear": "2025", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ "https://maven.revrobotics.com/" ], - "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2023.json", + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2025.json", "javaDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", - "version": "2023.1.3" + "version": "2025.0.0" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2023.1.3", + "version": "2025.0.0", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -36,7 +37,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2023.1.3", + "version": "2025.0.0", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -54,7 +55,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2023.1.3", + "version": "2025.0.0", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/Studica-2025.0.0.json b/vendordeps/Studica-2025.0.0.json new file mode 100644 index 0000000..ddb0e44 --- /dev/null +++ b/vendordeps/Studica-2025.0.0.json @@ -0,0 +1,71 @@ +{ + "fileName": "Studica-2025.0.0.json", + "name": "Studica", + "version": "2025.0.0", + "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", + "frcYear": "2025", + "mavenUrls": [ + "https://dev.studica.com/maven/release/2025/" + ], + "jsonUrl": "https://dev.studica.com/releases/2025/Studica-2025.0.0.json", + "cppDependencies": [ + { + "artifactId": "Studica-cpp", + "binaryPlatforms": [ + "linuxathena", + "linuxarm32", + "linuxarm64", + "linuxx86-64", + "osxuniversal", + "windowsx86-64" + ], + "groupId": "com.studica.frc", + "headerClassifier": "headers", + "libName": "Studica", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "version": "2025.0.0" + }, + { + "artifactId": "Studica-driver", + "binaryPlatforms": [ + "linuxathena", + "linuxarm32", + "linuxarm64", + "linuxx86-64", + "osxuniversal", + "windowsx86-64" + ], + "groupId": "com.studica.frc", + "headerClassifier": "headers", + "libName": "StudicaDriver", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "version": "2025.0.0" + } + ], + "javaDependencies": [ + { + "artifactId": "Studica-java", + "groupId": "com.studica.frc", + "version": "2025.0.0" + } + ], + "jniDependencies": [ + { + "artifactId": "Studica-driver", + "groupId": "com.studica.frc", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena", + "linuxarm32", + "linuxarm64", + "linuxx86-64", + "osxuniversal", + "windowsx86-64" + ], + "version": "2025.0.0" + } + ] +} \ No newline at end of file diff --git a/Example_Project/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json similarity index 97% rename from Example_Project/vendordeps/WPILibNewCommands.json rename to vendordeps/WPILibNewCommands.json index bd535bf..3718e0a 100644 --- a/Example_Project/vendordeps/WPILibNewCommands.json +++ b/vendordeps/WPILibNewCommands.json @@ -3,6 +3,7 @@ "name": "WPILib-New-Commands", "version": "1.0.0", "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2025", "mavenUrls": [], "jsonUrl": "", "javaDependencies": [