ITEP-89462 Refactor and add UT for controller analytics functions#1299
Open
tdorauintc wants to merge 12 commits intomainfrom
Open
ITEP-89462 Refactor and add UT for controller analytics functions#1299tdorauintc wants to merge 12 commits intomainfrom
tdorauintc wants to merge 12 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors controller analytics for tripwire/region event detection into reusable, batch-oriented helpers in scene_common.geometry, and adds unit tests to validate the new primitives independently of the controller.
Changes:
- Added
get_tripwire_events()andget_region_events()helpers toscene_common.geometry. - Updated
controller.scene.Sceneto use the new helpers for analytics event calculation. - Added new geometry unit tests covering tripwire crossings and region containment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scene_common/src/scene_common/geometry.py |
Introduces batched helper functions to compute tripwire crossings and region membership. |
controller/src/controller/scene.py |
Refactors tripwire/region event update logic to call the new geometry helpers. |
tests/sscape_tests/geometry/test_tripwire_events.py |
Adds unit tests for tripwire crossing detection across orientations and edge cases. |
tests/sscape_tests/geometry/test_region_events.py |
Adds unit tests for region containment across polygon/circle/scene region types. |
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.
📝 Description
Changes:
Background:
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Validated with the following automated tests:
mqtt-tripwire,mqtt-roi,geometry-unit✅ Checklist
Before submitting the PR, ensure the following: