-
Notifications
You must be signed in to change notification settings - Fork 6
fix(perception_fp): change method contain to intersect #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -137,7 +137,7 @@ | |||||
|
|
||||||
| class NonDetectionArea(BaseModel): | ||||||
| frame_id: Literal["map", "base_link"] | ||||||
| polygon: list[conlist(number, min_length=3, max_length=3)] | ||||||
|
Check failure on line 140 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| z_min: number | None = None | ||||||
| z_max: number | None = None | ||||||
|
|
||||||
|
|
@@ -187,7 +187,7 @@ | |||||
| criteria_name: str | None = None | ||||||
| PassRate: number | ||||||
| non_detection_area: NonDetectionArea | ||||||
| timestamp: list[TimeStamp] | None | ||||||
|
Check failure on line 190 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| topic_type: list[Literal["bbox", "pointcloud"]] | ||||||
|
|
||||||
| def get_type(self) -> tuple[type, ...]: | ||||||
|
|
@@ -224,11 +224,11 @@ | |||||
|
|
||||||
| def set_frame( | ||||||
| self, | ||||||
| timestamp: float, | ||||||
|
Check failure on line 227 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| frame_id: str, | ||||||
|
Check failure on line 228 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| data: PerceptionFPData, | ||||||
|
Check failure on line 229 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| map_to_base_link: np.ndarray, | ||||||
|
Check failure on line 230 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| base_link_to_map: np.ndarray, | ||||||
|
Check failure on line 231 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| ) -> dict | None: | ||||||
| if self.condition.timestamp is not None and not any( | ||||||
| condition_timestamp.is_valid(timestamp) | ||||||
|
|
@@ -277,7 +277,7 @@ | |||||
| }, | ||||||
| } | ||||||
|
|
||||||
| def is_in_non_detection_area( | ||||||
|
Check failure on line 280 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
|
||||||
| self, | ||||||
| frame_id: str, | ||||||
| data: PerceptionFPData, | ||||||
|
|
@@ -308,11 +308,7 @@ | |||||
| else True | ||||||
| ) | ||||||
| ) | ||||||
| is_in_xy = np.any( | ||||||
| contains( | ||||||
| prep_geom, corners[:, 0], corners[:, 1] | ||||||
| ) # or contains(non_detection_area, Polygon(corners[:, 0:2])) | ||||||
| ) | ||||||
| is_in_xy = np.any(prep_geom.intersects(Polygon(corners[:, 0:2]))) | ||||||
|
||||||
| is_in_xy = np.any(prep_geom.intersects(Polygon(corners[:, 0:2]))) | |
| is_in_xy = prep_geom.intersects(Polygon(corners[:, 0:2])) |
Copilot
AI
Mar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change alters the bbox-in-polygon logic (from checking corner containment to polygon intersection). Please add unit tests that cover: (1) a bbox that overlaps the non_detection_area even though all its corners are outside, and (2) a bbox that only touches the boundary (should be treated as non-contact per the use-case docs). Current tests only cover the fully-inside case, so they won't catch regressions here.
Check warning on line 335 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Complete the task associated to this "TODO" comment.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRIv&open=AZzb-C4dkZa_-9vKhRIv&pullRequest=333
Check warning on line 358 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Either remove or fill this block of code.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRIw&open=AZzb-C4dkZa_-9vKhRIw&pullRequest=333
Check failure on line 400 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter timestamp or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRIx&open=AZzb-C4dkZa_-9vKhRIx&pullRequest=333
Check failure on line 401 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter frame_id or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRIy&open=AZzb-C4dkZa_-9vKhRIy&pullRequest=333
Check failure on line 402 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter data or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRIz&open=AZzb-C4dkZa_-9vKhRIz&pullRequest=333
Check failure on line 403 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter skip or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRI0&open=AZzb-C4dkZa_-9vKhRI0&pullRequest=333
Check failure on line 404 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter map_to_base_link or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4dkZa_-9vKhRI1&open=AZzb-C4dkZa_-9vKhRI1&pullRequest=333
Check failure on line 405 in driving_log_replayer_v2/driving_log_replayer_v2/perception_fp/models.py
SonarQubeCloud / SonarCloud Code Analysis
Remove parameter base_link_to_map or provide default value.
See more on https://sonarcloud.io/project/issues?id=tier4_driving_log_replayer_v2&issues=AZzb-C4ekZa_-9vKhRI2&open=AZzb-C4ekZa_-9vKhRI2&pullRequest=333
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prep_geom.intersects(...)returns true even when the bbox only touches the non-detection area boundary. This conflicts with the documented behavior for perception_fp (boundary contact should be treated as non-contact) and with the local comment# boundary is not included. Consider using an interior-intersection check (e.g.,intersectsAND NOTtouches, or another predicate that excludes boundary-only contact) so boundary cases don't become false positives.