Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5cf55bd
Add initial turret subsystem implementation with CAN IDs and sensor i…
NathanEdg Jan 28, 2026
cd2ed46
merge branch
NathanEdg Jan 28, 2026
662527b
Add initial turret subsystem implementation with CAN IDs and sensor i…
NathanEdg Jan 29, 2026
4d09149
Implement CRT and added controller capabilities for testing
NathanEdg Feb 2, 2026
d3da2de
Turret rotation with motion magic profiler
NathanEdg Feb 7, 2026
b4013a4
Add angle filtering and shot compensation for turret subsystem
NathanEdg Feb 8, 2026
c47c7be
Merge branch '13-turret-initial-code' of https://github.com/Team293/R…
NathanEdg Feb 8, 2026
0029e57
Aim to point
NathanEdg Feb 9, 2026
b915541
Merge branch '13-turret-initial-code' of https://github.com/Team293/R…
NathanEdg Feb 9, 2026
1ec5421
Refactor turret subsystem: remove controller dependency and improve s…
NathanEdg Feb 11, 2026
7463d71
Merge branch 'develop' into 13-turret-initial-code
PillageDev Feb 20, 2026
a066092
Refactor turret subsystem: clean up commented code, improve variable …
NathanEdg Feb 20, 2026
95cbf55
Git ignore .idea folder, converted AngleLowPassFilter.java to a gener…
NathanEdg Feb 22, 2026
031bf3f
Merge branch 'develop' into 13-turret-initial-code
NathanEdg Feb 22, 2026
1abef26
Added comments
NathanEdg Feb 24, 2026
07ba2b5
Revert "Added comments"
NathanEdg Feb 24, 2026
421f6c3
Reapply "Added comments"
NathanEdg Feb 24, 2026
9b9a1e6
Removed shooter code (on wrong branch)
NathanEdg Feb 24, 2026
42507d7
reapply old PID values
NathanEdg Feb 24, 2026
849d11f
Updated comments, cleaned up code, refactored state system.
NathanEdg Feb 24, 2026
4b6917b
Merge 13
NathanEdg Feb 25, 2026
22354c7
Add turret cancoders and update encoder handling in TurretIOTalonFX
NathanEdg Feb 25, 2026
b058d22
Merge branch 'develop' into 13-turret-initial-code
NathanEdg Feb 25, 2026
0d4019a
Merge branch '13-turret-initial-code' into 29-convert-turret-crt-enco…
PillageDev Feb 27, 2026
26cd090
10 shooter subsystem (#31)
PillageDev Feb 27, 2026
cf094af
Merge branch '13-turret-initial-code' into 29-convert-turret-crt-enco…
PillageDev Feb 27, 2026
133cd4c
Add [0, 1) constraints for CANcoder sensor readings
NathanEdg Feb 28, 2026
ae3696f
Merge branch 'develop' into 29-convert-turret-crt-encoders-to-the-wcp…
NathanEdg Feb 28, 2026
bbffda0
Fix weird chars in comments
NathanEdg Feb 28, 2026
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
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/CanID.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ public enum CanID {

INTAKE_MOTOR(9),
INTAKE_DEPLOY_MOTOR(11),

;

TURRET_PINION_CANCODER(12),
TURRET_FOLLOWER_CANCODER(14);

private final int deviceID;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/generated/TunerConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ public TunerSwerveDrivetrain(
* unspecified or set to 0 Hz, this is 250 Hz on
* CAN FD, and 100 Hz on CAN 2.0.
* @param odometryStandardDeviation The standard deviation for odometry calculation
* in the form [x, y, theta], with units in meters
* in the form [x, y, theta], with units in meters
* and radians
* @param visionStandardDeviation The standard deviation for vision calculation
* in the form [x, y, theta], with units in meters
* in the form [x, y, theta], with units in meters
* and radians
* @param modules Constants for each specific module
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ public CommandSwerveDrivetrain(
* unspecified or set to 0 Hz, this is 250 Hz on
* CAN FD, and 100 Hz on CAN 2.0.
* @param odometryStandardDeviation The standard deviation for odometry calculation
* in the form [x, y, theta], with units in meters
* in the form [x, y, theta], with units in meters
* and radians
* @param visionStandardDeviation The standard deviation for vision calculation
* in the form [x, y, theta], with units in meters
* in the form [x, y, theta], with units in meters
* and radians
* @param modules Constants for each specific module
*/
Expand Down Expand Up @@ -306,7 +306,7 @@ public void addVisionMeasurement(Pose2d visionRobotPoseMeters, double timestampS
* @param visionRobotPoseMeters The pose of the robot as measured by the vision camera.
* @param timestampSeconds The timestamp of the vision measurement in seconds.
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement
* in the form [x, y, theta], with units in meters and radians.
* in the form [x, y, theta], with units in meters and radians.
*/
@Override
public void addVisionMeasurement(
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/frc/robot/subsystems/turret/calc/TurretMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*
* Hardware setup (example):
* - Turret gear: 140 teeth
* - Encoder A: e.g. 13-tooth gear driving an absolute encoder (reads 01 rev)
* - Encoder B: e.g. 11-tooth gear driving an absolute encoder (reads 01 rev)
* - Encoder A: e.g. 13-tooth gear driving an absolute encoder (reads 0-1 rev)
* - Encoder B: e.g. 11-tooth gear driving an absolute encoder (reads 0-1 rev)
*
* The combination gives unique positions over (encoderA_teeth × encoderB_teeth) teeth.
* The combination gives unique positions over (encoderA_teeth x encoderB_teeth) teeth.
* Beyond that range, continuity tracking (unwrapping) is used.
*/
public class TurretMath {
Expand All @@ -20,8 +20,8 @@ public class TurretMath {
private static final double ENCODER_B_TEETH = 11.0;

// Derived encoder combination values
private static final double ENCODER_COMBINED_TEETH = ENCODER_A_TEETH * ENCODER_B_TEETH; // 143 (example)
private static final double ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_TEETH / TURRET_GEAR_TEETH; // ≈1.0214 (example)
private static final double ENCODER_COMBINED_TEETH = ENCODER_A_TEETH * ENCODER_B_TEETH;
private static final double ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_TEETH / TURRET_GEAR_TEETH;
private static final double HALF_ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_PERIOD_REV / 2.0;

private static final double NORMALIZED_REV = 1.0; // encoder reading range (0..1)
Expand Down Expand Up @@ -140,7 +140,7 @@ public static double toDegreesWrapped(double turretRevs) {
}

/**
* Convert turret revolutions to radians, wrapped to [0, ).
* Convert turret revolutions to radians, wrapped to [0, 2pi).
*/
public static double toRadiansWrapped(double turretRevs) {
return mod(turretRevs, NORMALIZED_REV) * RAD_PER_REV;
Expand Down