Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
254 changes: 254 additions & 0 deletions src/main/deploy/choreo/rebuiltChoreo.chor
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
"name":"rebuiltChoreo",
"version":2,
"type":"Swerve",
"variables":{
"expressions":{
"slow":{
"dimension":"LinVel",
"var":{
"exp":"1.15 m / s",
"val":1.15
}
},
"slowaccel":{
"dimension":"LinAcc",
"var":{
"exp":"1.5 m / s ^ 2",
"val":1.5
}
}
},
"poses":{
"CL":{
"x":{
"exp":"1.7636412382125854 m",
"val":1.7636412382125854
},
"y":{
"exp":"4.111053943634033 m",
"val":4.111053943634033
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"CM":{
"x":{
"exp":"1.7500560283660889 m",
"val":1.7500560283660889
},
"y":{
"exp":"3.7646303176879883 m",
"val":3.764630317687988
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"CR":{
"x":{
"exp":"1.7568485736846924 m",
"val":1.7568485736846924
},
"y":{
"exp":"3.397829055786133 m",
"val":3.397829055786133
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"D":{
"x":{
"exp":"1.307854413986206 m",
"val":1.307854413986206
},
"y":{
"exp":"5.920979976654053 m",
"val":5.920979976654053
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"FL":{
"x":{
"exp":"7.8203654289245605 m",
"val":7.82036542892456
},
"y":{
"exp":"5.865901947021484 m",
"val":5.865901947021484
},
"heading":{
"exp":"-1.5707963267948966 rad",
"val":-1.5707963267948966
}
},
"FLM":{
"x":{
"exp":"7.8203654289245605 m",
"val":7.82036542892456
},
"y":{
"exp":"4.503572463989258 m",
"val":4.503572463989258
},
"heading":{
"exp":"-1.5707963267948966 rad",
"val":-1.5707963267948966
}
},
"FR":{
"x":{
"exp":"7.8203654289245605 m",
"val":7.82036542892456
},
"y":{
"exp":"2.2169458866119385 m",
"val":2.2169458866119385
},
"heading":{
"exp":"1.5707963267948966 rad",
"val":1.5707963267948966
}
},
"FRM":{
"x":{
"exp":"7.8203654289245605 m",
"val":7.82036542892456
},
"y":{
"exp":"3.55698299407959 m",
"val":3.55698299407959
},
"heading":{
"exp":"1.5707963267948966 rad",
"val":1.5707963267948966
}
},
"O":{
"x":{
"exp":"0.6150895357131958 m",
"val":0.6150895357131958
},
"y":{
"exp":"0.7198631167411804 m",
"val":0.7198631167411804
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"PLO":{
"x":{
"exp":"2.814626932144165 m",
"val":2.814626932144165
},
"y":{
"exp":"7.330637454986572 m",
"val":7.330637454986572
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
},
"PR":{
"x":{
"exp":"2.768587827682495 m",
"val":2.768587827682495
},
"y":{
"exp":"0.7205682992935181 m",
"val":0.7205682992935181
},
"heading":{
"exp":"3.141592653589793 rad",
"val":3.141592653589793
}
}
}
},
"config":{
"frontLeft":{
"x":{
"exp":"23.75 / 2 in",
"val":0.301625
},
"y":{
"exp":"23.25 / 2 in",
"val":0.295275
}
},
"backLeft":{
"x":{
"exp":"-23.75 / 2 in",
"val":-0.301625
},
"y":{
"exp":"23.25 / 2 in",
"val":0.295275
}
},
"mass":{
"exp":"121.28 lb",
"val":55.0116826336
},
"inertia":{
"exp":"24001.681 in ^ 2 lb",
"val":7.023843609558215
},
"gearing":{
"exp":"5.27",
"val":5.27
},
"radius":{
"exp":"2 in",
"val":0.0508
},
"vmax":{
"exp":"5800 RPM",
"val":607.3745796940267
},
"tmax":{
"exp":"0.9 N * m",
"val":0.9
},
"cof":{
"exp":"2.255",
"val":2.255
},
"bumper":{
"front":{
"exp":"34.6 / 2 in",
"val":0.43942
},
"side":{
"exp":"34.6 / 2 in",
"val":0.43942
},
"back":{
"exp":"34.6 / 2 in",
"val":0.43942
}
},
"differentialTrackWidth":{
"exp":"22 in",
"val":0.5588
}
},
"generationFeatures":[],
"codegen":{
"root":null,
"genVars":true,
"genTrajData":true,
"useChoreoLib":true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import frc.robot.components.camera.CameraIOReal;
import frc.robot.components.camera.CameraIOSim;
import frc.robot.subsystems.swerve.constants.AlphaSwerveConstants;
import frc.robot.subsystems.swerve.constants.CompBotSwerveConstants;
import frc.robot.subsystems.swerve.constants.SwerveConstants;
import frc.robot.subsystems.swerve.constants.comp.R1CompBotSwerveConstants;
import frc.robot.subsystems.swerve.gyro.GyroIO;
import frc.robot.subsystems.swerve.gyro.GyroIOInputsAutoLogged;
import frc.robot.subsystems.swerve.gyro.GyroIOReal;
Expand Down Expand Up @@ -70,7 +70,7 @@ public class SwerveSubsystem extends SubsystemBase {
public static final SwerveConstants SWERVE_CONSTANTS =
Robot.ROBOT_EDITION == RobotEdition.ALPHA
? new AlphaSwerveConstants()
: new CompBotSwerveConstants();
: new R1CompBotSwerveConstants();

private final Module[] modules; // Front Left, Front Right, Back Left, Back Right
private final GyroIO gyroIO;
Expand Down Expand Up @@ -400,7 +400,7 @@ private void drive(ChassisSpeeds speeds, boolean openLoop) {
for (int i = 0; i < optimizedStates.length; i++) {
if (openLoop) {
// Heuristic to enable/disable FOC
// enables FOC if the robot is moving at 90% of drivetrain max speed
// enables FOC if the robot is moving at less than 90% of drivetrain max speed
final boolean focEnable =
Math.sqrt(
Math.pow(this.getVelocityRobotRelative().vxMetersPerSecond, 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
import com.ctre.phoenix6.signals.SensorDirectionValue;
import com.ctre.phoenix6.sim.TalonFXSimState.MotorType;
import edu.wpi.first.math.MatBuilder;
import edu.wpi.first.math.Matrix;
import edu.wpi.first.math.Nat;
Expand Down Expand Up @@ -201,6 +202,16 @@ public ModuleConstants getBackRightModuleConstants() {
return new ModuleConstants(3, "Back Right", 6, 7, 3, Rotation2d.fromRotations(-0.205));
}

@Override
public MotorType getTurnMotorType() {
return MotorType.KrakenX60;
}

@Override
public MotorType getDriveMotorType() {
return MotorType.KrakenX60;
}

@Override
public int getGyroID() {
return 0;
Expand Down
Loading
Loading