Limelight 3D distances

So let me introduce you to my issue. In would like to be able to send our robot to any point on the field, regardless of where it starts. This would be useful to eliminate technician error. My idea to fix this was to use the limelight, our team is already using the limelight to aim, but would we be able to get distance measurements as to how far left or right we are from the power port and how fart straight back we are? If so, I’m sure that setting our robot to any point on the field would not be too difficult from there.

Has anyone done this? Anyone know the best way to do it?

Yes this is possible, I’m not familiar with Limelight, but with OpenCV I think you can do solvePnP or something. I’ve heard of an equivalent method for limelight.

I think you can use the skew value (ts) to figure out how far left or right the robot is when its pointing at the target and area (ta) to figure out how far your robot it from the target. There would have to be testing and recording to translate those values to a position on the field.

1 Like

Limelight has added the 3D feature a few updates ago and will send the data calculated back through network tables. It was an off-season project for our team just to see what it would be like but we have found that it was fairly inaccurate. I would just use and angle and distance calculation using the target X and Y variables. There is a lot of documentation for that on the Limelight website.

2 Likes

I have found that, so far, the limelight 3D calculations are far too inaccurate to be used well. Instead, you can use your own methods of distance calculation. The limelight has documentation on how to estimate the robot’s distance from the target (straight line from limelight to target) here: https://docs.limelightvision.io/en/latest/cs_estimating_distance.html. My team used this and it worked very well. All you need is limelight mounting angle and target height.

To get the horizontal distance, my team found that no values returned by the limelight were very helpful (skew did not function as expected). Instead, we found that a gyroscope can be used in tandem with the limelight to find the angle of the robot (relative to some 0) to the power port, and since you have your direct distance above, now that you have a side and angle, you just need to use trig to find your x and y components. This is untested because our gyroscope broke right when we realized that, but it makes sense to me

1 Like

We didn’t bother to calculate an actual distance. Our limelight is in a fixed position. We just use y-angle to Target as a proxy for distance. If the angle is high we are close. If it is low we are far. We then calibrated too close prime range and too far. We have a programmable led yet the driver’s know by changing to red,yellow, green depending on y-angle.

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