Skip to content

Swerveonly #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
76a90b6
Update README.md
mebrahimaleem Jan 12, 2025
70b4cc1
fix: vendordeps
mebrahimaleem Jan 12, 2025
3feec84
fix: vendordep
mebrahimaleem Jan 12, 2025
806e15d
Import to 2025
ReeledWarrior14 Jan 15, 2025
5d1e78b
fix: properly ported vendordeps
ReeledWarrior14 Jan 15, 2025
839c755
tljr constants and fixed on bot offsets
ProgrammingSR Jan 16, 2025
f04f963
formatting and small speed changes
ReeledWarrior14 Jan 16, 2025
186e7e2
Removed setting offsets in code
ReeledWarrior14 Jan 19, 2025
c0bb86d
Small formatting changes
ReeledWarrior14 Jan 19, 2025
7922b01
Merge pull request #3 from SaintsRobotics/tljr
ReeledWarrior14 Jan 19, 2025
d4d9c58
fix rotation direction (#4)
ReeledWarrior14 Jan 23, 2025
2421647
Custom Periodic (#5)
mebrahimaleem Feb 3, 2025
0277306
Updated Vision (#2)
ReeledWarrior14 Feb 11, 2025
c5d41c8
feat: elevator (#7)
ProgrammingSR Feb 14, 2025
742aead
Limelight connected boolean (#16)
ProgrammingSR Feb 15, 2025
ec8acaf
Change motors in DriveSubsystem to Spark Flexes (#18)
ProgrammingSR Feb 23, 2025
b79aeb8
End Effector (#21)
mebrahimaleem Feb 25, 2025
90b6629
fix: odometry/gyro reset fix (#22)
mebrahimaleem Feb 25, 2025
195c655
Acceleration Limits (#24)
ProgrammingSR Feb 26, 2025
aa44163
Reef Auto Align (#14)
ReeledWarrior14 Feb 26, 2025
30f7512
enabled deleteOldFiles (#25)
ProgrammingSR Mar 2, 2025
4fb5b7b
feat: interlocks
ProgrammingSR Feb 25, 2025
dcf6469
feat: manual elevator control
mebrahimaleem Feb 25, 2025
39fc2fc
feat: more tests
mebrahimaleem Feb 26, 2025
151e3dc
fix: elevator and pivot command bugs
ProgrammingSR Feb 27, 2025
a2f8672
refactor: moved to constants
ProgrammingSR Feb 28, 2025
a61515d
fix: fixed interlock and command logic
ReeledWarrior14 Feb 28, 2025
ae1f895
refactor: semi automatic and tuning
mebrahimaleem Mar 1, 2025
b74ddea
feat: discrete pivot limits
ProgrammingSR Mar 2, 2025
f6fee18
refactor: uncommented drive subsystem
ProgrammingSR Mar 5, 2025
c40515f
Discrete limits fix (#34)
mebrahimaleem Mar 7, 2025
7af2a82
Setpoint tuning (#41)
ProgrammingSR Mar 7, 2025
fc41574
Setpoint tuning (#42)
ProgrammingSR Mar 8, 2025
daeb70d
Sammamish Competition Changes (#43)
ReeledWarrior14 Mar 11, 2025
0bdaf05
fix: max distance check (#36)
mebrahimaleem Mar 12, 2025
1b17587
Code refactor and fixes (#44)
mebrahimaleem Mar 14, 2025
36744f1
Haptics (#50)
ProgrammingSR Mar 15, 2025
7f27192
this is fine (#51)
ReeledWarrior14 Mar 19, 2025
4927b4c
Auton solution 4 (#45)
mebrahimaleem Mar 19, 2025
ac64bdc
Update WPILib to 2025.3.2 (#52)
ReeledWarrior14 Mar 20, 2025
5c6d21d
Refactor coral commands and move coral intake detection to fast periodic
ReeledWarrior14 Mar 20, 2025
bb46b34
formatting and docs
ReeledWarrior14 Mar 20, 2025
2dce69a
Fix EndEffectorSubsystem
ReeledWarrior14 Mar 20, 2025
5e631bf
Intake tweaks (#53)
ProgrammingSR Mar 21, 2025
e6d0c91
removed all non-swerve stuff
ProgrammingSR Mar 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,19 @@ out/
.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

# Eclipse generated file for annotation processors
.factorypath
12 changes: 0 additions & 12 deletions .pathplanner/settings.json

This file was deleted.

33 changes: 32 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,36 @@
}
},
],
"java.test.defaultConfig": "WPIlibUnitTests"
"java.test.defaultConfig": "WPIlibUnitTests",
"java.import.gradle.annotationProcessing.enabled": false,
"java.completion.favoriteStaticMembers": [
"org.junit.Assert.*",
"org.junit.Assume.*",
"org.junit.jupiter.api.Assertions.*",
"org.junit.jupiter.api.Assumptions.*",
"org.junit.jupiter.api.DynamicContainer.*",
"org.junit.jupiter.api.DynamicTest.*",
"org.mockito.Mockito.*",
"org.mockito.ArgumentMatchers.*",
"org.mockito.Answers.*",
"edu.wpi.first.units.Units.*"
],
"java.completion.filteredTypes": [
"java.awt.*",
"com.sun.*",
"sun.*",
"jdk.*",
"org.graalvm.*",
"io.micrometer.shaded.*",
"java.beans.*",
"java.util.Base64.*",
"java.util.Timer",
"java.sql.*",
"javax.swing.*",
"javax.management.*",
"javax.smartcardio.*",
"edu.wpi.first.math.proto.*",
"edu.wpi.first.math.**.proto.*",
"edu.wpi.first.math.**.struct.*",
]
}
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2024",
"projectYear": "2025",
"teamNumber": 1899
}
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# swerve-base
Code for a basic swerve drive base
# Reefscape2025
FRC team Saints Robotics 1899's code for the 2025 season.

## Features:
* Swerve drive
* Heading correction
* WPILib Sim support
* AdvantageScope support
* Pose estimation

## TODO/WIP:
* Auton setup
* Test heading correction
## Commit Message Prefixes

All commit messages must start with one of the following prefixes.

### Sim Controls
* W, A, S, D - Basic field-relative translation movement
* Left Arrow, Right Arrow - Rotational movement
* R, E - Increase/Decrease speed scaling (needs to be held down)
* N (Holding down) + W, A, S, D - Robot Relative driving
* Comma - Reset heading
* **"docs:"** - Documentation changes
* **"feat:"** - New features
* **"fix:"** - Bug fixes
* **"refactor:"** - Changes that affect code organization
* **"style:"** - Changes that are formatting related (white-space, formatting, missing semi-colons, etc)
* **"test:"** - New tests or correcting existing tests
* **"perf:"** - Improves performance
* **"chore:"** - Miscellaneous changes

### Examples

* feat: created swerve functions
* fix: autonomous turning bug
* refactor: decoupled functions into new file
* docs: added more info about the codebase
* style: formatted the gradle file
* test: fixed deadzone test
* chore: licensing and credits
2 changes: 1 addition & 1 deletion WPILib-License.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
Expand Down
19 changes: 13 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2024.2.1"
id "edu.wpi.first.GradleRIO" version "2025.3.2"
}

java {
Expand Down Expand Up @@ -33,6 +33,8 @@ deploy {
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
files = project.fileTree('src/main/deploy')
directory = '/home/lvuser/deploy'
deleteOldFiles = true // Change to true to delete files on roboRIO that no
// longer exist in deploy directory of this project
}
}
}
Expand All @@ -42,14 +44,15 @@ deploy {
def deployArtifact = deploy.targets.roborio.artifacts.frcJava

// Set to true to use debug for JNI.
// wpi.java.debugJni = false
wpi.java.debugJni = false

// Set this to true to enable desktop support.
def includeDesktopSupport = true

// 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()

Expand All @@ -67,13 +70,16 @@ dependencies {
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

// testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
// useJUnitPlatform()
// systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
testLogging {
exceptionFormat = 'full'
}
}

// Simulation configuration (e.g. environment variables).
Expand All @@ -99,3 +105,4 @@ wpi.java.configureTestTasks(test)
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=permwrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand Down Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -20,8 +20,8 @@ pluginManagement {
}
def frcHomeMaven = new File(frcHome, 'maven')
maven {
name 'frcHome'
url frcHomeMaven
name = 'frcHome'
url = frcHomeMaven
}
}
}
Expand Down
40 changes: 18 additions & 22 deletions simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,18 @@
},
{
"decKey": 69,
"decayRate": 0.009999999776482582,
"decayRate": 0.0,
"incKey": 82,
"keyRate": 0.009999999776482582
},
{
"decKey": 264,
"incKey": 265
},
{
"decKey": 262,
"incKey": 263
}
],
"axisCount": 5,
"buttonCount": 8,
"axisCount": 3,
"buttonCount": 4,
"buttonKeys": [
90,
88,
67,
86,
66,
78,
77,
44
86
],
"povConfig": [
{
Expand Down Expand Up @@ -65,14 +53,24 @@
"axisCount": 2,
"buttonCount": 4,
"buttonKeys": [
-1,
-1,
77,
44,
46,
47
],
"povCount": 0
},
{
"axisConfig": [
{
"decKey": 263,
"incKey": 262
},
{
"decKey": 265,
"incKey": 264
}
],
"axisCount": 2,
"buttonCount": 6,
"buttonKeys": [
Expand All @@ -93,10 +91,8 @@
],
"robotJoysticks": [
{
"guid": "Keyboard0"
},
{
"guid": "Keyboard1"
"guid": "78696e70757401000000000000000000",
"useGamepad": true
}
]
}
32 changes: 0 additions & 32 deletions simgui.json

This file was deleted.

Loading