Skip to content

Commit 20388f8

Browse files
committed
All the pivot, indexer and intake code will be done under GroundIntake
1 parent 0b50a99 commit 20388f8

5 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/main/java/frc/robot/subsystems/groundintake/GroundIntakePivot.java renamed to src/main/java/frc/robot/subsystems/groundintake/GroundIntake.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package frc.robot.subsystems.groundintake;
22

3-
public class GroundIntakePivot {}
3+
public class GroundIntake {}

src/main/java/frc/robot/subsystems/groundintake/GroundIntakePivotConstants.java renamed to src/main/java/frc/robot/subsystems/groundintake/GroundIntakeConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import edu.wpi.first.units.measure.Distance;
66
import edu.wpi.first.units.measure.Mass;
77

8-
public class GroundIntakePivotConstants {
8+
public class GroundIntakeConstants {
99
public static final Angle PIVOT_UP_POSITION = Units.Rotations.of(0.15869140625);
1010
public static final Angle PIVOT_DOWN_POSITION = Units.Rotations.of(-15.623046875);
1111
public static final double ACCEPTABLE_ERROR = 0.1;

src/main/java/frc/robot/subsystems/groundintake/GroundIntakePivotIO.java renamed to src/main/java/frc/robot/subsystems/groundintake/GroundIntakeIO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import edu.wpi.first.units.measure.Voltage;
66
import org.littletonrobotics.junction.AutoLog;
77

8-
public interface GroundIntakePivotIO {
8+
public interface GroundIntakeIO {
99

10-
final double MOTOR_TO_GROUND_INTAKE_PIVOT = 66.0 / 14.0; // 14.0 / 66.0;
10+
double MOTOR_TO_GROUND_INTAKE_PIVOT = 66.0 / 14.0; // 14.0 / 66.0;
1111

1212
@AutoLog
1313
class GroundIntakePivotIOInputs {

src/main/java/frc/robot/subsystems/groundintake/GroundIntakePivotIOReal.java renamed to src/main/java/frc/robot/subsystems/groundintake/GroundIntakeIOReal.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
import edu.wpi.first.units.measure.Voltage;
88
import frc.robot.Constants;
99

10-
public class GroundIntakePivotIOReal implements GroundIntakePivotIO {
10+
public class GroundIntakeIOReal implements GroundIntakeIO {
1111

1212
TalonFX groundIntakePivotMotor;
1313
TalonFXConfiguration groundIntakeMotorPivotConfig;
1414

1515
private PositionVoltage positionVoltage = new PositionVoltage(0);
1616

17-
public GroundIntakePivotIOReal() {
17+
public GroundIntakeIOReal() {
1818

1919
groundIntakePivotMotor = new TalonFX(Constants.GROUND_INTAKE_PIVOT_ID);
2020
}

src/main/java/frc/robot/subsystems/groundintake/GroundIntakePivotIOSim.java renamed to src/main/java/frc/robot/subsystems/groundintake/GroundIntakeIOSim.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
import frc.robot.Constants;
1818
import org.littletonrobotics.junction.Logger;
1919

20-
public class GroundIntakePivotIOSim implements GroundIntakePivotIO {
20+
public class GroundIntakeIOSim implements GroundIntakeIO {
2121

2222
private final SingleJointedArmSim groundIntakePivotSim = new SingleJointedArmSim(
2323
DCMotor.getKrakenX60(1),
24-
GroundIntakePivotConstants.MOTOR_TO_PIVOT_GEARING,
24+
GroundIntakeConstants.MOTOR_TO_PIVOT_GEARING,
2525
SingleJointedArmSim.estimateMOI(
26-
GroundIntakePivotConstants.GROUND_INTAKE_LENGTH.in(Units.Meters),
27-
GroundIntakePivotConstants.GROUND_INTAKE_WEIGHT.in(Units.Kilograms)),
28-
GroundIntakePivotConstants.GROUND_INTAKE_LENGTH.in(Units.Meters),
29-
GroundIntakePivotConstants.MIN_PIVOT_ANGLE.in(Radians),
30-
GroundIntakePivotConstants.MAX_PIVOT_ANGLE.in(Radians),
26+
GroundIntakeConstants.GROUND_INTAKE_LENGTH.in(Units.Meters),
27+
GroundIntakeConstants.GROUND_INTAKE_WEIGHT.in(Units.Kilograms)),
28+
GroundIntakeConstants.GROUND_INTAKE_LENGTH.in(Units.Meters),
29+
GroundIntakeConstants.MIN_PIVOT_ANGLE.in(Radians),
30+
GroundIntakeConstants.MAX_PIVOT_ANGLE.in(Radians),
3131
true,
3232
Units.Degrees.of(0).in(Radians));
3333

@@ -37,16 +37,16 @@ public class GroundIntakePivotIOSim implements GroundIntakePivotIO {
3737

3838
PositionVoltage pivotPositionControl = new PositionVoltage(0);
3939

40-
public GroundIntakePivotIOSim() {
40+
public GroundIntakeIOSim() {
4141
pivotMotor = new TalonFX(Constants.GROUND_INTAKE_PIVOT_ID);
4242
pivotMotorSimState = pivotMotor.getSimState();
4343

4444
pivotMotorConfig = new TalonFXConfiguration();
4545

4646
pivotMotorConfig.withSlot0(new Slot0Configs()
47-
.withKP(GroundIntakePivotConstants.kP_PIVOT)
48-
.withKI(GroundIntakePivotConstants.kI_PIVOT)
49-
.withKD(GroundIntakePivotConstants.kD_PIVOT));
47+
.withKP(GroundIntakeConstants.kP_PIVOT)
48+
.withKI(GroundIntakeConstants.kI_PIVOT)
49+
.withKD(GroundIntakeConstants.kD_PIVOT));
5050

5151
pivotMotorConfig.withMotorOutput(new MotorOutputConfigs().withInverted(InvertedValue.Clockwise_Positive));
5252

@@ -76,10 +76,10 @@ private void updateSim() {
7676

7777
pivotMotorSimState.setRawRotorPosition(
7878
edu.wpi.first.math.util.Units.radiansToRotations(groundIntakePivotSim.getAngleRads())
79-
* GroundIntakePivotConstants.MOTOR_TO_PIVOT_GEARING);
79+
* GroundIntakeConstants.MOTOR_TO_PIVOT_GEARING);
8080
pivotMotorSimState.setRotorVelocity(groundIntakePivotSim.getVelocityRadPerSec()
8181
/ (2.0 * Math.PI)
82-
* GroundIntakePivotConstants.MOTOR_TO_PIVOT_GEARING);
82+
* GroundIntakeConstants.MOTOR_TO_PIVOT_GEARING);
8383
}
8484

8585
@Override

0 commit comments

Comments
 (0)