Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebCamera to DriverDashboard #76

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import frc.robot.shooter.ShooterSubsystem;
import frc.robot.shooter.commands.SpinUpAndShoot;
import frc.robot.undertaker.UndertakerSubsystem;
import frc.robot.util.DriverDashboard;
import frc.robot.util.RobotContext;
import frc.robot.util.VersionFile;
import frc.robot.vision.VisionSubsystem;
Expand All @@ -37,9 +38,9 @@ public class RobotContainer {
private final UndertakerSubsystem undertakerSubsystem;
private final VisionSubsystem visionSubsystem;
private final ArmSubsystem arm;

private final DriverDashboard dashboard;

private final AbstractAutoGenerator autoGenerator;

private final RobotContext robotContext;

public RobotContainer() {
Expand All @@ -65,6 +66,8 @@ public RobotContainer() {
:
new SimpleAutoGenerator(drive, shooter, undertakerSubsystem, robotContext);

dashboard = new DriverDashboard(robotContext);

configureBindings();
VersionFile.getInstance().putToDashboard();
}
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/frc/robot/util/DriverDashboard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package frc.robot.util;

import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.cscore.VideoCamera;
import edu.wpi.first.util.PixelFormat;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;

public class DriverDashboard {
private VideoCamera webCam;

public DriverDashboard(RobotContext robotContext) {
ShuffleboardTab tab = Shuffleboard.getTab("Drive");
webCam = CameraServer.startAutomaticCapture();
webCam.setVideoMode(PixelFormat.kMJPEG, 200, 200, 20);
tab.add(webCam).withPosition(5, 1).withSize(3, 3);
}

private VideoCamera getLimelight() {
// HttpCamera httpCamera = new HttpCamera("Limelight Camera", \
// "http://frcvision.local:1181/stream.mjpg"); //TODO fix
return null;
}
}
Loading