11package WallEye ;
22
3- import java .lang .reflect .Array ;
43import java .util .ArrayList ;
54import java .util .HashMap ;
65import java .util .function .DoubleSupplier ;
76
8- import edu .wpi .first .math .Pair ;
97import edu .wpi .first .math .geometry .Pose3d ;
108import edu .wpi .first .math .geometry .Rotation3d ;
119import edu .wpi .first .math .geometry .Transform3d ;
1412import edu .wpi .first .networktables .IntegerSubscriber ;
1513import edu .wpi .first .networktables .NetworkTable ;
1614import edu .wpi .first .networktables .NetworkTableInstance ;
17- import edu .wpi .first .util .CircularBuffer ;
1815import edu .wpi .first .wpilibj .DigitalInput ;
1916import edu .wpi .first .wpilibj .Notifier ;
2017import edu .wpi .first .wpilibj .RobotController ;
21- import edu .wpi .first .wpilibj2 .command .CommandBase ;
22- import WallEye .WallEyeResult ;
2318
2419/**
2520 * A robot side code interface to interact and pull data from an Orange Pi running WallEye
@@ -134,8 +129,6 @@ public WallEyeResult[] getResults() {
134129 else {
135130 DIOGyroResult savedStrobe = findGyro ((sub .getAtomic ().timestamp + (long )temp [6 ]), i , temp [5 ]);
136131
137- //System.out.println(savedStrobe.getTimestamp() - ((double)sub.getAtomic().timestamp) + temp[6]);
138-
139132 results .add (new WallEyeResult (new Pose3d (new Translation3d (temp [0 ], temp [1 ], temp [2 ]), new Rotation3d (0 , 0 , savedStrobe .getGyro ())),
140133 savedStrobe .getTimestamp (), i , curUpdateNum , (int ) temp [7 ], tags , temp [8 + (int ) temp [7 ]] ));
141134 }
@@ -161,7 +154,6 @@ public DIOGyroResult findGyro(long timestamp, int camIndex, double yaw) {
161154 if (index < 0 )
162155 index += maxGyroResultSize ;
163156 while ((long )gyroResults [camIndex ][index ].getTimestamp () > timestamp ) {
164- //System.out.println(index);
165157 index --;
166158 if (index < 0 )
167159 index += maxGyroResultSize ;
@@ -170,27 +162,6 @@ public DIOGyroResult findGyro(long timestamp, int camIndex, double yaw) {
170162 }
171163 return gyroResults [camIndex ][index ];
172164 }
173- // public DIOGyroResult findGyro(long timestamp, int camIndex) {
174- // int max = currentGyroIndex - 1 >= 0 ? currentGyroIndex - 1 : maxGyroResultSize - 1;
175- // int min = currentGyroIndex;
176- // int loops = 0;
177- // int mid = max > min ? (max - min) / 2 : (maxGyroResultSize - min + max) / 2 + min;
178- // mid %= maxGyroResultSize;
179-
180- // if (gyroResults[camIndex][maxGyroResultSize-1] == null)
181- // return new DIOGyroResult(0.0, 0);
182-
183- // while ((timestamp - gyroResults[camIndex][mid].getTimestamp() > 1.0/camFPS * 1000000 || timestamp - gyroResults[camIndex][mid].getTimestamp() < 0)&& min != mid && loops < 10) {
184- // loops++;
185- // if (gyroResults[camIndex][mid].getTimestamp() > timestamp)
186- // max = mid;
187- // else
188- // min = mid;
189- // mid = max > min ? (max - min) / 2 + min: (maxGyroResultSize - min + max) / 2 + min;
190- // mid %= maxGyroResultSize;
191- // }
192- // return gyroResults[camIndex][mid];
193- // }
194165
195166 /**
196167 * Getter for the current update number
0 commit comments