Skip to content

Commit bcea247

Browse files
S0L0GUYFRCTeam3255-Shared-K1-10alicekuznetsov
authored
Protobot swofsets (#489)
* Update RobotMap.java * Update SuperCORE * Update Constants.java * Update Constants.java * Updated some protobot stuff * Reversed Rotation For Practice Bot * Update DriveManual.java Co-Authored-By: Evan Grinnell <worldevan8@gmail.com> * Swoffsets * Revert rotation invert * PROPERLY revert the inversion thing ahfiuwafhiuwa --------- Co-authored-by: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared-K1-10@users.noreply.github.com> Co-authored-by: ACat701 <90939494+alicekuznetsov@users.noreply.github.com>
1 parent e015a1a commit bcea247

File tree

6 files changed

+42
-46
lines changed

6 files changed

+42
-46
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"TeamNumber": 3255
3+
}

src/main/java/frc/robot/Constants.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,24 @@ public static class PRACTICE_BOT {
8080
SN_SwerveConstants.MK4I.FALCON.L2.driveGearRatio,
8181
SN_SwerveConstants.MK4I.FALCON.L2.maxSpeedMeters);
8282

83-
public static final double BACK_RIGHT_ABS_ENCODER_OFFSET = -0.109375;
84-
public static final double BACK_LEFT_ABS_ENCODER_OFFSET = -0.066406;
85-
public static final double FRONT_RIGHT_ABS_ENCODER_OFFSET = -0.049316;
86-
public static final double FRONT_LEFT_ABS_ENCODER_OFFSET = 0.314209;
83+
public static final double BACK_RIGHT_ABS_ENCODER_OFFSET = -0.108398;
84+
public static final double BACK_LEFT_ABS_ENCODER_OFFSET = 0.752197;
85+
public static final double FRONT_RIGHT_ABS_ENCODER_OFFSET = -0.055420;
86+
public static final double FRONT_LEFT_ABS_ENCODER_OFFSET = -0.679443;
8787

8888
public static SN_SwerveModule[] MODULES = new SN_SwerveModule[] {
8989
new SN_SwerveModule(0, mapDrivetrain.FRONT_LEFT_DRIVE_CAN, mapDrivetrain.FRONT_LEFT_STEER_CAN,
9090
mapDrivetrain.FRONT_LEFT_ABSOLUTE_ENCODER_CAN,
91-
constDrivetrain.PRACTICE_BOT.FRONT_LEFT_ABS_ENCODER_OFFSET),
91+
constDrivetrain.PRACTICE_BOT.FRONT_LEFT_ABS_ENCODER_OFFSET, mapDrivetrain.PRACTICE_BOT_CAN_BUS_NAME),
9292
new SN_SwerveModule(1, mapDrivetrain.FRONT_RIGHT_DRIVE_CAN, mapDrivetrain.FRONT_RIGHT_STEER_CAN,
9393
mapDrivetrain.FRONT_RIGHT_ABSOLUTE_ENCODER_CAN,
94-
constDrivetrain.PRACTICE_BOT.FRONT_RIGHT_ABS_ENCODER_OFFSET),
94+
constDrivetrain.PRACTICE_BOT.FRONT_RIGHT_ABS_ENCODER_OFFSET, mapDrivetrain.PRACTICE_BOT_CAN_BUS_NAME),
9595
new SN_SwerveModule(2, mapDrivetrain.BACK_LEFT_DRIVE_CAN, mapDrivetrain.BACK_LEFT_STEER_CAN,
96-
mapDrivetrain.BACK_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.PRACTICE_BOT.BACK_LEFT_ABS_ENCODER_OFFSET),
96+
mapDrivetrain.BACK_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.PRACTICE_BOT.BACK_LEFT_ABS_ENCODER_OFFSET,
97+
mapDrivetrain.PRACTICE_BOT_CAN_BUS_NAME),
9798
new SN_SwerveModule(3, mapDrivetrain.BACK_RIGHT_DRIVE_CAN, mapDrivetrain.BACK_RIGHT_STEER_CAN,
9899
mapDrivetrain.BACK_RIGHT_ABSOLUTE_ENCODER_CAN,
99-
constDrivetrain.PRACTICE_BOT.BACK_RIGHT_ABS_ENCODER_OFFSET),
100+
constDrivetrain.PRACTICE_BOT.BACK_RIGHT_ABS_ENCODER_OFFSET, mapDrivetrain.PRACTICE_BOT_CAN_BUS_NAME),
100101
};
101102

