Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
NetworkSubsystem2
Browse files Browse the repository at this point in the history
  • Loading branch information
MorphaxTheDeveloper committed Mar 13, 2024
1 parent e331c16 commit 65be0ae
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/main/java/frc/robot/subsystems/NetworkSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,36 @@

public class NetworkSubsystem extends SubsystemBase {

String getstr;
double apriltag_x_value;
double apriltag_y_value;

public NetworkTableInstance inst = NetworkTableInstance.create();
//table
public NetworkTable table = inst.getTable("table");
public NetworkTable table = inst.getTable("vision");

//subtable
public NetworkTable networkTable = table.getSubTable("Subtable");
public NetworkTable networkTable = table.getSubTable("apriltag");

//entry
public NetworkTableEntry veri = networkTable.getEntry("veri");
public NetworkTableEntry apriltag_x = networkTable.getEntry("apriltag_x");
public NetworkTableEntry apriltag_y = networkTable.getEntry("apriltag_y");

public NetworkSubsystem() {
inst.startClient4("10.0.0.0");
inst.startServer("10.76.72.2");
}

public String return_value(){
return getstr;
}
public double getX(){
return apriltag_x_value;
}

public double getY(){
return apriltag_y_value;
}

@Override
public void periodic() {
getstr = veri.getString("0.0");
System.out.println(getstr);
apriltag_x_value = apriltag_x.getDouble(0.0);
apriltag_y_value = apriltag_y.getDouble(0.0);
}


Expand Down

0 comments on commit 65be0ae

Please sign in to comment.