Skip to content

added code for new drum shooter prototype#114

Open
tomj-1 wants to merge 18 commits into
mainfrom
tom-drum-shooter-prototype
Open

added code for new drum shooter prototype#114
tomj-1 wants to merge 18 commits into
mainfrom
tom-drum-shooter-prototype

Conversation

@tomj-1

@tomj-1 tomj-1 commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Prototype code for drum shooter don't merge main

@tomj-1 tomj-1 requested a review from spderman3333 March 21, 2026 02:16
Comment thread src/main/java/com/team2813/subsystems/kicker/KickerIOSim.java Outdated
Comment thread src/main/java/com/team2813/subsystems/shooter/ShooterIOSim.java Outdated
intakeExtension = new IntakeExtension(new IntakeExtensionIOSim());
intakeRoller = new IntakeRoller(new IntakeRollerIOSim());

// todo fix sim code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is a bit vague. Could you improve the comment to say more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the comments, I updated to add sim code for shooter and kicker

@tomj-1 tomj-1 changed the title added code for new drum shooter prototype added code for new drum shooter prototype[DO NOT MERGE MAIN] Mar 21, 2026
@tomj-1 tomj-1 requested a review from vdikov March 21, 2026 19:57
@cuttestkittensrule cuttestkittensrule changed the base branch from main to full-width-shooter March 22, 2026 00:36
@cuttestkittensrule cuttestkittensrule changed the title added code for new drum shooter prototype[DO NOT MERGE MAIN] added code for new drum shooter prototype Mar 22, 2026

@spderman3333 spderman3333 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems alright for now, though the names of the motors should be more descriptive, else it will be impossible to tweak individual motors.

public AngularVelocity motorRotationalVelocity = RotationsPerSecond.of(0);
public Current motorStatorCurrent = Amps.of(0);
public Current motorSupplyCurrent = Amps.of(0);
public Voltage motor1Voltage = Volts.of(0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please name the motors based on their position (when looking at the robot from behind it). I.e: upperLeftMotor, lowerRightMotor, etc.


public class KickerIOReal implements KickerIO {
private final TalonFX motor;
private final TalonFX motor1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename these motors so they are more descriptive, and also append kicker to the front. (So it becomes uppperKickerMotor, and lowerKickerMotor.)

Comment on lines -15 to -58
private final FlywheelSim flywheelSim;
private final TalonFX motor;

public KickerIOSim() {
motor = new TalonFX(Constants.KICKER_MOTOR_ID);
flywheelSim =
new FlywheelSim(
LinearSystemId.createFlywheelSystem(
DCMotor.getKrakenX60(1),
KickerConstants.KICKER_SIM_MOI.in(
KilogramSquareMeters), // "Moment of Inertia" taken from OnShape.
KickerConstants.KICKER_MOTOR_TO_FLYWHEEL_GEARING),
DCMotor.getKrakenX60(1));
}

@Override
public void setMotorVoltage(Voltage kickerMotorVoltage) {
double volts = kickerMotorVoltage.in(Volts);
motor.setVoltage(volts);
flywheelSim.setInputVoltage(volts);
}

@Override
public void updateState(KickerIOInputs inputs) {
updateSimulation();

inputs.motorVoltage = motor.getMotorVoltage().getValue();
inputs.motorRotationalVelocity = motor.getVelocity().getValue();
inputs.motorStatorCurrent = motor.getStatorCurrent().getValue();
inputs.motorSupplyCurrent = motor.getSupplyCurrent().getValue();
}

private void updateSimulation() {
flywheelSim.update(Constants.SIM_TIME_PERIOD);

TalonFXSimState simState = motor.getSimState();
simState.setRotorAcceleration(flywheelSim.getAngularAcceleration());
simState.setRotorVelocity(flywheelSim.getAngularVelocity());
simState.setSupplyVoltage(Volts.of(12));
}

@Override
public void close() {
motor.close();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please dont delete the sim code.

@@ -15,6 +15,12 @@ class KickerConstants {
static final String RESIST_FUEL_PREFERENCE_NT = "Kicker/RESIST_FUEL_VOLTAGE";

static final TalonFXConfiguration KICKER_MOTOR_CONFIG =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive name here (i.e. UPPER_KICKER_MOTOR_CONFIG).

new MotorOutputConfigs().withInverted(InvertedValue.CounterClockwise_Positive))
.withCurrentLimits(new CurrentLimitsConfigs().withStatorCurrentLimit(Amps.of(35)));

static final TalonFXConfiguration KICKER_MOTOR_2_CONFIG =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

inputs.motor1Current = motor1.getStatorCurrent().getValue();

inputs.motor2Voltage = motor2.getMotorVoltage().getValue();
inputs.motor2RotationalVelocity = motor2.getVelocity().getValue();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to update the motor names here too.

Comment on lines 51 to +82
@@ -59,7 +69,17 @@ public class ShooterConstants {
.withStatorCurrentLimit(Amps.of(70))
.withSupplyCurrentLimit(50));

public static final TalonFXConfiguration FOLLOWER_SHOOTER_MOTOR_CONFIG =
public static final TalonFXConfiguration SHOOTER_MOTOR_3_CONFIG =
new TalonFXConfiguration()
.withMotorOutput(new MotorOutputConfigs().withInverted(InvertedValue.CounterClockwise_Positive))
.withSlot0(
new Slot0Configs().withKS(0.099892).withKV(0.115).withKA(0.0020241).withKP(0.026743))
.withCurrentLimits(
new CurrentLimitsConfigs()
.withStatorCurrentLimit(Amps.of(70))
.withSupplyCurrentLimit(50));

public static final TalonFXConfiguration SHOOTER_MOTOR_4_CONFIG =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the configs so they are descriptive.

Comment on lines +11 to +33
public double shooterMotor1VoltageVolts = 0;
public double shooterMotor1AngleRotations = 0;
public double shooterMotor1RotPerSec = 0;
public double shooterMotor1CurrentAmps = 0;
public double shooter1SetpointRotsPerSec = 0;

public double shooterMotor2VoltageVolts = 0;
public double shooterMotor2AngleRotations = 0;
public double shooterMotor2RotPerSec = 0;
public double shooterMotor2CurrentAmps = 0;
public double shooter2SetpointRotsPerSec = 0;

public double shooterMotor3VoltageVolts = 0;
public double shooterMotor3AngleRotations = 0;
public double shooterMotor3RotPerSec = 0;
public double shooterMotor3CurrentAmps = 0;
public double shooter3SetpointRotsPerSec = 0;

public double shooterMotor4VoltageVolts = 0;
public double shooterMotor4AngleRotations = 0;
public double shooterMotor4RotPerSec = 0;
public double shooterMotor4CurrentAmps = 0;
public double shooter4SetpointRotsPerSec = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive names here too please.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you get the point, (more descriptive names).

Base automatically changed from full-width-shooter to main April 22, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants