Commit caa68ce6 authored by NicolaiO's avatar NicolaiO 🐼 Committed by TIGERs GitLab
Browse files

Made adjustment of tCapture in CamFilter configurable.

See merge request main/Sumatra!1370

sumatra-commit: f9760b624aba15b4c1f33e347da799fdad1c3be3
parent 62dfef26
Pipeline #8909 passed with stage
in 4 minutes and 29 seconds
......@@ -115,6 +115,9 @@ public class CamFilter
@Configurable(defValue = "200.0", comment = "Max. distance to copy state from filtered bot to new trackers")
private static double copyTrackerMaxDistance = 200.0;
@Configurable(defValue = "false", comment = "Adjust frame times based on estimated frame rate and frame number")
private static boolean adjustTCapture = false;
static
{
ConfigRegistration.registerClass("vision", CamFilter.class);
......@@ -222,11 +225,16 @@ public class CamFilter
frameIntervalFilter.addSample(frame.getCamFrameNumber(), frame.gettCapture());
}
IVector2 estimate = frameIntervalFilter.getBestEstimate().orElse(Vector2.fromXY(frame.gettCapture(), 0.0));
if (adjustTCapture)
{
IVector2 estimate = frameIntervalFilter.getBestEstimate().orElse(Vector2.fromXY(frame.gettCapture(), 0.0));
double tCapture = estimate.x() + (estimate.y() * frame.getCamFrameNumber());
double tCapture = estimate.x() + (estimate.y() * frame.getCamFrameNumber());
return new CamDetectionFrame(frame, (long) tCapture);
}
return new CamDetectionFrame(frame, (long) tCapture);
return frame;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment