|
1 | | -package frc.robot.subsystems.manipulator; |
2 | | - |
3 | | -public interface ManipulatorIO { |
4 | | - |
5 | | -} |
| 1 | +package frc.robot.subsystems.manipulator; |
| 2 | +import static edu.wpi.first.units.Units.Amps; |
| 3 | +import static edu.wpi.first.units.Units.Degrees; |
| 4 | +import static edu.wpi.first.units.Units.Meters; |
| 5 | +import static edu.wpi.first.units.Units.MetersPerSecond; |
| 6 | +import static edu.wpi.first.units.Units.RadiansPerSecond; |
| 7 | +import static edu.wpi.first.units.Units.Volts; |
| 8 | +import static edu.wpi.first.units.Units.Watts; |
| 9 | +import org.littletonrobotics.junction.AutoLog; |
| 10 | +import edu.wpi.first.units.measure.Angle; |
| 11 | +import edu.wpi.first.units.measure.AngularVelocity; |
| 12 | +import edu.wpi.first.units.measure.Current; |
| 13 | +import edu.wpi.first.units.measure.Distance; |
| 14 | +import edu.wpi.first.units.measure.LinearVelocity; |
| 15 | +import edu.wpi.first.units.measure.Power; |
| 16 | +import edu.wpi.first.units.measure.Voltage; |
| 17 | +import edu.wpi.first.wpilibj.sysid.SysIdRoutineLog; |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +public interface ManipulatorIO { |
| 22 | + @AutoLog |
| 23 | + public static class ManipulatorIOInputs { |
| 24 | + //inputs of postion,current,voltage and velocity (acceleration) |
| 25 | + |
| 26 | + public AngularVelocity DegreesperSecond = null; |
| 27 | + |
| 28 | + public class ArmStatus { |
| 29 | + |
| 30 | + public boolean armReady = false; |
| 31 | + public Angle armPosition = Degrees.of(0); |
| 32 | + public Current armCurrent = null; |
| 33 | + public Voltage armVoltage = null; |
| 34 | + public AngularVelocity armVelocity = RadiansPerSecond.of(0); |
| 35 | + public Angle armRawMotorPosition = Degrees.of(0); |
| 36 | + public AngularVelocity armRawMotorVelocity = DegreesperSecond; |
| 37 | + public int syncCount = Integer.MAX_VALUE; |
| 38 | + |
| 39 | + //constants for elevator part of the manipulator |
| 40 | + public Distance elevatorPostion = Meters.of(0); |
| 41 | + public LinearVelocity elevatorVelocity = MetersPerSecond.of(0); |
| 42 | + public Angle elevatorRawMotorPostion = Degrees.of(syncCount); |
| 43 | + } |
| 44 | + } |
| 45 | + |
| 46 | + //elevator contants (inputs of the voltage and postion) |
| 47 | + public boolean elevator1isReady = false; |
| 48 | + public Voltage elevator1vVoltage = Volts.of(0); |
| 49 | + public Current elevator1Current = Amps.of(0); |
| 50 | + public Power elevator1power = Watts.zero(); |
| 51 | + public Power elevator1powerAvg = Watts.zero(); |
| 52 | + |
| 53 | +//elevator 2 constants (inputs of the voltage and postion) |
| 54 | +public boolean elevator2isReady = false; |
| 55 | +public Voltage elevator2vVoltage= Volts.of(0); |
| 56 | +public Current elevator2Current = Amps.of(0); |
| 57 | +public Power elevator2power= Watts.zero(); |
| 58 | +public Power elevator2powerAvg = Watts.zero(); |
| 59 | + |
| 60 | +//encoder |
| 61 | +public Angle absoluteEncoder = Degrees.of(0); |
| 62 | +public double rawabsoluteEncoder = 0; |
| 63 | + |
| 64 | + // updating the inputs on the elevator |
| 65 | + public default void updateInputs(ManipulatorIOInputs inputs) {} |
| 66 | + public default void toggleSyncing() {} |
| 67 | + |
| 68 | + //need for SYS ID support |
| 69 | + public default void logArmMotor(SysIdRoutineLog log) {} |
| 70 | + |
| 71 | + public default void setElevatorMotorVoltage(double vol) {} |
| 72 | + |
| 73 | + public default void logElevatorMotor(SysIdRoutineLog log) {} |
| 74 | + |
| 75 | + // ELEVATOR METHODS |
| 76 | + public default void setElevatorTarget(Distance dist) {} |
| 77 | + public default void setElevatorPosition(Distance d) {} ; |
| 78 | + |
| 79 | + // ARM METHODS |
| 80 | + public default void setArmTarget(Angle angle) {} |
| 81 | +} |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
0 commit comments