Limelight Lib using question

I’m try to print the robot pose on shuffleboard, but there are something wrong on my code.

Can anyone help me to slove this problem?

Besides, there are many class:

LimelightHelpers.LimelightTarget_Retro
LimelightHelpers.LimelightTarget_Fiducial
LimelightHelpers.LimelightTarget_Barcode
LimelightHelpers.LimelightTarget_Classifier
LimelightHelpers.LimelightTarget_Detector
LimelightHelpers.Results
LimelightHelpers.LimelightResults
(Pure Static) LimelightHelpers

Where can I see the usage of each one?

LimelightHelpers is a class in your project (2 files above the open on in the file browser to the left). You could need to look in there

2 Likes

Control + Click on any of the functions or classes to go straight to them. As stated previously, it is just a bunch of classes to make networktables easier to use.

2 Likes

Try this? (not tested)

LimelightHelpers.Results result = LimelightHelpers.getLatestResults(“limelight”).targetingResults;

if (DriverStation.getAlliance() == Alliance.Blue) {
Pose3d botPose = result.getBotPose3d_wpiBlue();
} else {
Pose3d botPose = result.getBotPose3d_wpiRed();
}

SmartDashboard.putNumber(“BotPose_X”, pose.getX());
SmartDashboard.putNumber(“BotPose_Y”, pose.getY());
SmartDashboard.putNumber(“BotPose_Z”, pose.getZ());

I will try it. But, what is the differential between
“getBotPose_wpiBlue()” and
“getBotPose3d_wpiBlue()”?

Not much. Both read values that the limelight is sending over NetworkTables. getBotPose_wpiBlue() reads the botpose_wpiblue double array from NetworkTables, getBotPose3d_wpiBlue() reads the json string which contains the same data. One advantage of reading the json is that all the data in that json was collected at the same time. If you read the NetworkTables multiple times, you might get values that were sent at different times. There is more about this in this thread Introducing Limelight Lib

image

I’m actually tring to get data from json string, but I thought “getBotPose_wpiBlue()” also read from jason file.
I’m appreciate your guys’ kindness.

I can’t update the data to dashboard. Do I ignore something?

I meet the same problem, even if I read other CD posts and GitHub.
Can anyone help, please?

That error is saying that the json file from the limelight is empty.

This hapenned to me because the limelight was not configured properly so it was not showing up in the network tables. Another time it was not plugged in.

Make sure you can open the Shufflboard and see the block of network variables from the limelight.

1 Like

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