11package frc .robot .subsystems .vision ;
22
3+ import java .util .HashMap ;
4+
35import org .littletonrobotics .junction .Logger ;
46
7+ import edu .wpi .first .cameraserver .CameraServer ;
8+ import edu .wpi .first .cscore .HttpCamera ;
59import edu .wpi .first .math .Matrix ;
610import edu .wpi .first .math .VecBuilder ;
711import edu .wpi .first .math .geometry .Pose2d ;
812import edu .wpi .first .math .numbers .N1 ;
913import edu .wpi .first .math .numbers .N3 ;
10- import edu .wpi .first .networktables .NetworkTableInstance ;
1114import edu .wpi .first .wpilibj .Alert ;
12- import edu .wpi .first .wpilibj .Timer ;
1315import edu .wpi .first .wpilibj .Alert .AlertType ;
16+ import edu .wpi .first .wpilibj .shuffleboard .Shuffleboard ;
17+ import edu .wpi .first .wpilibj .shuffleboard .ShuffleboardTab ;
1418import edu .wpi .first .wpilibj2 .command .SubsystemBase ;
1519
1620public 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