Skip to content

Commit 9d7bb58

Browse files
committed
Merge branch 'post-wne' into auto-adjustments
2 parents 94661e8 + 59012cd commit 9d7bb58

5 files changed

Lines changed: 66 additions & 37 deletions

File tree

src/main/java/frc/robot/Constants.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public static enum FieldType {
4141
public static final SendableChooser<FieldType> kFieldType = new SendableChooser<>();
4242

4343
static {
44-
kFieldType.setDefaultOption("AndyMark Field", FieldType.ANDYMARK);
45-
kFieldType.addOption("Welded Field", FieldType.WELDED);
44+
kFieldType.setDefaultOption("AndyMark", FieldType.ANDYMARK);
45+
kFieldType.addOption("Welded", FieldType.WELDED);
4646

47-
Shuffleboard.getTab("Teleoperated")
47+
Shuffleboard.getTab("Testing")
4848
.add("Field Type", kFieldType)
4949
.withWidget(BuiltInWidgets.kComboBoxChooser)
5050
.withSize(2, 1)
51-
.withPosition(0, 3);
51+
.withPosition(0, 1);
5252
}
5353

5454
/**

src/main/java/frc/robot/RobotContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private void configureBindings() {
101101
overrideElevatorFactorCombo.getTrigger().onTrue(Commands.runOnce(() -> {}));
102102
Shuffleboard.getTab("Teleoperated")
103103
.addBoolean("EleFact Override", overrideElevatorFactorCombo.getTrigger())
104-
.withPosition(8, 2)
104+
.withPosition(1, 3)
105105
.withSize(1, 1);
106106

107107
swerve.setToAimSuppliers(
@@ -171,7 +171,7 @@ private void configureBindings() {
171171
alignedOverrideCombo.getTrigger().onTrue(Commands.run(() -> {}));
172172
Shuffleboard.getTab("Teleoperated")
173173
.addBoolean("Aligned Override", alignedOverrideCombo.getTrigger()).
174-
withPosition(3, 2)
174+
withPosition(8, 2)
175175
.withSize(1, 1);
176176
elevator.setIsAlignedSupplier(() -> swerve.isAligned() || alignedOverrideCombo.getTrigger().getAsBoolean());
177177
elevator.setScoreComboSupplier(auxController.rightTrigger());

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

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,36 @@ public Elevator(ElevatorIO io) {
5757

5858
ShuffleboardTab teleopTab = Shuffleboard.getTab("Teleoperated");
5959
teleopTab.addBoolean("Low Photo", () -> elevatorIOInputs.lowerPhotosensor)
60-
.withPosition(2, 1)
60+
.withPosition(9, 2)
6161
.withSize(1, 1);
6262
teleopTab.addBoolean("Up Photo", () -> elevatorIOInputs.upperPhotosensor)
63-
.withPosition(2, 0)
63+
.withPosition(9, 1)
6464
.withSize(1, 1);
65-
teleopTab.addBoolean("Low Limit", () -> elevatorIOInputs.lowLimit)
66-
.withPosition(3, 1)
65+
// teleopTab.addBoolean("Low Limit", () -> elevatorIOInputs.lowLimit)
66+
// .withPosition(3, 1)
67+
// .withSize(1, 1);
68+
// teleopTab.addBoolean("High Limit", () -> elevatorIOInputs.highLimit)
69+
// .withPosition(3, 0)
70+
// .withSize(1, 1);
71+
teleopTab.addString("Limit Switches", () ->
72+
(Timer.getFPGATimestamp() % 1 > 0.5 ? "\\ " : "/ ") +
73+
(elevatorIOInputs.lowerPhotosensor ?
74+
(elevatorIOInputs.upperPhotosensor ? "Both" : "Low") :
75+
(elevatorIOInputs.lowerPhotosensor ? "High" : "None")) +
76+
(Timer.getFPGATimestamp() % 1 > 0.5 ? " /" : " \\"))
77+
.withPosition(8, 1)
6778
.withSize(1, 1);
68-
teleopTab.addBoolean("High Limit", () -> elevatorIOInputs.highLimit)
69-
.withPosition(3, 0)
70-
.withSize(1, 1);
71-
teleopTab.addString("Elevator Position", () -> elevatorIOInputs.desiredPosition.name)
72-
.withPosition(0, 2)
79+
teleopTab.addString("Elevator Position", () -> elevatorIOInputs.desiredPosition.name + (intaking ? " + Intaking" : ""))
80+
.withPosition(8, 0)
7381
.withSize(2, 1);
74-
teleopTab.addBoolean("\"Intaking\"", () -> intaking)
75-
.withPosition(2, 2)
76-
.withSize(1, 1);
77-
teleopTab.addBoolean("Home Bounce", () -> bouncing)
78-
.withPosition(7, 2)
82+
// teleopTab.addBoolean("\"Intaking\"", () -> intaking)
83+
// .withPosition(2, 2)
84+
// .withSize(1, 1);
85+
teleopTab.addBoolean("Bouncing", () -> bouncing)
86+
.withPosition(9, 3)
7987
.withSize(1, 1);
8088
teleopTab.addBoolean("Awaiting Home", () -> awaitingScoreCombo)
81-
.withPosition(7, 1)
89+
.withPosition(8, 3)
8290
.withSize(1, 1);
8391
}
8492

src/main/java/frc/robot/subsystems/swerve/SwerveDrive.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,27 +192,27 @@ private void initAutoDashboards() {
192192

193193
ShuffleboardTab teleopTab = Shuffleboard.getTab("Teleoperated");
194194
teleopTab.addBoolean("toX", () -> toX)
195-
.withPosition(2, 3)
195+
.withPosition(0, 3)
196196
.withSize(1, 1);
197-
teleopTab.addString("Field Zone", () -> fieldZone.name())
198-
.withPosition(0, 1)
199-
.withSize(2, 1);
200-
teleopTab.addString("Desired Preset Position", () -> desiredPresetPosition.name())
197+
teleopTab.addString("Field Zone + Preset Pos", () -> fieldZone.name() + " " + desiredPresetPosition.name())
201198
.withPosition(0, 0)
202199
.withSize(2, 1);
200+
// teleopTab.addString("Desired Preset Position", () -> desiredPresetPosition.name())
201+
// .withPosition(0, 0)
202+
// .withSize(2, 1);
203203
teleopTab.addBoolean("Aligned", this::isAligned)
204-
.withPosition(3, 3)
204+
.withPosition(1, 2)
205205
.withSize(1, 1);
206206
teleopTab.addNumber("xError", () -> errorX)
207-
.withPosition(7, 0);
207+
.withPosition(0, 1);
208208
teleopTab.addNumber("yError", () -> errorY)
209-
.withPosition(8, 0);
209+
.withPosition(1, 1);
210210
teleopTab.addNumber("headingError", () -> errorHeading)
211-
.withPosition(9, 0)
212-
.withSize(1, 1);
213-
teleopTab.addBoolean("reefPresetted", () -> reefPresetted)
214-
.withPosition(8, 1)
211+
.withPosition(0, 2)
215212
.withSize(1, 1);
213+
// teleopTab.addBoolean("reefPresetted", () -> reefPresetted)
214+
// .withPosition(8, 1)
215+
// .withSize(1, 1);
216216

217217
presetVisualizerField = new Field2d();
218218
odometryField = new Field2d();
@@ -221,10 +221,10 @@ private void initAutoDashboards() {
221221
odometryField.setRobotPose(new Pose2d());
222222

223223
teleopTab.add("Desired Preset Pose", presetVisualizerField)
224-
.withPosition(4, 2)
224+
.withPosition(2, 2)
225225
.withSize(3, 2);
226226
teleopTab.add("Odometry Pose", odometryField)
227-
.withPosition(4, 0)
227+
.withPosition(2, 0)
228228
.withSize(3, 2);
229229
}
230230

src/main/java/frc/robot/subsystems/vision/Vision.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package frc.robot.subsystems.vision;
22

3+
import java.util.HashMap;
4+
35
import org.littletonrobotics.junction.Logger;
46

7+
import edu.wpi.first.cameraserver.CameraServer;
8+
import edu.wpi.first.cscore.HttpCamera;
59
import edu.wpi.first.math.Matrix;
610
import edu.wpi.first.math.VecBuilder;
711
import edu.wpi.first.math.geometry.Pose2d;
812
import edu.wpi.first.math.numbers.N1;
913
import edu.wpi.first.math.numbers.N3;
10-
import edu.wpi.first.networktables.NetworkTableInstance;
1114
import edu.wpi.first.wpilibj.Alert;
12-
import edu.wpi.first.wpilibj.Timer;
1315
import edu.wpi.first.wpilibj.Alert.AlertType;
16+
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
17+
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
1418
import edu.wpi.first.wpilibj2.command.SubsystemBase;
1519

1620
public class Vision extends SubsystemBase {
@@ -29,6 +33,23 @@ public Vision(PoseEstimateConsumer consumer, VisionIO... ios) {
2933
new Alert("Vision module " + ios[i].getLimelightLocation().name + " disconnected.", AlertType.kWarning)
3034
);
3135
}
36+
37+
ShuffleboardTab teleopTab = Shuffleboard.getTab("Teleoperated");
38+
HttpCamera frontCameraStream = new HttpCamera("Front", "http://10.1.78:5800");
39+
HttpCamera highCameraStream = new HttpCamera("High", "http://10.1.78:5810");
40+
CameraServer.addCamera(frontCameraStream);
41+
CameraServer.addCamera(highCameraStream);
42+
CameraServer.startAutomaticCapture();
43+
HashMap<String, Object> cameraProperties = new HashMap<>();
44+
cameraProperties.put("Show controls", false);
45+
teleopTab.add(frontCameraStream)
46+
.withPosition(5, 0)
47+
.withSize(3, 2)
48+
.withProperties(cameraProperties);
49+
teleopTab.add(highCameraStream)
50+
.withPosition(5, 2)
51+
.withSize(3, 2)
52+
.withProperties(cameraProperties);
3253
}
3354

3455
@Override

0 commit comments

Comments
 (0)