Vision Tracking Using GRIP from a Driver Station

Hello,

I’m a programmer for the SOTABots, and we’ve been having some problems with vision tracking. In a perfect world, we would love to transfer a camera feed from the robot onto GRIP, which would be running on the driver station. We want to run a Microsoft HD LifeCam through the roboRIO, have that data transfer to the driver station, and then output through GRIP. Is there something we need to do or use such as NetworkTables, Raspberry Pi, or even alter the image format from the camera? Any input will be valued!

Within your Robot.java you want to start your cammera-stream, this basically just needs to be executed exactly once, so in robotInit().


// code instructions available from ScreenSteps:
//      2017 FRC Control System / Vision Processing / GRIP / Using Generated Code in a Robot Program
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();

// decrease resolution to lower bandwidth...
 int IMG_WIDTH = 320;  // public static will make this visible to .team.vision.Target.java code later...
 int IMG_HEIGHT = 240;
 camera.setResolution(IMG_WIDTH, IMG_HEIGHT);


Then autonomousInit() can decrease contrast, brightness, etc. and separate/similar code later in teleopInit() can increaase them.


 camera.setContrast(10);
/* other recent CD suggestions...
 camera.setWhiteBalanceManual();
 camera.setExposureManual();
 camera.setBrightness();
*/


Then ultimately just as the smartdashboard can use this image from the robo’s stream, GIP can too by putting this URL in as an IP-camera.

http://roborio-TEAM-frc.local:1181/?action=stream

Plug the Lifecam into the Rio. Run CameraServer.getInstance().startAutomaticCapture().

Open grip, add an IP camera. Point the URL to http://roborio-TEAM-frc.local:1181/?action=stream where TEAM is your team number.

No need to mess with NetworkTables, Raspberry Pis, or image format.

We did this, but we get “Camera Service Crashed” does someone know what could’ve happened?