Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ public SwerveDrivetrainConstants getSwerveDrivetrainConstant(String subsystemNam
factory.DriveMotorGearRatio = kinematics.driveGearing;
factory.SteerMotorGearRatio = kinematics.steerGearing;
factory.CouplingGearRatio = kinematics.couplingGearRatio;
factory.SlipCurrent = kinematics.slipCurrentAmps;
factory.SpeedAt12Volts = maxSpd;

for (var module : config.modules.values()) {
Expand All @@ -762,6 +763,7 @@ public SwerveDrivetrainConstants getSwerveDrivetrainConstant(String subsystemNam
GreenLogger.log(" DriveMotorGearRatio: " + factory.DriveMotorGearRatio);
GreenLogger.log(" SteerMotorGearRatio: " + factory.SteerMotorGearRatio);
GreenLogger.log(" CouplingGearRatio: " + factory.CouplingGearRatio);
GreenLogger.log(" SlipCurrent: " + factory.SlipCurrent);
GreenLogger.log(" SpeedAt12Volts: " + factory.SpeedAt12Volts);
}

Expand Down Expand Up @@ -832,6 +834,9 @@ private void verifyKinematics(String subsystemName, KinematicsConfig kinematics)
if (kinematics.couplingGearRatio == null || kinematics.couplingGearRatio == 0) {
property = "couplingGearRatio";
}
if (kinematics.slipCurrentAmps == null || kinematics.slipCurrentAmps == 0) {
property = "slipCurrentAmps";
}
if (property != null) {
var message = subsystemName + " kinematics " + property + " can't be null or 0";
throw new IllegalArgumentException(message);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/team1816/season/subsystems/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class Shooter extends SubsystemBase implements ITestableSubsystem {
/**
* An adjustment value added to all requests to the turret (in degrees).
*/
private double turretAngleAdjustmentDegrees = -1.0;
private double turretAngleAdjustmentDegrees = 0;

private boolean useChassisSpeedForHoodAngleAndSpeed = false;

Expand Down Expand Up @@ -331,7 +331,7 @@ private void applyState() {
isAutoAiming = autoAimTurret || wantedDistanceState == ShooterDistanceState.AUTOMATIC;

if (autoAimTurret) {
double turretLookAheadTimeSeconds = 0.5;
double turretLookAheadTimeSeconds = 0;
IShooterCalculator.ShooterCalculatorResponse calculatorResponse = shooterTableCalculator.calculate(
getCurrentTurretPose3d().getTranslation(),
target,
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/schemas/hardware/kinematics.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
"type" : "number",
"default": null,
"description": "number of rotations of the drive motor caused by a rotation of the azimuth"
},
"slipCurrentAmps": {
"type" : "number",
"default": null,
"description": "maximum amount of stator current the drive motors can apply without slippage"
}
}
}
37 changes: 17 additions & 20 deletions src/main/resources/yaml/ztldr.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
shooterSettings:
distancesInches:
- 48.5
- 60
- 96
- 120
- 156
- 204
- 210
- 264
- 360 # Maximum distance shot
- 272
- 272
inclineAnglesRotations:
- 0.057 # 48
- 0.057 # 48.5
- 0.057 # 60
- 0.064 #96
- 0.07 # 120
- 0.08 # 156
- 0.09 # 204
- 0.09 #210
- 0.1113 # 264
- 0.108 # 360
- 0.083 #210
- 0.095 # 272
- 0.085 # 272
launchVelocitiesRPS:
- 32 # 48
- 39 # 96
- 41 #120
- 43 # 156
- 46 # 204
- 48 #210
- 49 # 264
- 50 # 360
- 38 # 48.5
- 40 # 60
- 42 # 96
- 43 #120
- 44 # 156
- 49 # 210
- 54 # 272
- 58 # 272
linearMPSToLaunchRPS: # TODO: Actual tune this. For now we are just using the shooterSettings and doing some physics to convert.
linearVelocitiesMPS:
- 10
Expand All @@ -41,7 +41,6 @@ subsystems:
id: 35
deviceType: TalonFX
neutralMode: Brake
statorCurrentLimit: 80
supplyCurrentLimit: 40
flAz:
id: 30
Expand All @@ -60,7 +59,6 @@ subsystems:
deviceType: TalonFX
neutralMode: Brake
motorRotation: Clockwise_Positive
statorCurrentLimit: 80
supplyCurrentLimit: 40
frAz:
id: 31
Expand All @@ -78,7 +76,6 @@ subsystems:
id: 37
deviceType: TalonFX
neutralMode: Brake
statorCurrentLimit: 80
supplyCurrentLimit: 40
blAz:
id: 33
Expand All @@ -97,7 +94,6 @@ subsystems:
deviceType: TalonFX
neutralMode: Brake
motorRotation: Clockwise_Positive
statorCurrentLimit: 80
supplyCurrentLimit: 40
brAz:
id: 32
Expand Down Expand Up @@ -152,6 +148,7 @@ subsystems:
maxDriveRPS: 98 # measured motor max speed rps
maxAngularRate: 8.285 # rad/sec
wheelCOF: 1.7
slipCurrentAmps: 42
constants:
translationKp: 20
translationKd: 0
Expand Down
Loading