mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
Updated testing shit
This commit is contained in:
@@ -92,7 +92,7 @@ public class RecordDriveInput extends CommandBase {
|
||||
for(long millis : timedInput.keySet())
|
||||
writer.println(millis + "," + timedInput.get(millis)[0] + "," + timedInput.get(millis)[1] + "," + timedInput.get(millis)[2]);
|
||||
|
||||
writer.println((millis + 1) + ",0,0,0");
|
||||
//// writer.println(( + 1) + ",0,0,0");
|
||||
writer.close();
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -88,8 +88,9 @@ public class TrackTarget extends CommandBase {
|
||||
m_visionOdometry.setDriverMode(false);
|
||||
m_visionOdometry.setLEDs(true);
|
||||
|
||||
points = m_visionOdometry.getTargetPoints();
|
||||
// points = filterPoints(points);
|
||||
//// points = m_visionOdometry.getTargetPoints();
|
||||
points = getFakePoints();
|
||||
//// points = filterPoints(points);
|
||||
Point average = VisionOdometry.averagePoint(points);
|
||||
|
||||
double output = (average.x - VisionConstants.LIME_HIXELS/2.d) / VisionConstants.LIME_HIXELS;
|
||||
@@ -154,6 +155,17 @@ public class TrackTarget extends CommandBase {
|
||||
// return (ArrayList<Point>) pointDistances.keySet().stream().filter(p -> pointDistances.get(p) < 2 * averageDist).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
public final ArrayList<Point> getFakePoints() {
|
||||
ArrayList<Point> fakePoints = new ArrayList<>();
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
Point p = new Point((Math.random() * 20) - 10 + (VisionConstants.LIME_HIXELS/2), (Math.random() * 20) - 10 + (VisionConstants.LIME_VIXELS/2));
|
||||
fakePoints.add(p);
|
||||
}
|
||||
|
||||
return fakePoints;
|
||||
}
|
||||
|
||||
public final double getDistance(double averageY) {
|
||||
double y_rot = averageY / VisionConstants.LIME_VIXELS;
|
||||
y_rot *= Math.toRadians(VisionConstants.V_FOV);
|
||||
|
||||
Reference in New Issue
Block a user