Skip to content
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

Swerve rewrite #53

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
edfae15
worlds load in debugging
MatthewChoulas Apr 17, 2024
dc499c5
worlds q1-19
MatthewChoulas Apr 18, 2024
a5429cb
code day 1
AlphaPranav9102 Apr 19, 2024
68ee786
adjust amp center line without first note
MatthewChoulas Apr 19, 2024
a430254
fried at worlds but its over?
AlphaPranav9102 May 13, 2024
52d87f3
tune swerve turning
MatthewChoulas May 17, 2024
5542200
Create and write all of swerve logic inlcude Logger stuffs
SirBeans Jun 19, 2024
716974d
Create and write all of swerve module IO
SirBeans Jun 19, 2024
81841d9
Fix Logger Stuff
SirBeans Jun 19, 2024
a134f46
Merge branch 'main' of https://github.com/team4099/Crescendo-2024 int…
SirBeans Jun 20, 2024
de9f858
write all the setup variables for logic file
SirBeans Jun 20, 2024
8dcb30d
start the periodic for Drivetrain
SirBeans Jun 21, 2024
cd079c5
Fix errors in SwerveModule code and start the cleanup process for dri…
SirBeans Jun 22, 2024
deef8c4
Fix final errors in Drivetrain logic to get file ready for review
SirBeans Jun 22, 2024
6d8fffc
Fix every Error caused by renaming in hardware and sim files for Swer…
SirBeans Jun 22, 2024
1374b5f
Makes sure that the program builds by fixing up errors whith variable…
SirBeans Jun 22, 2024
4521d6c
make testing command
yamamara Jun 22, 2024
7607f51
create test drive velocity command (needs to be tested)
yamamara Jun 22, 2024
8f61162
more testing
00magikarp Jun 23, 2024
301a332
fix superstructure test command to call tunabledrivestates
00magikarp Jun 23, 2024
bc9334f
drive revamp finished
Shom770 Jun 25, 2024
2c88f0e
Made tuning mode and debugging mode false in constants
AJaiman Jun 30, 2024
7f730a4
Constants are now named with all caps
AJaiman Jun 30, 2024
e608c99
My most recent change
Vybz-1 Jul 1, 2024
25ff663
Deleted Extra line
Vybz-1 Jul 1, 2024
d39561e
Updated flacon utils release version and added hertz unit
AJaiman Jul 1, 2024
bfa486c
Updated gitignore to only exclude settings.gradle and not build.gradl…
AJaiman Jul 1, 2024
b8028c5
Fixed wildcard imports & changed name of configPID
Jul 2, 2024
70ef188
fix issues in 6328 code
Shom770 Jul 2, 2024
23727cf
Fixed 6328 Java code unable to access odemetry data
Jul 2, 2024
1474e84
Fixed 6328 Java code being unable to access odemetry data
Jul 2, 2024
d41a00a
Fixed 6328 Java code being unable to access odemetry data
yamamara Jul 2, 2024
b025cfe
Merge remote-tracking branch 'origin/swerve-rewrite' into swerve-rewrite
yamamara Jul 2, 2024
7de2087
saraanshs comments
00magikarp Jul 2, 2024
927a15a
Replaced DrivetrainIO with List of SwerveModules and reorganized package
yamamara Jul 2, 2024
4a77797
Made instantiation of the 0 velocity vector static
yamamara Jul 2, 2024
4b94d75
readd TunableDriveStates block to Drivetrain.kt
00magikarp Jul 3, 2024
925d20d
Saraansh optimizations + further encapsulation
yamamara Jul 3, 2024
fe04396
Fix more nitpicks
SirBeans Jul 3, 2024
3379c1e
Merge branch 'swerve-rewrite' of https://github.com/team4099/Crescend…
SirBeans Jul 3, 2024
731e618
Separated feedforward from PID in SwerveModuleIO and added units to logs
yamamara Jul 4, 2024
da4ce2d
Fixed SwerveModuleIOTalon implementation of slot configs
yamamara Jul 4, 2024
e42807c
Fix more nitpicks
SirBeans Jul 4, 2024
39abfdd
Merge branch 'swerve-rewrite' of https://github.com/team4099/Crescend…
SirBeans Jul 4, 2024
ccef242
Made instantiation of the 0 chassis speed static and moved static zer…
yamamara Jul 4, 2024
404417c
made feedback variable in SwerveModuleIOSim 🤩
00magikarp Jul 4, 2024
4c5f19d
remove extra steering value log in SwerveModuleIOTalon
00magikarp Jul 4, 2024
f448483
remove extra steering value log in SwerveModuleIOTalon
00magikarp Jul 4, 2024
7d30d77
move log target pose to DrivePathCommand
00magikarp Jul 5, 2024
c6077a8
add javadocs to functions in Drivetrain.kt
00magikarp Jul 5, 2024
bf5bf60
new method of obtaining applied voltage in SwerveModuleIOTalon
00magikarp Jul 5, 2024
d6c746a
new method of obtaining applied voltage in SwerveModuleIOTalon
00magikarp Jul 5, 2024
5150333
new method of obtaining applied voltage in SwerveModuleIOTalon
00magikarp Jul 5, 2024
590f836
Merge branch 'swerve-rewrite' of https://github.com/team4099/Crescend…
00magikarp Jul 5, 2024
3d44ca1
change how we get applied voltage to be like other signals in SwerveM…
00magikarp Jul 5, 2024
f6c4fb8
remove extra line bc its annoying me 😠
00magikarp Jul 5, 2024
68f511d
remove driveOdometryPos and steerOdometryPos from SwerveModuleIO (no …
00magikarp Jul 5, 2024
164e7a9
final touches 😁
00magikarp Jul 6, 2024
5b74b1b
remove unnecessary getSwerveModules() from RobotContainer.kt
00magikarp Jul 6, 2024
ac3393f
changes today
00magikarp Jul 6, 2024
04a9514
new stuff
00magikarp Jul 6, 2024
1175c50
move to main
Shom770 Jul 6, 2024
ad7414d
format violations fixed in RobotContainer
00magikarp Jul 6, 2024
4ae52ee
fried
Shom770 Jul 6, 2024
a56fe62
Hopefully making it a supplier will fix things
Shom770 Jul 6, 2024
977a265
merge conflict 🤣🤣
00magikarp Jul 6, 2024
21f2ea2
builds spotlessapply
00magikarp Jul 6, 2024
66c92be
made swerve modules in robot container lambdas 🗣️
00magikarp Jul 8, 2024
3cd0ca7
unbind testwrist and rebind climbautoalign
00magikarp Jul 9, 2024
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ $RECYCLE.BIN/
*.lnk

### Gradle ###
.gradle
settings.gradle
/build/
BuildConstants.kt

Expand Down
Binary file added .gradle/8.4/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.4/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.4/checksums/sha1-checksums.bin
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file added .gradle/8.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file added .gradle/8.4/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file added .gradle/8.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file added .gradle/8.4/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Wed Jun 19 14:31:53 EDT 2024
gradle.version=8.4
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file added .gradle/file-system.probe
Binary file not shown.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ dependencies {
simulationRelease wpi.sim.enableRelease()

implementation 'org.jetbrains.kotlin:kotlin-test-junit5'
implementation 'com.github.team4099:FalconUtils:1.1.30r3'
implementation 'com.github.team4099:FalconUtils:1.1.32'
implementation 'org.apache.commons:commons-collections4:4.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation "io.javalin:javalin:5.3.2"
Expand Down
Binary file added ctre_sim/Talon FX vers. C - 011 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 012 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 013 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 014 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 021 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 022 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 023 - 0 - ext.dat
Binary file not shown.
Binary file added ctre_sim/Talon FX vers. C - 024 - 0 - ext.dat
Binary file not shown.
11 changes: 7 additions & 4 deletions simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
{
"axisConfig": [
{
"decKey": 68,
"incKey": 65
"decKey": 65,
"incKey": 68
},
{
"decKey": 83,
"incKey": 87
"decKey": 87,
"incKey": 83
},
{
"decKey": 69,
Expand Down Expand Up @@ -106,6 +106,9 @@
},
{
"guid": "Keyboard1"
},
{
"guid": "03000000ac0500004f02000011010000"
}
]
}
84 changes: 84 additions & 0 deletions src/main/deploy/pathplanner/paths/Arav Auto.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 1.2392814346720042,
"y": 5.570246205735591
},
"prevControl": null,
"nextControl": {
"x": 1.2977105906762232,
"y": 5.5605080130730915
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.5636756374343124,
"y": 5.570246205735591
},
"prevControl": {
"x": 3.0603234634701773,
"y": 5.579984398402961
},
"nextControl": {
"x": 2.0670278113984475,
"y": 5.560508013068222
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.5636756374343124,
"y": 7.001760527843838
},
"prevControl": {
"x": 1.6190709486994308,
"y": 6.7972584818242
},
"nextControl": {
"x": 3.2098986869589385,
"y": 7.141664487022604
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.0408470781354384,
"y": 6.096108609778437
},
"prevControl": {
"x": 2.8558214174554095,
"y": 6.875164023169248
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 270.0,
"maxAngularAcceleration": 600.0
},
"goalEndState": {
"velocity": 0,
"rotation": -168.07067782276167,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": -179.490584237178,
"velocity": 0
},
"useDefaultConstraints": false
}
95 changes: 95 additions & 0 deletions src/main/deploy/pathplanner/paths/New New New New New Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 1.2,
"y": 5.539164403593215
},
"prevControl": null,
"nextControl": {
"x": 1.9943868001107077,
"y": 5.5263167132238324
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.6706052618878533,
"y": 6.854365862063553
},
"prevControl": {
"x": 2.304147793348643,
"y": 6.53763992417634
},
"nextControl": {
"x": 3.384861487118685,
"y": 7.471691178777106
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.165424363431695,
"y": 7.402113436696155
},
"prevControl": {
"x": 7.309263712108935,
"y": 7.699422628087695
},
"nextControl": {
"x": 8.628852806461502,
"y": 7.241183901506513
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.7295201940372555,
"y": 5.539164403593215
},
"prevControl": {
"x": 4.223252527067413,
"y": 6.326529871119891
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": -140.0,
"rotateFast": false
},
{
"waypointRelativePos": 2,
"rotationDegrees": 180.0,
"rotateFast": false
}
],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 270.0,
"maxAngularAcceleration": 600.0
},
"goalEndState": {
"velocity": 0,
"rotation": -179.82557275027028,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": false
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.team4099.utils.threads;// Copyright 2021-2023 FRC 6328
package com.team4099.utils.threads;
// Copyright 2021-2023 FRC 6328
// http://github.com/Mechanical-Advantage
//
// This program is free software; you can redistribute it and/or
Expand All @@ -12,6 +13,8 @@
// GNU General Public License for more details.


import com.team4099.robot2023.config.constants.DrivetrainConstants;

/**
* Provides an interface for asynchronously reading high-frequency measurements to a set of queues.
*
Expand Down Expand Up @@ -66,13 +69,13 @@ public void run() {
signalsLock.lock();
try {
if (isCANFD && signals.length > 0) {
com.ctre.phoenix6.BaseStatusSignal.waitForAll(2.0 / com.team4099.robot2023.config.constants.DrivetrainConstants.OMOMETRY_UPDATE_FREQUENCY, signals);
com.ctre.phoenix6.BaseStatusSignal.waitForAll(2.0 / DrivetrainConstants.INSTANCE.getOdometryUpdateFrequency(), signals);
} else {
// "waitForAll" does not support blocking on multiple
// signals with a bus that is not CAN FD, regardless
// of Pro licensing. No reasoning for this behavior
// is provided by the documentation.
Thread.sleep((long) (1000.0 / com.team4099.robot2023.config.constants.DrivetrainConstants.OMOMETRY_UPDATE_FREQUENCY));
Thread.sleep((long) (1000.0 / DrivetrainConstants.INSTANCE.getOdometryUpdateFrequency()));
com.ctre.phoenix6.BaseStatusSignal.refreshAll(signals);
}
} catch (InterruptedException e) {
Expand All @@ -82,13 +85,13 @@ public void run() {
}

// Save new data to queues
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(true);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(true);
try {
for (int i = 0; i < signals.length; i++) {
queues.get(i).offer(signals[i].getValueAsDouble());
}
} finally {
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(false);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.team4099.utils.threads;// Copyright 2021-2023 FRC 6328
package com.team4099.utils.threads;
// Copyright 2021-2023 FRC 6328
// http://github.com/Mechanical-Advantage
//
// This program is free software; you can redistribute it and/or
Expand All @@ -12,6 +13,8 @@
// GNU General Public License for more details.


import com.team4099.robot2023.config.constants.DrivetrainConstants;

/**
* Provides an interface for asynchronously reading high-frequency measurements to a set of queues.
*
Expand All @@ -35,29 +38,29 @@ public static com.team4099.utils.threads.SparkMaxOdometryThread getInstance() {
private SparkMaxOdometryThread() {
notifier = new edu.wpi.first.wpilibj.Notifier(this::periodic);
notifier.setName("SparkMaxOdometryThread");
notifier.startPeriodic(1.0 / com.team4099.robot2023.config.constants.DrivetrainConstants.OMOMETRY_UPDATE_FREQUENCY );
notifier.startPeriodic(1.0 / DrivetrainConstants.INSTANCE.getOdometryUpdateFrequency());
}

public java.util.Queue<Double> registerSignal(java.util.function.DoubleSupplier signal) {
java.util.Queue<Double> queue = new java.util.concurrent.ArrayBlockingQueue<>(100);
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(true);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(true);
try {
signals.add(signal);
queues.add(queue);
} finally {
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(false);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(false);
}
return queue;
}

private void periodic() {
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(true);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(true);
try {
for (int i = 0; i < signals.size(); i++) {
queues.get(i).offer(signals.get(i).getAsDouble());
}
} finally {
com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain.Companion.setOdometryLock(false);
com.team4099.robot2023.subsystems.drivetrain.Drivetrain.Companion.setOdometryLock(false);
}
}
}
Loading
Loading