Skip to content

Conversation

@kenblu24
Copy link
Owner

@kenblu24 kenblu24 commented Sep 18, 2025

If two agents have the exact same position in the world, then inserting them into the quadtree will fail with RecursionError: maximum recursion depth exceeded.

This PR makes several small changes to how we use quadtrees:

  • The quadtree now stores a list of agents at each point
  • We first query the quadtree prior to insertion, and if the same point is found, append the new agent to the list.
  • There is now a fallback for the BinaryFOVSensor in the case that world.quad is somehow not found
  • I now use numpy arrays instead of withinRadiusExclusiveFast to filter the consideration set by sensor radius

This code was tested using a milling setup with 6-100 agents, as well as with the docker orb simulator (SITLUTMWorld, not in this repo)

@kenblu24 kenblu24 requested a review from jhudd135 September 18, 2025 03:48
@kenblu24 kenblu24 merged commit 4ae3b5d into main Sep 18, 2025
1 check passed
@kenblu24
Copy link
Owner Author

@jhudd135 If you're still working on the sim, you may want to pull main into your branch to incorporate #38 and #40 which affect the BinaryFOVSensor.

@kenblu24 kenblu24 deleted the k24/quads branch October 25, 2025 17:24
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