Skip to content

Commit ff970fa

Browse files
Worlds Changes
1 parent 680a7c6 commit ff970fa

39 files changed

+941
-176
lines changed

TunerConstantsjknkjnhj nhj n.java

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
package frc.robot.generated;
2+
3+
import com.ctre.phoenix6.configs.Slot0Configs;
4+
import com.ctre.phoenix6.mechanisms.swerve.SwerveDrivetrainConstants;
5+
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstants;
6+
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstantsFactory;
7+
import com.ctre.phoenix6.mechanisms.swerve.SwerveModule.ClosedLoopOutputType;
8+
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstants.SteerFeedbackType;
9+
10+
import edu.wpi.first.math.util.Units;
11+
import frc.robot.CommandSwerveDrivetrain;
12+
13+
// Generated by the Tuner X Swerve Project Generator
14+
// https://v6.docs.ctr-electronics.com/en/stable/docs/tuner/tuner-swerve/index.html
15+
public class TunerConstants {
16+
// Both sets of gains need to be tuned to your individual robot.
17+
18+
// The steer motor uses any SwerveModule.SteerRequestType control request with the
19+
// output type specified by SwerveModuleConstants.SteerMotorClosedLoopOutput
20+
private static final Slot0Configs steerGains = new Slot0Configs()
21+
.withKP(100).withKI(0).withKD(0.2)
22+
.withKS(0).withKV(1.5).withKA(0);
23+
// When using closed-loop control, the drive motor uses the control
24+
// output type specified by SwerveModuleConstants.DriveMotorClosedLoopOutput
25+
private static final Slot0Configs driveGains = new Slot0Configs()
26+
.withKP(3).withKI(0).withKD(0)
27+
.withKS(0).withKV(0).withKA(0);
28+
29+
// The closed-loop output type to use for the steer motors;
30+
// This affects the PID/FF gains for the steer motors
31+
private static final ClosedLoopOutputType steerClosedLoopOutput = ClosedLoopOutputType.Voltage;
32+
// The closed-loop output type to use for the drive motors;
33+
// This affects the PID/FF gains for the drive motors
34+
private static final ClosedLoopOutputType driveClosedLoopOutput = ClosedLoopOutputType.Voltage;
35+
36+
// The stator current at which the wheels start to slip;
37+
// This needs to be tuned to your individual robot
38+
private static final double kSlipCurrentA = 300.0;
39+
40+
// Theoretical free speed (m/s) at 12v applied output;
41+
// This needs to be tuned to your individual robot
42+
public static final double kSpeedAt12VoltsMps = 6.21;
43+
44+
// Every 1 rotation of the azimuth results in kCoupleRatio drive motor turns;
45+
// This may need to be tuned to your individual robot
46+
private static final double kCoupleRatio = 3;
47+
48+
private static final double kDriveGearRatio = 5.142857142857142;
49+
private static final double kSteerGearRatio = 12.8;
50+
private static final double kWheelRadiusInches = 2;
51+
52+
private static final boolean kSteerMotorReversed = false;
53+
private static final boolean kInvertLeftSide = false;
54+
private static final boolean kInvertRightSide = true;
55+
56+
private static final String kCANbusName = "Upper";
57+
private static final int kPigeonId = 0;
58+
59+
60+
// These are only used for simulation
61+
private static final double kSteerInertia = 0.00001;
62+
private static final double kDriveInertia = 0.001;
63+
// Simulated voltage necessary to overcome friction
64+
private static final double kSteerFrictionVoltage = 0.25;
65+
private static final double kDriveFrictionVoltage = 0.25;
66+
67+
private static final SwerveDrivetrainConstants DrivetrainConstants = new SwerveDrivetrainConstants()
68+
.withPigeon2Id(kPigeonId)
69+
.withCANbusName(kCANbusName);
70+
71+
private static final SwerveModuleConstantsFactory ConstantCreator = new SwerveModuleConstantsFactory()
72+
.withDriveMotorGearRatio(kDriveGearRatio)
73+
.withSteerMotorGearRatio(kSteerGearRatio)
74+
.withWheelRadius(kWheelRadiusInches)
75+
.withSlipCurrent(kSlipCurrentA)
76+
.withSteerMotorGains(steerGains)
77+
.withDriveMotorGains(driveGains)
78+
.withSteerMotorClosedLoopOutput(steerClosedLoopOutput)
79+
.withDriveMotorClosedLoopOutput(driveClosedLoopOutput)
80+
.withSpeedAt12VoltsMps(kSpeedAt12VoltsMps)
81+
.withSteerInertia(kSteerInertia)
82+
.withDriveInertia(kDriveInertia)
83+
.withSteerFrictionVoltage(kSteerFrictionVoltage)
84+
.withDriveFrictionVoltage(kDriveFrictionVoltage)
85+
.withFeedbackSource(SteerFeedbackType.FusedCANcoder)
86+
.withCouplingGearRatio(kCoupleRatio)
87+
.withSteerMotorInverted(kSteerMotorReversed);
88+
89+
90+
// Front Left
91+
private static final int kFrontLeftDriveMotorId = 1;
92+
private static final int kFrontLeftSteerMotorId = 2;
93+
private static final int kFrontLeftEncoderId = 2;
94+
private static final double kFrontLeftEncoderOffset = -0.091796875;
95+
96+
private static final double kFrontLeftXPosInches = 11.875;
97+
private static final double kFrontLeftYPosInches = 11.875;
98+
99+
// Front Right
100+
private static final int kFrontRightDriveMotorId = 18;
101+
private static final int kFrontRightSteerMotorId = 19;
102+
private static final int kFrontRightEncoderId = 1;
103+
private static final double kFrontRightEncoderOffset = -0.37890625;
104+
105+
private static final double kFrontRightXPosInches = 11.875;
106+
private static final double kFrontRightYPosInches = -11.875;
107+
108+
// Back Left
109+
private static final int kBackLeftDriveMotorId = 8;
110+
private static final int kBackLeftSteerMotorId = 9;
111+
private static final int kBackLeftEncoderId = 3;
112+
private static final double kBackLeftEncoderOffset = -0.063232421875;
113+
114+
private static final double kBackLeftXPosInches = -11.875;
115+
private static final double kBackLeftYPosInches = 11.875;
116+
117+
// Back Right
118+
private static final int kBackRightDriveMotorId = 10;
119+
private static final int kBackRightSteerMotorId = 11;
120+
private static final int kBackRightEncoderId = 4;
121+
private static final double kBackRightEncoderOffset = -0.486572265625;
122+
123+
private static final double kBackRightXPosInches = -11.875;
124+
private static final double kBackRightYPosInches = -11.875;
125+
126+
127+
private static final SwerveModuleConstants FrontLeft = ConstantCreator.createModuleConstants(
128+
kFrontLeftSteerMotorId, kFrontLeftDriveMotorId, kFrontLeftEncoderId, kFrontLeftEncoderOffset, Units.inchesToMeters(kFrontLeftXPosInches), Units.inchesToMeters(kFrontLeftYPosInches), kInvertLeftSide);
129+
private static final SwerveModuleConstants FrontRight = ConstantCreator.createModuleConstants(
130+
kFrontRightSteerMotorId, kFrontRightDriveMotorId, kFrontRightEncoderId, kFrontRightEncoderOffset, Units.inchesToMeters(kFrontRightXPosInches), Units.inchesToMeters(kFrontRightYPosInches), kInvertRightSide);
131+
private static final SwerveModuleConstants BackLeft = ConstantCreator.createModuleConstants(
132+
kBackLeftSteerMotorId, kBackLeftDriveMotorId, kBackLeftEncoderId, kBackLeftEncoderOffset, Units.inchesToMeters(kBackLeftXPosInches), Units.inchesToMeters(kBackLeftYPosInches), kInvertLeftSide);
133+
private static final SwerveModuleConstants BackRight = ConstantCreator.createModuleConstants(
134+
kBackRightSteerMotorId, kBackRightDriveMotorId, kBackRightEncoderId, kBackRightEncoderOffset, Units.inchesToMeters(kBackRightXPosInches), Units.inchesToMeters(kBackRightYPosInches), kInvertRightSide);
135+
136+
public static final CommandSwerveDrivetrain DriveTrain = new CommandSwerveDrivetrain(DrivetrainConstants, FrontLeft,
137+
FrontRight, BackLeft, BackRight);
138+
}

