fix(autoware_bevfusion): validate remapper config at runtime#12472
Open
BISTU-gzy wants to merge 1 commit intoautowarefoundation:mainfrom
Open
fix(autoware_bevfusion): validate remapper config at runtime#12472BISTU-gzy wants to merge 1 commit intoautowarefoundation:mainfrom
BISTU-gzy wants to merge 1 commit intoautowarefoundation:mainfrom
Conversation
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
f60c7b0 to
54d8c89
Compare
Signed-off-by: BISTU-gzy <269895055+BISTU-gzy@users.noreply.github.com>
54d8c89 to
434aff7
Compare
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.
Summary
This PR hardens
autoware_bevfusion's detection class remapper by:Motivation
autoware_bevfusionloads the remapper parameters from an external model data file.Before this change, the remapper only validated matrix sizes with
assert(...).In release builds, those assertions disappear, so malformed remapper config could reach
Eigen::Mapand matrix indexing without any runtime protection.This patch makes the failure mode explicit and consistent with the package's existing
fail-fast parameter validation style.
What Changed
DetectionClassRemapper::setParameters()now throws on:DetectionClassRemapper::mapClasses()now skips labels outside the configured matrix rangetest_detection_class_remapper.cppTesting
git diff --checkamenttest harness against:perception/autoware_bevfusion/lib/detection_class_remapper.cppperception/autoware_bevfusion/test/test_detection_class_remapper.cppResult:
Note:
colcon build --packages-select autoware_bevfusionwas not completed in this environment because the local workspace is missing several internal package dependencies unrelated to this patch.