Skip to content
This repository was archived by the owner on Dec 6, 2025. It is now read-only.

Commit 45eea70

Browse files
Updated example.
Signed-off-by: thenetworkgrinch <[email protected]>
1 parent beefe34 commit 45eea70

File tree

3 files changed

+76
-76
lines changed

3 files changed

+76
-76
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package frc.robot;
66

77
import com.pathplanner.lib.auto.NamedCommands;
8-
import edu.wpi.first.math.MathUtil;
98
import edu.wpi.first.math.geometry.Pose2d;
109
import edu.wpi.first.math.geometry.Rotation2d;
1110
import edu.wpi.first.math.geometry.Translation2d;
@@ -17,7 +16,6 @@
1716
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
1817
import edu.wpi.first.wpilibj2.command.button.Trigger;
1918
import frc.robot.Constants.OperatorConstants;
20-
import frc.robot.commands.swervedrive.drivebase.AbsoluteDriveAdv;
2119
import frc.robot.subsystems.swervedrive.SwerveSubsystem;
2220
import java.io.File;
2321
import swervelib.SwerveInputStream;
@@ -35,24 +33,6 @@ public class RobotContainer
3533
// The robot's subsystems and commands are defined here...
3634
private final SwerveSubsystem drivebase = new SwerveSubsystem(new File(Filesystem.getDeployDirectory(),
3735
"swerve/neo"));
38-
// Applies deadbands and inverts controls because joysticks
39-
// are back-right positive while robot
40-
// controls are front-left positive
41-
// left stick controls translation
42-
// right stick controls the rotational velocity
43-
// buttons are quick rotation positions to different ways to face
44-
// WARNING: default buttons are on the same buttons as the ones defined in configureBindings
45-
AbsoluteDriveAdv closedAbsoluteDriveAdv = new AbsoluteDriveAdv(drivebase,
46-
() -> -MathUtil.applyDeadband(driverXbox.getLeftY(),
47-
OperatorConstants.LEFT_Y_DEADBAND),
48-
() -> -MathUtil.applyDeadband(driverXbox.getLeftX(),
49-
OperatorConstants.DEADBAND),
50-
() -> -MathUtil.applyDeadband(driverXbox.getRightX(),
51-
OperatorConstants.RIGHT_X_DEADBAND),
52-
driverXbox.getHID()::getYButtonPressed,
53-
driverXbox.getHID()::getAButtonPressed,
54-
driverXbox.getHID()::getXButtonPressed,
55-
driverXbox.getHID()::getBButtonPressed);
5636

