Limelight Shuffleboard Camera Server Autoupdate

We are a first year Limelight (though the issue may not be Limelight specific) as well as a first year Shuffleboard team.

If we have shuffleboard open already with a Camera server stream, for some reason that widget does not get re-activated once the code is up and running again. We have to remove and then re-add the widget. When we do that, everything is fine and it works.

I was hoping to find out if there’s either a Shuffleboard config, or a programmatic way to have that widget automatically restart the image capture and display on the dashboard. I haven’t grok’d the WithWidget api well enough to figure out how to properly put the camera stream on there.

We will ultimately have a rear and forward facing camera, one plugged directly into the Rio and the other is a limelight. We will ultimately need to add both to our vision tab if we get it all working the way we want.

Thanks for any pointers, github links, or anything that can help.

Did you ever figure this out? We are starting to use shuffleboard as well and would like to add the Limelight streams programmatically.

Not yet, but I believe our students were going to be working on it tomorrow. I found some screensteps links that give a lot of the detail on how to do it I thin.

https://wpilib.screenstepslive.com/s/currentCS/m/shuffleboard/l/822284-creating-and-manipulating-tabs

Our github is public, so if the kids get it figured out I’ll post the link here so others can use it as a reference.

@NewtonCrosby was your team able to figure this out? I’m just starting to look into it again.

We’re starting this up as our first research task for next week, we got it sort of working by just using smartdashboard APIs.

It seems the Shuffleboard APIs should work, but you just need to wrap the calls in a try: catch() because it throws an exception if you try to put something on there on a tab that already has a key of that type.

So I just found this post:

With this code:

And that helped me write the code below, which works!

Put this above robotInit():

private HttpCamera limelightFeed;

Then put this inside robotInit():

limelightFeed = new HttpCamera("limelight", "http://limelight.local:5800/stream.mjpg");
driverShuffleboardTab.add("LL", limelightFeed).withPosition(0, 0).withSize(15, 8).withProperties(Map.of("Show Crosshair", true, "Show Controls", false));

We’re cleaning up our code tomorrow and posting it to our github so I can share if you like.

I’ve tried this and it seems to crash our robot but, the second of these lines causes our robot code to completely crash.

limelightFeed = new HttpCamera("limelight", "http://10.3.22.11:5800/stream.mjpg", HttpCameraKind.kMJPGStreamer);
CameraServer.getInstance().startAutomaticCapture(limelightFeed);

I can access the camera at the actual IP address in a browser but, when we try to capture the video with a CameraServer, the RoboRio seems to get caught in a boot-loop where the code repeatedly tries to start but can’t. Am I doing something wrong?

We don’t use CameraServer so I’m not sure.

Have you read the getting started docs? It has a java example at the bottom:
https://docs.limelightvision.io/en/latest/getting_started.html

We actually implemented the Limelight class from Dan Waxman here:

We push the video to Shuffleboard using the code above. I can link to our code if that helps.

1 Like

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