From 347c2b640b516cac409cade49a10711b8ae4713e Mon Sep 17 00:00:00 2001 From: "ole.flb" <45100017+oleflb@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:17:31 +0200 Subject: [PATCH] reintroduce check (#1207) Co-authored-by: okiwi6 --- crates/control/src/ball_filter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/control/src/ball_filter.rs b/crates/control/src/ball_filter.rs index 1c2276b300..6958d67741 100644 --- a/crates/control/src/ball_filter.rs +++ b/crates/control/src/ball_filter.rs @@ -157,7 +157,10 @@ impl BallFilter { .start_time .duration_since(ball.last_seen) .expect("time ran backwards"); + let validity_high_enough = + hypothesis.validity >= filter_parameters.validity_discard_threshold; is_ball_inside_field(ball, field_dimensions) + && validity_high_enough && duration_since_last_observation < filter_parameters.hypothesis_timeout };