src/main/deploy/pathplanner/autos/Blue-Right-C0-C8-C7-C6.auto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
{
5353
"type": "named",
5454
"data": {
55-
"name": "AutoStartDeliveryTemp"
55+
"name": "AutoStartDeliveryTempWithHaveNote"
5656
}
5757
},
5858
{

src/main/deploy/pathplanner/autos/Blue-SpeakerCenter-C0-C1-C2-C3-C6.auto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
{
4747
"type": "named",
4848
"data": {
49-
"name": "AutoStartDeliveryTemp"
49+
"name": "AutoStartDeliveryTempWithHaveNote"
5050
}
5151
},
5252
{
@@ -64,7 +64,7 @@
6464
{
6565
"type": "named",
6666
"data": {
67-
"name": "AutoStartDeliveryTemp"
67+
"name": "AutoStartDeliveryTempWithHaveNote"
6868
}
6969
},
7070
{
@@ -100,7 +100,7 @@
100100
{
101101
"type": "named",
102102
"data": {
103-
"name": "AutoStartDeliveryTemp"
103+
"name": "AutoStartDeliveryTempWithHaveNote"
104104
}
105105
},
106106
{
@@ -118,7 +118,7 @@
118118
{
119119
"type": "named",
120120
"data": {
121-
"name": "AutoStartDeliveryTemp"
121+
"name": "AutoStartDeliveryTempWithHaveNote"
122122
}
123123
}
124124
]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"version": 1.0,
3+
"startingPose": {
4+
"position": {
5+
"x": 1.51,
6+
"y": 6.45
7+
},
8+
"rotation": 0
9+
},
10+
"command": {
11+
"type": "sequential",
12+
"data": {
13+
"commands": [
14+
{
15+
"type": "parallel",
16+
"data": {
17+
"commands": [
18+
{
19+
"type": "sequential",
20+
"data": {
21+
"commands": [
22+
{
23+
"type": "path",
24+
"data": {
25+
"pathName": "1 - Step 1"
26+
}
27+
},
28+
{
29+
"type": "path",
30+
"data": {
31+
"pathName": "2 - Step 1"
32+
}
33+
},
34+
{
35+
"type": "path",
36+
"data": {
37+
"pathName": "1 - Step 3"
38+
}
39+
},
40+
{
41+
"type": "path",
42+
"data": {
43+
"pathName": "2 - Step 3"
44+
}
45+
},
46+
{
47+
"type": "named",
48+
"data": {
49+
"name": "AutoStartDeliveryTemp"
50+
}
51+
},
52+
{
53+
"type": "path",
54+
"data": {
55+
"pathName": "Worlds-Elim-Path1"
56+
}
57+
},
58+
{
59+
"type": "path",
60+
"data": {
61+
"pathName": "1 - Step 2"
62+
}
63+
}
64+
]
65+
}
66+
},
67+
{
68+
"type": "named",
69+
"data": {
70+
"name": "StartShooter"
71+
}
72+
},
73+
{
74+
"type": "named",
75+
"data": {
76+
"name": "AutoStartIntake"
77+
}
78+
}
79+
]
80+
}
81+
}
82+
]
83+
}
84+
},
85+
"folder": "Blue Autos",
86+
"choreoAuto": false
87+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"version": 1.0,
3+
"startingPose": {
4+
"position": {
5+
"x": 1.51,
6+
"y": 6.45
7+
},
8+
"rotation": 0
9+
},
10+
"command": {
11+
"type": "sequential",
12+
"data": {
13+
"commands": [
14+
{
15+
"type": "parallel",
16+
"data": {
17+
"commands": [
18+
{
19+
"type": "sequential",
20+
"data": {
21+
"commands": [
22+
{
23+
"type": "path",
24+
"data": {
25+
"pathName": "11 - Step 1"
26+
}
27+
},
28+
{
29+
"type": "path",
30+
"data": {
31+
"pathName": "12 - Step 1"
32+
}
33+
},
34+
{
35+
"type": "path",
36+
"data": {
37+
"pathName": "11 - Step 3"
38+
}
39+
},
40+
{
41+
"type": "path",
42+
"data": {
43+
"pathName": "11 - Step 4"
44+
}
45+
},
46+
{
47+
"type": "named",
48+
"data": {
49+
"name": "AutoStartDeliveryTempWithHaveNote"
50+
}
51+
},
52+
{
53+
"type": "path",
54+
"data": {
55+
"pathName": "WorldsElim-Path11"
56+
}
57+
},
58+
{
59+
"type": "path",
60+
"data": {
61+
"pathName": "11 - Step 2"
62+
}
63+
}
64+
]
65+
}
66+
},
67+
{
68+
"type": "named",
69+
"data": {
70+
"name": "StartShooter"
71+
}
72+
},
73+
{
74+
"type": "named",
75+
"data": {
76+
"name": "AutoStartIntake"
77+
}
78+
}
79+
]
80+
}
81+
}
82+
]
83+
}
84+
},
85+
"folder": "Red Autos",
86+
"choreoAuto": false
87+
}

src/main/deploy/pathplanner/autos/Takes Time.auto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
{
1515
"type": "path",
1616
"data": {
17-
"pathName": "14 - Step 1"
17+
"pathName": "Test 1"
18+
}
19+
},
20+
{
21+
"type": "path",
22+
"data": {
23+
"pathName": "Test 2"
1824
}
1925
}
2026
]

0 commit comments

Comments
 (0)