Limelight Locking

Hi, I am first time coder for my team and we keep having problems tracking with Limelight. It won’t stay locked on either color ball and the camera flickers as well. Any ideas to help?

When you say that the camera is flickering, do you mean that the light is flickering, or the camera stream is flickering? If it’s the first issue, try putting NetworkTableInstance.getDefault().getTable(“limelight”).getEntry(“ledMode”).setNumber(3) in your code. You might accidentally have ledMode as 2, which is blink.

3 Likes

And of course, check your power connections!

1 Like

Since this is your first time coding, I also recommend taking a look at the Limelight documentation if you have not already. It has a ton of great examples to help guide you through the steps of getting a vision pipeline working.

2 Likes

The camera stream is flickering and the mentors told me some of the LED lights are out as well.

1 Like

If only some of the lights are out, then it sounds like that’s an issue with the Limelight itself. Have you hit the Limelight on anything, or done anything that might damage it?

2 Likes

Feel free to send a phone-recorded video of your laptop screen to my DMs or support(at)limelightvision.io.

  • If there are issues with the LEDs, we can take care of it at no cost to you if you send an email.

For better cargo tracking:

1 Like

I want to second this! Reading the docs has saved me so many hours of banging my head against a wall!

Hello, I agree with everyone here that looking in the docs is troubleshooting tip #1.

However, if you can’t find an answer in the docs, try these out.

Step #1, what resolution is your stream set to? Generally it’s best to keep the resolution as low as possible. The limelight has limited processing power, so the less pixels it has to analyze, the better! Hotfix #1: turn down the resolution of the stream.

Step #2: What are your thresholding values set to? If they are too specific, that may be why you aren’t getting a consistent lock (Little tip, try to get to competitions early so that you can tune the limelight specifically to the lighting conditions of the arena). It is possible that your ranges are too narrow. However, the inverse is also possible, and if your ranges are too wide, the limelight won’t be able to tell the difference between the ball and background noise. To test, set the video output to threshold, and then move the ball around. You should be able to clearly see the shape of the ball, and it will appear as solid white. Depending on lighting of your setting, the thresholding still might pick up some extra pixels that meet the parameters, commonly called noise. Something you can use to de-noise is Erosion and Dilation, but there is a chance that it will filter out some of your ball too, so use at your own discretion.

Step #3: How is your contour filtering? After you have a good thresholding profile, next work on the contour filtering. This will make it so that the limelight doesn’t mistake little specks of noise for a target. Essentially contour filtering is telling the limelight “once you have something that you think is a target, see if it matches parameters [a, b, and c]”. You can tell the limelight that x% of the image should be filled, the target rectangle will be y% white pixels, and the rectangle should be w units long, and h units high (for targets that can be any distance from the robot, it’s better to keep area % of the image to 0-100%, but that may change based on what you are tracking). A few starting tips for the contour filtering: since you are looking for a ball, it will appear as a circle on the camera, so naturally, the rectangle will never be 100% full, but since it is a solid object, at least some amount of the rectangle will be full. Since the ball is a uniform shape, the width to height ratio will be close-ish to 1:1. Just fiddle with these until you have reached what you decide is optimal.

A few extra tips: If you are using a separate pipeline for each ball, mess with the input settings to try to get a unique color from the ball. There’s a chance that you can get a cleaner threshold without the LEDs on so try and experiment a little bit! If all else fails, see if your limelight image is up to date, or contact Limelight support. If that still doesn’t work, try considering using a different software. Limelight is an excellent vision processing software, but if you need an alternative, try out PhotonVision. It’s free and compatible with limelight hardware.

Hopefully this helps out. Good luck with troubleshooting!

1 Like

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