|
5 | 5 | import static edu.wpi.first.units.Units.MetersPerSecond; |
6 | 6 | import static edu.wpi.first.units.Units.RadiansPerSecond; |
7 | 7 | import static edu.wpi.first.units.Units.Volts; |
8 | | - |
| 8 | +import static edu.wpi.first.units.Units.Watts; |
9 | 9 | import org.littletonrobotics.junction.AutoLog; |
10 | 10 | import edu.wpi.first.units.measure.Angle; |
11 | 11 | import edu.wpi.first.units.measure.AngularVelocity; |
12 | 12 | import edu.wpi.first.units.measure.Current; |
13 | 13 | import edu.wpi.first.units.measure.Distance; |
14 | 14 | import edu.wpi.first.units.measure.LinearVelocity; |
| 15 | +import edu.wpi.first.units.measure.Power; |
15 | 16 | import edu.wpi.first.units.measure.Voltage; |
16 | 17 |
|
17 | 18 |
|
18 | 19 |
|
19 | 20 | public interface ManipulatorIO { |
20 | 21 | @AutoLog |
21 | | - public static class ManipulatorIOInputs { |
| 22 | + public static class ManipulatorIOInputs { |
22 | 23 | //inputs of postion,current,voltage and velocity (acceleration) |
23 | | - public static final AngularVelocity DegreesperSecond = null; |
24 | 24 |
|
25 | | - public class ArmStatus { |
26 | | - |
27 | | - public boolean armReady = false; |
28 | | - public Angle armPosition = Degrees.of(0); |
29 | | - public Current armCurrent = null; |
30 | | - public Voltage armVoltage = null; |
31 | | - public AngularVelocity armVelocity = RadiansPerSecond.of(0); |
32 | | - public Angle armRawMotorPosition = Degrees.of(0); |
33 | | - public AngularVelocity armRawMotorVelocity = DegreesperSecond; |
34 | | - public int syncCount = Integer.MAX_VALUE; |
35 | | - |
36 | | - //constants for elevator part of the manipulator |
37 | | - public Distance elevatorPostion = Meters.of(0); |
38 | | - public LinearVelocity elevatorVelocity = MetersPerSecond.of(0); |
39 | | - public Angle elevatorRawMotorPostion = Degrees.of(syncCount); |
40 | | - } |
41 | | - } |
42 | | - //elevator contants (inputs of voltage and postion) |
43 | | - public boolean elevator1isReady = false; |
44 | | - public Voltage elevator1vVoltage = Volts.of(0); |
45 | | - public Current elevator1Current = Amps.of(0); |
46 | | - |
47 | | - } |
| 25 | + public AngularVelocity DegreesperSecond = null; |
| 26 | + |
| 27 | + public class ArmStatus { |
| 28 | + |
| 29 | + public boolean armReady = false; |
| 30 | + public Angle armPosition = Degrees.of(0); |
| 31 | + public Current armCurrent = null; |
| 32 | + public Voltage armVoltage = null; |
| 33 | + public AngularVelocity armVelocity = RadiansPerSecond.of(0); |
| 34 | + public Angle armRawMotorPosition = Degrees.of(0); |
| 35 | + public AngularVelocity armRawMotorVelocity = DegreesperSecond; |
| 36 | + public int syncCount = Integer.MAX_VALUE; |
| 37 | + |
| 38 | + //constants for elevator part of the manipulator |
| 39 | + public Distance elevatorPostion = Meters.of(0); |
| 40 | + public LinearVelocity elevatorVelocity = MetersPerSecond.of(0); |
| 41 | + public Angle elevatorRawMotorPostion = Degrees.of(syncCount); |
| 42 | + } |
| 43 | + } |
| 44 | + |
| 45 | + //elevator contants (inputs of the voltage and postion) |
| 46 | + public boolean elevator1isReady = false; |
| 47 | + public Voltage elevator1vVoltage = Volts.of(0); |
| 48 | + public Current elevator1Current = Amps.of(0); |
| 49 | + public Power elevator1power = Watts.zero(); |
| 50 | + public Power elevator1powerAvg = Watts.zero(); |
| 51 | + |
| 52 | +//elevator 2 constants (inputs of the voltage and postion) |
| 53 | +public boolean elevator2isReady = false; |
| 54 | +public Voltage elevator2vVoltage= Volts.of(0); |
| 55 | +public Current elevator2Current = Amps.of(0); |
| 56 | +public Power elevator2power= Watts.zero(); |
| 57 | +public Power elevator2powerAvg = Watts.zero(); |
| 58 | + |
| 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() {} } |
48 | 67 |
|
| 68 | + //need for SYS ID support |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
49 | 74 |
|
0 commit comments