Limelight2 tx, ty, & tv values unable to get from network tables

The limelight is working successfully on its own, but when outputting to a network table, other sources such as the shuffleboard that attempt to extract tx, ty, and tv values from our network table, they are only receiving zeroes, and the shuffleboard is not showing values at all.
Code outputting values from limelight for reference (Java):

        // Constructor
        private NetworkTable table = null;
        table = NetworkTableInstance.getDefault().getTable("limelight");
        
        // Called during periodic
        double ty = table.getEntry("ty").getDouble(0.0);
        double tx = table.getEntry("tx").getDouble(0.0);
        double tv = table.getEntry("tv").getDouble(0.0);

        double dist = (Constants.VISION_TARGET_AVERAGE_HEIGHT_INCHES -
                            Constants.LIMELIGHT_LENS_HEIGHT_INCHES) /
                            Math.sin((Constants.LIMELIGHT_MOUNT_ANGLE_DEGREES + ty) *
                                     Constants.DEGREES_TO_RADIANS);

        return Map.of("x",              Double.valueOf(tx),
                      "y",              Double.valueOf(ty),
                      "solutionFound",  Double.valueOf(tv),
                      "dist",           Double.valueOf(dist));-

Problem solved! Ethernet cables were not properly connected so roborio was not connected to limelight through the radio so the values were not able to be sent.

I’d suggest giving this thread a read if you’re using the second radio port.

1 Like

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