102103
}
@@ -139,13 +140,17 @@ public static class PRACTICE_BOT {
139140

140141
public static SN_SwerveModule[] MODULES = new SN_SwerveModule[] {
141142
new SN_SwerveModule(0, mapDrivetrain.FRONT_LEFT_DRIVE_CAN, mapDrivetrain.FRONT_LEFT_STEER_CAN,
142-
mapDrivetrain.FRONT_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_LEFT_ABS_ENCODER_OFFSET),
143+
mapDrivetrain.FRONT_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_LEFT_ABS_ENCODER_OFFSET,
144+
mapDrivetrain.CAN_BUS_NAME),
143145
new SN_SwerveModule(1, mapDrivetrain.FRONT_RIGHT_DRIVE_CAN, mapDrivetrain.FRONT_RIGHT_STEER_CAN,
144-
mapDrivetrain.FRONT_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_RIGHT_ABS_ENCODER_OFFSET),
146+
mapDrivetrain.FRONT_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_RIGHT_ABS_ENCODER_OFFSET,
147+
mapDrivetrain.CAN_BUS_NAME),
145148
new SN_SwerveModule(2, mapDrivetrain.BACK_LEFT_DRIVE_CAN, mapDrivetrain.BACK_LEFT_STEER_CAN,
146-
mapDrivetrain.BACK_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_LEFT_ABS_ENCODER_OFFSET),
149+
mapDrivetrain.BACK_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_LEFT_ABS_ENCODER_OFFSET,
150+
mapDrivetrain.CAN_BUS_NAME),
147151
new SN_SwerveModule(3, mapDrivetrain.BACK_RIGHT_DRIVE_CAN, mapDrivetrain.BACK_RIGHT_STEER_CAN,
148-
mapDrivetrain.BACK_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_RIGHT_ABS_ENCODER_OFFSET),
152+
mapDrivetrain.BACK_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_RIGHT_ABS_ENCODER_OFFSET,
153+
mapDrivetrain.CAN_BUS_NAME),
149154
};
150155

151156
// Physically measured from center to center of the wheels

src/main/java/frc/robot/RobotMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public static class mapControllers {
1212
}
1313

