Disconnected NT3 client

I’m trying to program a Dog Walking programming with limelight. But there are some problems.


Is there anyone can help me slove this problem? It’s my code below.

package frc.robot;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.math.controller.PIDController;
import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX;
import edu.wpi.first.wpilibj.drive.MecanumDrive;

public class Robot extends TimedRobot{
private final XboxController my_Xbox = new XboxController(0);
private final WPI_VictorSPX my_LFDrive = new WPI_VictorSPX(1);
private final WPI_VictorSPX my_LRDrive = new WPI_VictorSPX(2);
private final WPI_VictorSPX my_RFDrive = new WPI_VictorSPX(3);
private final WPI_VictorSPX my_RRDrive = new WPI_VictorSPX(4);
private final MecanumDrive my_Mec = new MecanumDrive(my_LFDrive, my_LRDrive, my_RFDrive, my_RRDrive);

private final NetworkTable table = NetworkTableInstance.getDefault().getTable(“limelight”);
private final NetworkTableEntry tx = table.getEntry(“tx”);
private final NetworkTableEntry ty = table.getEntry(“ty”);
private final NetworkTableEntry ta = table.getEntry(“ta”);

private final PIDController PID = new PIDController(0.014, 0, 0);

@Override
public void robotInit(){
my_LFDrive.setInverted(true);
my_LRDrive.setInverted(true);
my_RFDrive.setInverted(false);
my_RRDrive.setInverted(false);
}

@Override
public void robotPeriodic(){
SmartDashboard.putNumber(“LimelightX”, tx.getDouble(0));
SmartDashboard.putNumber(“LimelightY”, ty.getDouble(0));
SmartDashboard.putNumber(“LimelightArea”, ta.getDouble(0));
}

@Override
public void teleopPeriodic(){
if(my_Xbox.getRawButton(1) == true){
my_Mec.driveCartesian(0, PID.calculate(ta.getDouble(0), 5)*0.6, PID.calculate(tx.getDouble(0), 0)*0.6);
}else if(my_Xbox.getRawButton(1) == false){
my_Mec.driveCartesian(0, 0, 0);
}else{}
}
}

Sorry, this is my first time posting, so the layout may look a little messy.

How is the Limelight connected to the Rio? The 169.254 IP address is not what I would typically expect to see. The error is indicating the Limelight is closing its side of the connection.

One other question: what version of WPILib are you using? You can find this info in the first line or two of build.gradle. If you’re not running 2023.4.2 or later, also try upgrading.

The middle port of Radio connect to RoboRIO. The other internet port on Radio connect to Limelight. (I can’t take picture now.)
My version of WPILib is 2023.2.1, I am going to upgrade it, Thanks.

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