Skip to content

Reject non-vector SE2 UKF measurements#4639

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-nonvector-se2-measurements-20260723
Jul 24, 2026
Merged

Reject non-vector SE2 UKF measurements#4639
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-nonvector-se2-measurements-20260723

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

SE2UKF._validate_se2_measurement() flattened the supplied measurement before validating its shape. Consequently, row vectors, column vectors, and matrices with four total elements—such as shapes (1, 4), (4, 1), and (2, 2)—were silently accepted as dual-quaternion measurements.

This violates the documented (4,) input contract and can hide upstream batching, orientation, or reshaping mistakes.

Fix

  • validate the original backend-array shape instead of flattening it;
  • require measurements to have the exact shape (4,);
  • preserve valid Python lists and one-dimensional backend arrays.

Regression coverage

A focused public-API test verifies that update_identity() rejects measurements with shapes:

  • (1, 4);
  • (4, 1);
  • (2, 2).

Validation

  • reproduced the old acceptance directly from the pre-validation .ravel() behavior;
  • inspected the branch diff: one production-line change plus one focused test file;
  • the branch is currently two commits behind rapidly advancing main, and those intervening commits concern UKF-M and Bingham-filter validation rather than SE2UKF;
  • a local repository checkout was unavailable in this environment, so GitHub Actions provides the authoritative test and backend-matrix validation.

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 24.82s
✅ JSON prettier 7 0 0 0 1.21s
✅ JSON v8r 7 0 0 3.52s
✅ MARKDOWN markdownlint 68 0 0 0 1.96s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.74s
✅ PYTHON black 1634 238 0 0 94.94s
✅ PYTHON isort 1634 434 0 0 2.77s
✅ REPOSITORY betterleaks yes no no 2.89s
✅ REPOSITORY checkov yes no no 54.31s
✅ REPOSITORY gitleaks yes no no 14.59s
✅ REPOSITORY git_diff yes no no 0.47s
✅ REPOSITORY secretlint yes no no 69.53s
✅ REPOSITORY syft yes no no 6.13s
✅ REPOSITORY trivy-sbom yes no no 6.65s
✅ REPOSITORY trufflehog yes no no 31.45s
✅ YAML prettier 11 0 0 0 0.69s
✅ YAML v8r 11 0 0 10.29s
✅ YAML yamllint 11 0 0 0.55s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff
FlorianPfaff marked this pull request as ready for review July 23, 2026 16:21
@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) July 23, 2026 16:21
@FlorianPfaff
FlorianPfaff merged commit 0722de7 into main Jul 24, 2026
41 of 42 checks passed
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.

1 participant