diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 25d9e70..737530b 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -47,6 +47,7 @@ import frc4388.robot.commands.DriveCommands.DriveWithInputForTime; import frc4388.robot.commands.ExtenderIntakeCommands.ExtenderIntakeGroup; import frc4388.robot.commands.ShooterCommands.TrackTarget; import frc4388.robot.subsystems.BoomBoom; +import frc4388.robot.subsystems.Camera; import frc4388.robot.subsystems.Claws; import frc4388.robot.subsystems.Climber; import frc4388.robot.subsystems.Extender; @@ -75,6 +76,7 @@ public class RobotContainer { public final RobotMap m_robotMap = new RobotMap(); /* Subsystems */ + public final Camera m_robotCamera = new Camera("driver", 0, 160, 120, 40); public final Climber m_robotClimber = new Climber(m_robotMap.elbow); public final Claws m_robotClaws = new Claws(m_robotMap.leftClaw, m_robotMap.rightClaw); public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.leftFront, m_robotMap.leftBack, m_robotMap.rightFront, m_robotMap.rightBack, m_robotMap.gyro); @@ -83,7 +85,7 @@ public class RobotContainer { public final Extender m_robotExtender = new Extender(m_robotMap.extenderMotor); public final Storage m_robotStorage = new Storage(m_robotMap.storageMotor); - // private final LED m_robotLED = new LED(m_robotMap.LEDController); + // private final LED m_robotLED = new LED(m_robotMap.LEDController); // ! no LED makes aarav sad public final BoomBoom m_robotBoomBoom = new BoomBoom(m_robotMap.shooterFalconLeft, m_robotMap.shooterFalconRight); public final Hood m_robotHood = new Hood(m_robotMap.angleAdjusterMotor); public final Turret m_robotTurret = new Turret(m_robotMap.shooterTurret); @@ -137,7 +139,6 @@ public class RobotContainer { * The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { - // double turretDistanceFromFront = 10.0; // * distance of turret from the front of the robot in inches. might need to be somewhat accurate. // double distancePerSecond = 134.0; // * assuming emulated joystick input magnitude is 1.0 diff --git a/src/main/java/frc4388/robot/subsystems/Camera.java b/src/main/java/frc4388/robot/subsystems/Camera.java index 4645663..0be9276 100644 --- a/src/main/java/frc4388/robot/subsystems/Camera.java +++ b/src/main/java/frc4388/robot/subsystems/Camera.java @@ -8,6 +8,7 @@ package frc4388.robot.subsystems; import edu.wpi.first.cscore.*; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -21,14 +22,20 @@ public class Camera extends SubsystemBase { * @param height Resolution height. * @param brightness Percent brightness of the stream. */ + + public UsbCamera test; + public Camera(String name, int id, int width, int height, int brightness) { try{ - UsbCamera cam = new UsbCamera(name, id); + UsbCamera cam = CameraServer.startAutomaticCapture();//new UsbCamera(name, id); cam.setResolution(width, height); cam.setBrightness(brightness); cam.setFPS(10); - VideoSource camera = cam; - CameraServer.startAutomaticCapture(camera); + SmartDashboard.putBoolean("cam enabled", cam.isEnabled()); + SmartDashboard.putBoolean("cam connected", cam.isConnected()); + // VideoSource camera = cam; + // CameraServer.addCamera(camera); + // CameraServer.startAutomaticCapture(camera); } catch(Exception e) { System.err.println("Camera broken, pls nerf");