Skip to content

Commit 2eb99bd

Browse files
committed
nerf intake to not use position for otb intake. delete arm example bc it is redundant with elevator existing
1 parent fd61b3f commit 2eb99bd

File tree

10 files changed

+13
-108
lines changed

10 files changed

+13
-108
lines changed

src/main/java/frc/robot/subsystems/arm/Arm.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/arm/ArmConstants.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/arm/ArmInterface.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/arm/PhysicalArm.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/arm/SimulatedElevator.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/elevator/Elevator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/** This subsystem is an elevator that uses PID for its position. */
22
package frc.robot.subsystems.elevator;
33

4+
import org.littletonrobotics.junction.Logger;
5+
46
import edu.wpi.first.wpilibj2.command.SubsystemBase;
57

68
public class Elevator extends SubsystemBase {
@@ -32,5 +34,7 @@ public void setVolts(double volts) {
3234
@Override
3335
public void periodic() {
3436
// This method will be called once per scheduler run
37+
elevatorInterface.updateInputs(inputs);
38+
Logger.processInputs("Elevator/", inputs);
3539
}
3640
}

src/main/java/frc/robot/subsystems/elevator/SimulatedElevator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void updateInputs(ElevatorInputs inputs) {
3333
}
3434

3535
public void setElevatorPosition(double position) {
36-
elevatorSim.setState(simPID.calculate(position), ElevatorConstants.VELOCITY_METERS_PER_SECOND);
36+
setVolts(simPID.calculate(getElevatorPosition(), position));
3737
}
3838

3939
public double getElevatorPosition() {

src/main/java/frc/robot/subsystems/intake/Intake.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public Intake(IntakeInterface intakeInterface) {
1818
*/
1919
public void setIntakeSpeed(double speed) {
2020
intakeInterface.setIntakeSpeed(speed);
21-
Logger.recordOutput("OTBIntake/Intake", speed);
21+
Logger.recordOutput("OTBIntake/IntakeSpeed", speed);
2222
}
2323

2424
@Override
2525
public void periodic() {
2626
intakeInterface.updateInputs(inputs);
27-
Logger.processInputs("OTBIntake", inputs);
27+
Logger.processInputs("OTBIntake/", inputs);
2828
}
2929
}

src/main/java/frc/robot/subsystems/intake/PhysicalIntake.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
public class PhysicalIntake implements IntakeInterface {
1313
private final TalonFX intakeMotor = new TalonFX(IntakeConstants.INTAKE_MOTOR_ID);
1414

15-
private final MotionMagicVoltage mmPositionRequest = new MotionMagicVoltage(0);
16-
1715
private final StatusSignal<AngularVelocity> intakeVelocity;
1816

1917
public PhysicalIntake() {

src/main/java/frc/robot/subsystems/intake/SimulatedIntake.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
import static edu.wpi.first.units.Units.*;
44

55
import edu.wpi.first.math.system.plant.DCMotor;
6+
import edu.wpi.first.math.system.plant.LinearSystemId;
67
import edu.wpi.first.wpilibj.simulation.DCMotorSim;
78

89
public class SimulatedIntake implements IntakeInterface {
9-
DCMotorSim intakeSim = new DCMotorSim(null, DCMotor.getFalcon500(1), 0);
10+
DCMotorSim intakeSim = new DCMotorSim(LinearSystemId.createDCMotorSystem(DCMotor.getFalcon500(1), 0.01, 1), DCMotor.getFalcon500(1), 0);
1011
private double intakeAppliedVolts = 0.0;
1112

12-
public SimulatedIntake(IntakeInputs inputs) {
13+
public SimulatedIntake() {}
14+
15+
@Override
16+
public void updateInputs(IntakeInputs inputs) {
1317
intakeSim.update(0.02);
1418

1519
inputs.intakeVelocity =

0 commit comments

Comments
 (0)