Skip to content

Conversation

@the-glu
Copy link
Contributor

@the-glu the-glu commented Sep 10, 2025

The randomize function of the mock_uss's clustering is wrong and can generate clusters outside the list of points.

Keeping it in one axes, if min = 0, max = 4 and points = [1, 3], this mean

u_min = 1
u_max = 3
x_offset = random.uniform(-3, 1)

Should we chose -3 as value

x_min = -3 x_max = 1

Meaning our clustering window will have one point outside of the cluster.

This PR fixes it with another calculation with explanations, see the code.

This PR also fix extend that was wrongly used self instead of new cluster, and do a copy of points to avoid having the same list between cluster's copies.

@barroco barroco merged commit 006a229 into interuss:main Sep 10, 2025
21 checks passed
@barroco barroco deleted the fix_clustering2 branch September 10, 2025 16:16
github-actions bot added a commit that referenced this pull request Sep 10, 2025
Co-authored-by: Michael Barroco <michael@orbitalize.com> 006a229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants