19
19
import com .revrobotics .ColorSensorV3 ;
20
20
import com .revrobotics .CANSparkBase .IdleMode ;
21
21
22
- import edu .wpi .first .networktables .BooleanPublisher ;
23
- import edu .wpi .first .networktables .NetworkTable ;
24
- import edu .wpi .first .networktables .NetworkTableEntry ;
25
- import edu .wpi .first .networktables .NetworkTableInstance ;
22
+
26
23
import edu .wpi .first .wpilibj .AnalogPotentiometer ;
27
24
import edu .wpi .first .wpilibj .DigitalInput ;
28
25
import edu .wpi .first .wpilibj .DigitalOutput ;
@@ -45,24 +42,6 @@ public class IntakeRollerSubsystem extends SubsystemBase {
45
42
46
43
private boolean prevFrontSensorValue = false ;
47
44
48
- private NetworkTableInstance ntInstance ;
49
- private NetworkTable ntTable ;
50
- private BooleanPublisher ntFrontPublisher ;
51
- private BooleanPublisher ntBackPublisher ;
52
-
53
- private NetworkTable motorsNTTable ;
54
- private NetworkTableEntry frontMotorCurrentEntry ;
55
- private NetworkTableEntry frontMotorVoltageEntry ;
56
- private NetworkTableEntry frontMotorTemperatureEntry ;
57
- private NetworkTableEntry integrationMotorCurrentEntry ;
58
- private NetworkTableEntry integrationMotorVoltageEntry ;
59
- private NetworkTableEntry integrationMotorTemperatureEntry ;
60
-
61
- private NetworkTable intakeNTTable ;
62
- private NetworkTableEntry frontSensorEntry ;
63
- private NetworkTableEntry rockwellSensorEntry ;
64
- private NetworkTableEntry ampSenSorEntry ;
65
-
66
45
private final LightBarSubsystem lightBarSubsystem ;
67
46
68
47
private Timer colorResetTimer ;
@@ -80,22 +59,6 @@ public IntakeRollerSubsystem(LightBarSubsystem lightBarSubsystem) {
80
59
rockwellSensor = new DigitalInput (4 );
81
60
ampSensor = new DigitalInput (5 );
82
61
83
- ntInstance = NetworkTableInstance .getDefault ();
84
- ntTable = ntInstance .getTable ("RobotStatus" );
85
- intakeNTTable = ntInstance .getTable ("Intake" );
86
- frontSensorEntry = intakeNTTable .getEntry ("FrontSensor" );
87
- rockwellSensorEntry = intakeNTTable .getEntry ("Rockwell" );
88
- ampSenSorEntry = intakeNTTable .getEntry ("AMPSensor" );
89
- ntFrontPublisher = ntTable .getBooleanTopic ("FrontSensor" ).publish ();
90
- ntBackPublisher = ntTable .getBooleanTopic ("BackSensor" ).publish ();
91
-
92
- motorsNTTable = ntInstance .getTable ("Motors" );
93
- frontMotorCurrentEntry = motorsNTTable .getEntry ("Intake17Current" );
94
- frontMotorVoltageEntry = motorsNTTable .getEntry ("Intake17Voltage" );
95
- frontMotorTemperatureEntry = motorsNTTable .getEntry ("Intake17Temperature" );
96
- integrationMotorCurrentEntry = motorsNTTable .getEntry ("Intake19Current" );
97
- integrationMotorVoltageEntry = motorsNTTable .getEntry ("Intake19Voltage" );
98
- integrationMotorTemperatureEntry = motorsNTTable .getEntry ("Intake19Temperature" );
99
62
this .lightBarSubsystem = lightBarSubsystem ;
100
63
101
64
// colorResetTimer = new Timer();
@@ -160,18 +123,7 @@ public boolean getAmpSensor() {
160
123
161
124
@ Override
162
125
public void periodic () {
163
- frontSensorEntry .setBoolean (getFrontSensorValue ());
164
- rockwellSensorEntry .setBoolean (getRockwellSensorValue ());
165
- ampSenSorEntry .setBoolean (getAmpSensor ());
166
-
167
- frontMotorCurrentEntry .setDouble (frontMotors .getOutputCurrent ());
168
- frontMotorVoltageEntry .setDouble (frontMotors .getBusVoltage ());
169
- frontMotorTemperatureEntry .setDouble (frontMotors .getMotorTemperature ());
170
- integrationMotorCurrentEntry .setDouble (integrationMotor .getSupplyCurrent ());
171
- integrationMotorVoltageEntry .setDouble (integrationMotor .getMotorOutputVoltage ());
172
- integrationMotorTemperatureEntry .setDouble (integrationMotor .getTemperature ());
173
-
174
- ntFrontPublisher .set (getFrontSensorReached ());
126
+
175
127
prevFrontSensorValue = getFrontSensorValue ();
176
128
if (getFrontSensorValue ()) {
177
129
lightBarSubsystem .setLightBarStatus (LightBarStatus .HOLDING_NOTE , 2 );
0 commit comments