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

Vision sim #103

Merged
merged 78 commits into from
Jan 4, 2025
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
32e3ea5
code is cooked
Ishan1522 Nov 4, 2024
5abf7b6
what did i do :sob:
Ishan1522 Nov 4, 2024
0e65e23
fix typo
Ishan1522 Nov 4, 2024
ceb11cf
ishan changes before I setal his computer
Ishan1522 Nov 4, 2024
2443f0f
format
Ishan1522 Nov 5, 2024
eb783a9
im actually so dumb
Ishan1522 Nov 5, 2024
b6fb3c6
and this proves it
Ishan1522 Nov 5, 2024
43a1667
push whatever this is
Ishan1522 Nov 6, 2024
82c2f25
im actually such a bad programmer
Ishan1522 Nov 6, 2024
ef0232b
huh
Ishan1522 Nov 6, 2024
be16c07
push changes
Ishan1522 Nov 7, 2024
71d4040
idk what this is
Ishan1522 Nov 8, 2024
bb46860
yall are cooked
Ishan1522 Nov 12, 2024
ffc77ad
changes
Ishan1522 Nov 13, 2024
1d5fad8
sim stuffs
Ishan1522 Nov 13, 2024
afc0139
no errors yay
Ishan1522 Nov 14, 2024
d94714e
format
Ishan1522 Nov 14, 2024
38ce706
naming is wip
Ishan1522 Nov 14, 2024
3ee584c
fix things and stuff
Ishan1522 Nov 14, 2024
e27a644
huh
Ishan1522 Nov 14, 2024
cf81365
epic
Ishan1522 Nov 14, 2024
5a19eed
add Limelight enum
Ishan1522 Nov 15, 2024
ff2f5aa
format
Ishan1522 Nov 15, 2024
c4135f0
idk i did smthn probably
Ishan1522 Nov 15, 2024
92c19f0
fix dumbass ll
Ishan1522 Nov 16, 2024
dfc9643
format
Ishan1522 Nov 16, 2024
ce8decb
idk im gonna switch branches now
Ishan1522 Nov 18, 2024
9e6415d
progresso
Ishan1522 Nov 19, 2024
6669514
more progressisssismo
Ishan1522 Nov 19, 2024
d8df64a
huh
Ishan1522 Nov 19, 2024
034d513
i am mucho sleepy
Ishan1522 Nov 20, 2024
85ee27c
enum update
Ishan1522 Nov 20, 2024
ccf3ddc
more enum stuff
Ishan1522 Nov 20, 2024
d3f0f7b
huh?
Ishan1522 Nov 20, 2024
70f27e2
constants and methods and such
Ishan1522 Nov 21, 2024
d56de83
geom util
Ishan1522 Nov 22, 2024
63f1a54
sim like moderatly works
Ishan1522 Nov 22, 2024
60acab8
mucho progresso
Ishan1522 Nov 22, 2024
04fbd0f
fix gyro
Ishan1522 Nov 23, 2024
afaa62c
i cooked
Ishan1522 Nov 24, 2024
f9d9134
format
Ishan1522 Nov 24, 2024
8733a45
i is hyped
Ishan1522 Nov 25, 2024
ee3f22e
wtf
Ishan1522 Nov 25, 2024
7a51f3f
im such a fucking dumbass
Ishan1522 Nov 25, 2024
4247cb4
fuuuuuuuuuuuuuuuuuuuuuuuuuuck
Ishan1522 Nov 25, 2024
ac7c3af
ok im not stupid thank god
Ishan1522 Nov 25, 2024
20d863a
i give uo :sob:
Ishan1522 Nov 25, 2024
8e68d1f
un poquito de progresso
Ishan1522 Nov 26, 2024
ee832b2
it works thats fucking crazy bro
Ishan1522 Nov 26, 2024
da02178
actually doesnt work prolly gotta rewrite evrything
Ishan1522 Nov 27, 2024
cd269d1
fixes frfr
Ishan1522 Nov 28, 2024
ac8226b
typo
Ishan1522 Nov 28, 2024
75cf724
format
Ishan1522 Nov 28, 2024
6751da8
push fixes
Ishan1522 Nov 29, 2024
bfb0199
fix ci
Ishan1522 Nov 29, 2024
2a4080f
update
Ishan1522 Nov 29, 2024
5d6b0c5
fixy (#82)
Ishan1522 Dec 2, 2024
4737dfb
i fixed a thing
Ishan1522 Dec 2, 2024
94d1b2f
cleanup
Ishan1522 Dec 4, 2024
bfd17cc
Merge branch 'main' of https://github.com/TitaniumTigers4829/offseaso…
Ishan1522 Dec 9, 2024
cf5ef88
thingy
Ishan1522 Dec 9, 2024
6af9077
remove buildconstants from gitignore bc it is cooking CI
Ishan1522 Dec 9, 2024
f711faf
add it back
Ishan1522 Dec 9, 2024
faf0b4c
testing code
Ishan1522 Dec 9, 2024
2285b42
what is sdis shit
Ishan1522 Dec 10, 2024
e33b2a1
redid setpoint generation
Ishan1522 Dec 13, 2024
4973c6b
update GradleRIO version to beta-3 and refactor voltage calculations …
Ishan1522 Dec 21, 2024
f90e65a
refactor gyro interface and simulation classes; move to new package s…
Ishan1522 Dec 24, 2024
e04dec9
refactor SwerveDrive and SwerveModule; adjust motor configurations an…
Ishan1522 Dec 25, 2024
94c7ff7
tuned sim pid
Ishan1522 Jan 2, 2025
3c7b3ac
idk msthn
Ishan1522 Jan 2, 2025
509eeeb
it works lmao
Ishan1522 Jan 2, 2025
ad8a3ac
update robot mode to simulation and improve thread priority handling
Ishan1522 Jan 3, 2025
79a886e
Merge branch '3rd-time-is-the-charm-for-setpoint-generation-plz' of h…
Ishan1522 Jan 3, 2025
bf661f9
wtf why does it work :sob:
Ishan1522 Jan 4, 2025
c1d909f
im gonna need to rewrite this shit - vision sim works but is high key…
Ishan1522 Jan 4, 2025
f5e4221
Merge branch 'main' of https://github.com/TitaniumTigers4829/offseaso…
Ishan1522 Jan 4, 2025
46a77b0
Formatting fixes
github-actions[bot] Jan 4, 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
Prev Previous commit
Next Next commit
huh
  • Loading branch information
Ishan1522 committed Nov 6, 2024
commit ef0232b4f0d1527570300f27e579b522286f0242
Original file line number Diff line number Diff line change
@@ -20,15 +20,15 @@
public class SimulatedModule implements ModuleInterface {
private final SwerveModuleSimulation moduleSimulation;

private final PIDController drivePID = new PIDController(.07, 0, 0);
private final PIDController drivePID = new PIDController(.04, 0, 0);
private final SimpleMotorFeedforward driveFF = new SimpleMotorFeedforward(0.0, .0, 0.0);

private final Constraints turnConstraints =
new Constraints(
RadiansPerSecond.of(2 * Math.PI).in(RotationsPerSecond),
RadiansPerSecondPerSecond.of(4 * Math.PI).in(RotationsPerSecondPerSecond));
private final ProfiledPIDController turnPID =
new ProfiledPIDController(Radians.of(3.5).in(Rotations), 0, 0, turnConstraints);
new ProfiledPIDController(Radians.of(35).in(Rotations), 0, 0, turnConstraints);
private final SimpleMotorFeedforward turnFF = new SimpleMotorFeedforward(0.77, 0.75, 0);

public SimulatedModule(SwerveModuleSimulation moduleSimulation) {
@@ -85,16 +85,18 @@ public void setDesiredState(SwerveModuleState desiredState) {
// setpoint.cosineScale(Rotation2d.fromRotations(turnRotations));
desiredState.optimize(Rotation2d.fromRotations(turnRotations));

if (Math.abs(desiredState.speedMetersPerSecond) < 0.01) {
stopModule();
return;
}


// Converts meters per second to rotations per second
double desiredDriveRPS =
desiredState.speedMetersPerSecond
* ModuleConstants.DRIVE_GEAR_RATIO
/ ModuleConstants.WHEEL_CIRCUMFERENCE_METERS;

if (Math.abs(desiredDriveRPS) < 0.01) {
stopModule();
return;
}

SmartDashboard.putNumber("desired drive RPS", desiredDriveRPS);
SmartDashboard.putNumber(
"current drive RPS",
Loading