5737
/**
5838
* Converts driver input into a field-relative ChassisSpeeds that is controlled by angular velocity.
@@ -73,22 +53,6 @@ public class RobotContainer
7353
.headingWhile(true);
7454

7555

76-
// Applies deadbands and inverts controls because joysticks
77-
// are back-right positive while robot
78-
// controls are front-left positive
79-
// left stick controls translation
80-
// right stick controls the desired angle NOT angular rotation
81-
Command driveFieldOrientedDirectAngle = drivebase.driveFieldOriented(driveDirectAngle);
82-
83-
// Applies deadbands and inverts controls because joysticks
84-
// are back-right positive while robot
85-
// controls are front-left positive
86-
// left stick controls translation
87-
// right stick controls the angular velocity of the robot
88-
Command driveFieldOrientedAnglularVelocity = drivebase.driveFieldOriented(driveAngularVelocity);
89-
90-
Command driveSetpointGen = drivebase.driveWithSetpointGeneratorFieldRelative(driveDirectAngle);
91-
9256
SwerveInputStream driveAngularVelocitySim = SwerveInputStream.of(drivebase.getSwerveDrive(),
9357
() -> -driverXbox.getLeftY(),
9458
() -> -driverXbox.getLeftX())
@@ -107,12 +71,6 @@ public class RobotContainer
10771
(Math.PI * 2))
10872
.headingWhile(true);
10973

110-
Command driveFieldOrientedDirectAngleSim = drivebase.driveFieldOriented(driveDirectAngleSim);
111-
112-
Command driveFieldOrientedAnglularVelocitySim = drivebase.driveFieldOriented(driveAngularVelocitySim);
113-
114-
Command driveSetpointGenSim = drivebase.driveWithSetpointGeneratorFieldRelative(driveDirectAngleSim);
115-
11674
/**
11775
* The container for the robot. Contains subsystems, OI devices, and commands.
11876
*/
@@ -133,10 +91,22 @@ public RobotContainer()
13391
*/
13492
private void configureBindings()
13593
{
136-
// (Condition) ? Return-On-True : Return-on-False
137-
drivebase.setDefaultCommand(!RobotBase.isSimulation() ?
138-
driveFieldOrientedAnglularVelocity :
139-
driveFieldOrientedAnglularVelocitySim);
94+
95+
Command driveFieldOrientedDirectAngle = drivebase.driveFieldOriented(driveDirectAngle);
96+
Command driveFieldOrientedAnglularVelocity = drivebase.driveFieldOriented(driveAngularVelocity);
97+
Command driveSetpointGen = drivebase.driveWithSetpointGeneratorFieldRelative(driveDirectAngle);
98+
Command driveFieldOrientedDirectAngleSim = drivebase.driveFieldOriented(driveDirectAngleSim);
99+
Command driveFieldOrientedAnglularVelocitySim = drivebase.driveFieldOriented(driveAngularVelocitySim);
100+
Command driveSetpointGenSim = drivebase.driveWithSetpointGeneratorFieldRelative(
101+
driveDirectAngleSim);
102+
103+
if (RobotBase.isSimulation())
104+
{
105+
drivebase.setDefaultCommand(driveFieldOrientedDirectAngleSim);
106+
} else
107+
{
108+
drivebase.setDefaultCommand(driveFieldOrientedAnglularVelocity);
109+
}
140110

141111
if (Robot.isSimulation())
142112
{
Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"fileName": "Phoenix6-25.1.0.json",
2+
"fileName": "Phoenix6-25.2.0.json",
33
"name": "CTRE-Phoenix (v6)",
4-
"version": "25.1.0",
4+
"version": "25.2.0",
55
"frcYear": "2025",
66
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
77
"mavenUrls": [
@@ -19,14 +19,14 @@
1919
{
2020
"groupId": "com.ctre.phoenix6",
2121
"artifactId": "wpiapi-java",
22-
"version": "25.1.0"
22+
"version": "25.2.0"
2323
}
2424
],
2525
"jniDependencies": [
2626
{
2727
"groupId": "com.ctre.phoenix6",
2828
"artifactId": "api-cpp",
29-
"version": "25.1.0",
29+
"version": "25.2.0",
3030
"isJar": false,
3131
"skipInvalidPlatforms": true,
3232
"validPlatforms": [
@@ -40,7 +40,7 @@
4040
{
4141
"groupId": "com.ctre.phoenix6",
4242
"artifactId": "tools",
43-
"version": "25.1.0",
43+
"version": "25.2.0",
4444
"isJar": false,
4545
"skipInvalidPlatforms": true,
4646
"validPlatforms": [
@@ -54,7 +54,7 @@
5454
{
5555
"groupId": "com.ctre.phoenix6.sim",
5656
"artifactId": "api-cpp-sim",
57-
"version": "25.1.0",
57+
"version": "25.2.0",
5858
"isJar": false,
5959
"skipInvalidPlatforms": true,
6060
"validPlatforms": [
@@ -68,7 +68,7 @@
6868
{
6969
"groupId": "com.ctre.phoenix6.sim",
7070
"artifactId": "tools-sim",
71-
"version": "25.1.0",
71+
"version": "25.2.0",
7272
"isJar": false,
7373
"skipInvalidPlatforms": true,
7474
"validPlatforms": [
@@ -82,7 +82,7 @@
8282
{
8383
"groupId": "com.ctre.phoenix6.sim",
8484
"artifactId": "simTalonSRX",
85-
"version": "25.1.0",
85+
"version": "25.2.0",
8686
"isJar": false,
8787
"skipInvalidPlatforms": true,
8888
"validPlatforms": [
@@ -96,7 +96,7 @@
9696
{
9797
"groupId": "com.ctre.phoenix6.sim",
9898
"artifactId": "simVictorSPX",
99-
"version": "25.1.0",
99+
"version": "25.2.0",
100100
"isJar": false,
101101
"skipInvalidPlatforms": true,
102102
"validPlatforms": [
@@ -110,7 +110,7 @@
110110
{
111111
"groupId": "com.ctre.phoenix6.sim",
112112
"artifactId": "simPigeonIMU",
113-
"version": "25.1.0",
113+
"version": "25.2.0",
114114
"isJar": false,
115115
"skipInvalidPlatforms": true,
116116
"validPlatforms": [
@@ -124,7 +124,7 @@
124124
{
125125
"groupId": "com.ctre.phoenix6.sim",
126126
"artifactId": "simCANCoder",
127-
"version": "25.1.0",
127+
"version": "25.2.0",
128128
"isJar": false,
129129
"skipInvalidPlatforms": true,
130130
"validPlatforms": [
@@ -138,7 +138,21 @@
138138
{
139139
"groupId": "com.ctre.phoenix6.sim",
140140
"artifactId": "simProTalonFX",
141-
"version": "25.1.0",
141+
"version": "25.2.0",
142+
"isJar": false,
143+
"skipInvalidPlatforms": true,
144+
"validPlatforms": [
145+
"windowsx86-64",
146+
"linuxx86-64",
147+
"linuxarm64",
148+
"osxuniversal"
149+
],
150+
"simMode": "swsim"
151+
},
152+
{
153+
"groupId": "com.ctre.phoenix6.sim",
154+
"artifactId": "simProTalonFXS",
155+
"version": "25.2.0",
142156
"isJar": false,
143157
"skipInvalidPlatforms": true,
144158
"validPlatforms": [
@@ -152,7 +166,7 @@
152166
{
153167
"groupId": "com.ctre.phoenix6.sim",
154168
"artifactId": "simProCANcoder",
155-
"version": "25.1.0",
169+
"version": "25.2.0",
156170
"isJar": false,
157171
"skipInvalidPlatforms": true,
158172
"validPlatforms": [
@@ -166,7 +180,7 @@
166180
{
167181
"groupId": "com.ctre.phoenix6.sim",
168182
"artifactId": "simProPigeon2",
169-
"version": "25.1.0",
183+
"version": "25.2.0",
170184
"isJar": false,
171185
"skipInvalidPlatforms": true,
172186
"validPlatforms": [
@@ -180,7 +194,7 @@
180194
{
181195
"groupId": "com.ctre.phoenix6.sim",
182196
"artifactId": "simProCANrange",
183-
"version": "25.1.0",
197+
"version": "25.2.0",
184198
"isJar": false,
185199
"skipInvalidPlatforms": true,
186200
"validPlatforms": [
@@ -196,7 +210,7 @@
196210
{
197211
"groupId": "com.ctre.phoenix6",
198212
"artifactId": "wpiapi-cpp",
199-
"version": "25.1.0",
213+
"version": "25.2.0",
200214
"libName": "CTRE_Phoenix6_WPI",
201215
"headerClassifier": "headers",
202216
"sharedLibrary": true,
@@ -212,7 +226,7 @@
212226
{
213227
"groupId": "com.ctre.phoenix6",
214228
"artifactId": "tools",
215-
"version": "25.1.0",
229+
"version": "25.2.0",
216230
"libName": "CTRE_PhoenixTools",
217231
"headerClassifier": "headers",
218232
"sharedLibrary": true,
@@ -228,7 +242,7 @@
228242
{
229243
"groupId": "com.ctre.phoenix6.sim",
230244
"artifactId": "wpiapi-cpp-sim",
231-
"version": "25.1.0",
245+
"version": "25.2.0",
232246
"libName": "CTRE_Phoenix6_WPISim",
233247
"headerClassifier": "headers",
234248
"sharedLibrary": true,
@@ -244,7 +258,7 @@
244258
{
245259
"groupId": "com.ctre.phoenix6.sim",
246260
"artifactId": "tools-sim",
247-
"version": "25.1.0",
261+
"version": "25.2.0",
248262
"libName": "CTRE_PhoenixTools_Sim",
249263
"headerClassifier": "headers",
250264
"sharedLibrary": true,
@@ -260,7 +274,7 @@
260274
{
261275
"groupId": "com.ctre.phoenix6.sim",
262276
"artifactId": "simTalonSRX",
263-
"version": "25.1.0",
277+
"version": "25.2.0",
264278
"libName": "CTRE_SimTalonSRX",
265279
"headerClassifier": "headers",
266280
"sharedLibrary": true,
@@ -276,7 +290,7 @@
276290
{
277291
"groupId": "com.ctre.phoenix6.sim",
278292
"artifactId": "simVictorSPX",
279-
"version": "25.1.0",
293+
"version": "25.2.0",
280294
"libName": "CTRE_SimVictorSPX",
281295
"headerClassifier": "headers",
282296
"sharedLibrary": true,
@@ -292,7 +306,7 @@
292306
{
293307
"groupId": "com.ctre.phoenix6.sim",
294308
"artifactId": "simPigeonIMU",
295-
"version": "25.1.0",
309+
"version": "25.2.0",
296310
"libName": "CTRE_SimPigeonIMU",
297311
"headerClassifier": "headers",
298312
"sharedLibrary": true,
@@ -308,7 +322,7 @@
308322
{
309323
"groupId": "com.ctre.phoenix6.sim",
310324
"artifactId": "simCANCoder",
311-
"version": "25.1.0",
325+
"version": "25.2.0",
312326
"libName": "CTRE_SimCANCoder",
313327
"headerClassifier": "headers",
314328
"sharedLibrary": true,
@@ -324,7 +338,7 @@
324338
{
325339
"groupId": "com.ctre.phoenix6.sim",
326340
"artifactId": "simProTalonFX",
327-
"version": "25.1.0",
341+
"version": "25.2.0",
328342
"libName": "CTRE_SimProTalonFX",
329343
"headerClassifier": "headers",
330344
"sharedLibrary": true,
@@ -337,10 +351,26 @@
337351
],
338352
"simMode": "swsim"
339353
},
354+
{
355+
"groupId": "com.ctre.phoenix6.sim",
356+
"artifactId": "simProTalonFXS",
357+
"version": "25.2.0",
358+
"libName": "CTRE_SimProTalonFXS",
359+
"headerClassifier": "headers",
360+
"sharedLibrary": true,
361+
"skipInvalidPlatforms": true,
362+
"binaryPlatforms": [
363+
"windowsx86-64",
364+
"linuxx86-64",
365+
"linuxarm64",
366+
"osxuniversal"
367+
],
368+
"simMode": "swsim"
369+
},
340370
{
341371
"groupId": "com.ctre.phoenix6.sim",
342372
"artifactId": "simProCANcoder",
343-
"version": "25.1.0",
373+
"version": "25.2.0",
344374
"libName": "CTRE_SimProCANcoder",
345375
"headerClassifier": "headers",
346376
"sharedLibrary": true,
@@ -356,7 +386,7 @@
356386
{
357387
"groupId": "com.ctre.phoenix6.sim",
358388
"artifactId": "simProPigeon2",
359-
"version": "25.1.0",
389+
"version": "25.2.0",
360390
"libName": "CTRE_SimProPigeon2",
361391
"headerClassifier": "headers",
362392
"sharedLibrary": true,
@@ -372,7 +402,7 @@
372402
{
373403
"groupId": "com.ctre.phoenix6.sim",
374404
"artifactId": "simProCANrange",
375-
"version": "25.1.0",
405+
"version": "25.2.0",
376406
"libName": "CTRE_SimProCANrange",
377407
"headerClassifier": "headers",
378408
"sharedLibrary": true,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"fileName": "yagsl-2025.2.1-beta3.json",
2+
"fileName": "yagsl-2025.2.1.json",
33
"name": "YAGSL",
4-
"version": "2025.2.1-beta3",
4+
"version": "2025.2.1",
55
"frcYear": "2025",
66
"uuid": "1ccce5a4-acd2-4d18-bca3-4b8047188400",
77
"mavenUrls": [
@@ -12,7 +12,7 @@
1212
{
1313
"groupId": "swervelib",
1414
"artifactId": "YAGSL-java",
15-
"version": "2025.2.1-beta3"
15+
"version": "2025.2.1"
1616
}
1717
],
1818
"requires": [

0 commit comments

Comments
 (0)