Limelight 2022 Help

Ever since I’ve updated to the 2022 version of WPIlib I have not been able to get my limelight working again. I’ve looked at the updated documentation for network tables, but nothing has been working for me. If anyone could help please take a look at the GitHub repository, and let me know if any fix could be found.

1 Like

Lines 16-38 are globals, as they aren’t within class scope. This is almost certainly not what you intended. They should be moved to the Robot.h header and put into class scope. This also means you have tx and ty defined in two separate spots (lines 30-31 and 86-87). The variables on lines 30-34 will only ever be assigned once, as they’re globals.

Have you verified with OutlineViewer that the table/values are present (e.g. the values are being set by the Limelight)? The problem may lie with the Limelight configuration or network configuration.

2 Likes

The code for the limelight currently still doesn’t work. I’ve reorganized some stuff, but I believe the problem lies with the networktables. I think that the variables tx and ty aren’t getting anything from the networktable “limelight”. If anyone has any thoughts please take a look at the GitHub link below.

1 Like

What was the result when you did this?

1 Like

Can you try removing the angle brackets from your GetNumber() calls?
eg change

  double tx = nt::NetworkTableInstance::GetDefault().GetTable("limelight")->GetNumber("<tx>",0.0);

to

  double tx = nt::NetworkTableInstance::GetDefault().GetTable("limelight")->GetNumber("tx",0.0);

All the values were showing when I used OutlineViewer, meaning that the problem does not lie in the limelight.

I’ve tried this and it hasn’t worked.

I think you had multiple problems contributing to this which makes debugging difficult. I would do this next:

  1. Double check the team number in your limelight settings page, and make sure it matches the team number used in your robot project / driverstation / etc.
  2. Remove the angle brackets from the GetNumber() calls. They definitely shouldn’t be there.

These two steps combined with the steps you’ve already taken based on @Peter_Johnson 's advice could fix the issue.

I’ve just checked everything and I’ve just did everything, but it’s still not working.

Your latest commit, which is after this post was made says working limelight code. Does that mean you fixed it, or are you still having trouble. If the latter what is the issue now?

Yes, All of the problems have been fixed. Thanks a lot to everyone that helped.

I will be continuing to update that github for possible forward and backwards movement

1 Like

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