@@ -119,13 +119,13 @@ public WallEyeResult[] getResults() {
119119 for (int j = 0 ; j < temp [7 ]; ++j )
120120 tags [i ] = (int ) temp [j + 8 ];
121121
122-
122+ //(long)temp[6]
123123 if (dios .size () == 0 || gyroResults [i ][maxGyroResultSize - 1 ] == null || temp [6 ] > gyroResults [i ][currentGyroIndex - 1 >= 0 ? currentGyroIndex - 1 : maxGyroResultSize - 1 ].getTimestamp ())
124124 results .add (new WallEyeResult (new Pose3d (new Translation3d (temp [0 ], temp [1 ], temp [2 ]), new Rotation3d (temp [3 ], temp [4 ], temp [5 ])),
125- temp [6 ], i , curUpdateNum , (int ) temp [7 ], tags , temp [8 + (int ) temp [7 ]] ));
125+ ( long ) temp [6 ] + sub . getAtomic (). timestamp , i , curUpdateNum , (int ) temp [7 ], tags , temp [8 + (int ) temp [7 ]] ));
126126 else
127127 results .add (new WallEyeResult (new Pose3d (new Translation3d (temp [0 ], temp [1 ], temp [2 ]), findGyro ((long )temp [6 ], i )),
128- temp [6 ], i , curUpdateNum , (int ) temp [7 ], tags , temp [8 + (int ) temp [7 ]] ));
128+ ( long ) temp [6 ] + sub . getAtomic (). timestamp , i , curUpdateNum , (int ) temp [7 ], tags , temp [8 + (int ) temp [7 ]] ));
129129
130130 }
131131 WallEyeResult [] returnArray = new WallEyeResult [results .size ()];
@@ -153,7 +153,6 @@ public Rotation3d findGyro(long timestamp, int camIndex) {
153153 return new Rotation3d ();
154154
155155 while ((timestamp - gyroResults [camIndex ][mid ].getTimestamp () > 1.0 /camFPS * 1000000 || timestamp - gyroResults [camIndex ][mid ].getTimestamp () < 0 )&& min != mid && loops < 10 ) {
156- System .out .println (min + " " + mid + " " + max );
157156 loops ++;
158157 if (gyroResults [camIndex ][mid ].getTimestamp () > timestamp )
159158 max = mid ;
@@ -162,7 +161,6 @@ public Rotation3d findGyro(long timestamp, int camIndex) {
162161 mid = max > min ? (max - min ) / 2 + min : (maxGyroResultSize - min + max ) / 2 + min ;
163162 mid %= maxGyroResultSize ;
164163 }
165- System .out .println (gyroResults [camIndex ][mid ].getTimestamp () + " " + timestamp + " " + loops + " " + Math .abs (gyroResults [camIndex ][mid ].getTimestamp () - timestamp ) + " " + (min != mid ));
166164 return new Rotation3d (0 , 0 , gyroResults [camIndex ][mid ].getGyro ());
167165 }
168166
0 commit comments