Collision Zone Performance Refactor [SYNTH-132] - #1354
Merged
Conversation
[SYNTH-132]
azaleacolburn
marked this pull request as ready for review
July 1, 2026 16:48
azaleacolburn
force-pushed
the
colbura/132/collision-zone-perf
branch
from
July 1, 2026 16:49
ead903f to
9468a61
Compare
AlexD717
requested changes
Jul 16, 2026
Member
Contributor
Author
|
Gang I promise the bounding boxes were tightly fitting before 😭 |
AlexD717
requested changes
Jul 17, 2026
AlexD717
left a comment
Member
There was a problem hiding this comment.
Minor debug bounding box duplication glitch, but otherwise lgtm.
Contributor
Author
Member
Technically it's not just for the dimension tracker that it matters, a robot that has a deployable intake is inside a protected zone when the pre-deploy bounding box (bumpers) are not. As long as it gets fixed later/is tracked though |
PepperLola
approved these changes
Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Task
SYNTH-132
Symptom
Performance tanks when robots and pieces enter zones. Generally zones cause poor performance.
This is due to the way in which
ZoneSceneObjects handle collisions. Basically, each one creates a sensor, then subscribes to every collision between all Jolt bodies, this is horribly expensive for two reasons:Solution
Each sub-class of
ZoneSceneObjectnow implements a function calledcheckObjectsInZone, which is responsible for manually going through every object that the zone cares about and checking if they are in the zone, then performing the needed actions given that information.Instead of listening for collisions, these functions (in
ScoringZoneSceneObjectandProtectedZoneSceneObject) draw bounding boxes around every object they care about (e.g. each robot), then check if that bounding box overlaps with that of the zone.Verification
We don't have standardized performance benchmarks, but the lag that used to be present when a robot enters a protected zone is gone. Try this with 2471's 2018 bot, the difference is actually huge (on my machine).
The performance for game pieces in scoring zones is gone, however on some fields (e.g. 2023), there complicated jolt bodies around the scoring zone, which can cause placed bodies to lag slightly. However, other parts of the scoring zone are unaffected.
Tests have been updated to match the new way zones work.
Before merging, ensure the following criteria are met: