SmartDashboard Camera Stream Viewer - Add a Line/Grid

My team just put a camera pointing at the front of our intake.

My mentor mentioned that it would be very helpful for the drivers if they could see some sort of crosshair/line/grid to help them line up with the balls.

Is there anyway I can do that in the code?

Any kind of help is appreciated :slight_smile:

Use Shuffleboard.

The built in camera stream widget has the options to put the cross hair on.

Edit to add, I think the crosshair is set to show by default, so just adding the widget should do what you want. In case you weren’t familiar with how to do that here’s a sample that will most likely work (untested code):

Shuffleboard.getTab("DriverTab").add("Intake View", new UsbCamera("intake", 0))
            .withWidget(BuiltInWidgets.kCameraStream)
            .withPosition(0, 0)
            .withSize(3, 3);

That should put a camera stream on a tab in shuffleboard that is size 3x3 tiles, placing it on the top left of that tab.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.