1414
public static class mapDrivetrain {
15+
public static final String PRACTICE_BOT_CAN_BUS_NAME = "rio";
1516
public static final String CAN_BUS_NAME = "Swerve";
1617
public static final int PIGEON_CAN = 0;
1718

src/main/java/frc/robot/commands/DriveManual.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import frc.robot.subsystems.StateMachine.DriverState;
2323
import frc.robot.Constants;
2424
import frc.robot.Constants.*;
25+
import frc.robot.RobotContainer;
2526
import frc.robot.subsystems.AlgaeIntake;
2627
import frc.robot.subsystems.Drivetrain;
2728

src/main/java/frc/robot/subsystems/Drivetrain.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import static edu.wpi.first.units.Units.MetersPerSecond;
99
import static edu.wpi.first.units.Units.RadiansPerSecond;
1010

11-
import java.lang.Thread.State;
1211
import java.util.List;
1312

1413
import com.frcteam3255.components.swerve.SN_SuperSwerve;
@@ -32,26 +31,12 @@
3231
import edu.wpi.first.wpilibj2.command.Command;
3332
import frc.robot.Robot;
3433
import frc.robot.RobotContainer;
35-
import frc.robot.Constants;
3634
import frc.robot.Constants.*;
3735
import frc.robot.RobotMap.mapDrivetrain;
38-
import frc.robot.subsystems.*;
3936
import frc.robot.subsystems.StateMachine.DriverState;
4037

4138
@Logged
4239
public class Drivetrain extends SN_SuperSwerve {
43-
44-
private static SN_SwerveModule[] modules = new SN_SwerveModule[] {
45-
new SN_SwerveModule(0, mapDrivetrain.FRONT_LEFT_DRIVE_CAN, mapDrivetrain.FRONT_LEFT_STEER_CAN,
46-
mapDrivetrain.FRONT_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_LEFT_ABS_ENCODER_OFFSET),
47-
new SN_SwerveModule(1, mapDrivetrain.FRONT_RIGHT_DRIVE_CAN, mapDrivetrain.FRONT_RIGHT_STEER_CAN,
48-
mapDrivetrain.FRONT_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.FRONT_RIGHT_ABS_ENCODER_OFFSET),
49-
new SN_SwerveModule(2, mapDrivetrain.BACK_LEFT_DRIVE_CAN, mapDrivetrain.BACK_LEFT_STEER_CAN,
50-
mapDrivetrain.BACK_LEFT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_LEFT_ABS_ENCODER_OFFSET),
51-
new SN_SwerveModule(3, mapDrivetrain.BACK_RIGHT_DRIVE_CAN, mapDrivetrain.BACK_RIGHT_STEER_CAN,
52-
mapDrivetrain.BACK_RIGHT_ABSOLUTE_ENCODER_CAN, constDrivetrain.BACK_RIGHT_ABS_ENCODER_OFFSET),
53-
};
54-
5540
Pose2d desiredAlignmentPose = Pose2d.kZero;
5641
SwerveModuleState[] desiredModuleStates;
5742
SwerveModuleState[] actualModuleStates;
@@ -65,7 +50,8 @@ public Drivetrain() {
6550
: constDrivetrain.MODULES,
6651
constDrivetrain.WHEELBASE,
6752
constDrivetrain.TRACK_WIDTH,
68-
mapDrivetrain.CAN_BUS_NAME,
53+
(RobotContainer.isPracticeBot()) ? mapDrivetrain.PRACTICE_BOT_CAN_BUS_NAME
54+
: mapDrivetrain.CAN_BUS_NAME,
6955
mapDrivetrain.PIGEON_CAN,
7056
constDrivetrain.MIN_STEER_PERCENT,
7157
constDrivetrain.DRIVE_MOTOR_INVERT,

vendordeps/SuperCORE.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"fileName": "SuperCORE.json",
3-
"name": "SuperCORE",
4-
"version": "2025.1.0",
5-
"frcYear": 2025,
6-
"uuid": "f82a9412-6f53-4bc0-960c-6895a5236f57",
7-
"mavenUrls": [
8-
"https://frcteam3255.github.io/SuperCORE/releases/"
9-
],
10-
"jsonUrl": "https://frcteam3255.github.io/SuperCORE/releases/com/frcteam3255/supercore/SuperCORE-latest.json",
11-
"javaDependencies": [
12-
{
13-
"groupId": "com.frcteam3255",
14-
"artifactId": "supercore",
15-
"version": "2025.1.0"
16-
}
17-
],
18-
"jniDependencies": [],
19-
"cppDependencies": []
2+
"fileName": "SuperCORE.json",
3+
"name": "SuperCORE",
4+
"version": "2025.2.0",
5+
"frcYear": 2025,
6+
"uuid": "f82a9412-6f53-4bc0-960c-6895a5236f57",
7+
"mavenUrls": [
8+
"https://frcteam3255.github.io/SuperCORE/releases/"
9+
],
10+
"jsonUrl": "https://frcteam3255.github.io/SuperCORE/releases/com/frcteam3255/supercore/SuperCORE-latest.json",
11+
"javaDependencies": [
12+
{
13+
"groupId": "com.frcteam3255",
14+
"artifactId": "supercore",
15+
"version": "2025.2.0"
16+
}
17+
],
18+
"jniDependencies": [],
19+
"cppDependencies": []
2020
}

0 commit comments

Comments
 (0)