Skip to content

Commit bdef05c

Browse files
committed
use camera names
1 parent 2421702 commit bdef05c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

RobotSideCode/wallEYE/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "org.strykeforce"
9-
version = '25.0.1'
9+
version = '25.1.0'
1010

1111
java {
1212
sourceCompatibility = JavaVersion.VERSION_17

RobotSideCode/wallEYE/src/main/java/WallEye/WallEyeCam.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ public class WallEyeCam {
5353
* @param dioPort NOT IMPLEMENTED an int that corresponds to the dioport that the strobe is
5454
* connected to (-1 to disable it)
5555
*/
56-
public WallEyeCam(String tableName, int camIndex, int dioPort) {
57-
this.camName = tableName;
58-
this.camIndex = camIndex;
56+
public WallEyeCam(String camName, int dioPort) {
57+
this.camName = camName;
5958

6059
gyroResults = new DIOGyroResult[maxGyroResultSize];
6160
hasTurnedOff = false;
@@ -71,7 +70,7 @@ public WallEyeCam(String tableName, int camIndex, int dioPort) {
7170
NetworkTableInstance nt = NetworkTableInstance.getDefault();
7271
nt.startServer();
7372

74-
NetworkTable table = nt.getTable(tableName);
73+
NetworkTable table = nt.getTable(camName);
7574
connectSub = table.getBooleanTopic("Connected" + camIndex).subscribe(false);
7675
}
7776

@@ -126,13 +125,12 @@ public void processUDP(String rawDataString, long recievedTime) {
126125
}
127126

128127
JsonObject data = JsonParser.parseString(rawDataString).getAsJsonObject();
129-
String camId = camName + camIndex;
130128

131-
if (!data.has(camId)) {
129+
if (!data.has(camName)) {
132130
return; // No vision update
133131
}
134132

135-
JsonObject dataCam = data.getAsJsonObject(camId);
133+
JsonObject dataCam = data.getAsJsonObject(camName);
136134

137135
timestamp = recievedTime - (long) (dataCam.get("Timestamp").getAsDouble() * 1000);
138136

0 commit comments

Comments
 (0)