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.
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.
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.
I think you had multiple problems contributing to this which makes debugging difficult. I would do this next:
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.
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.
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?