Skip to content

Fix SE(3) plot-state sample indexing - #4982

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-se3-plot-state-sample-axis
Aug 3, 2026
Merged

Fix SE(3) plot-state sample indexing#4982
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-se3-plot-state-sample-axis

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

AbstractSE3Distribution.plot_state() indexed sampled SE(3) states as if samples were stored in columns. PyRecEst's distribution sampling contract returns an array shaped (n_samples, state_dim), including AbstractDiracDistribution.sample().

For two SE(3) samples shaped (2, 7), the previous implementation iterated over the seven state coordinates and assembled seven malformed vectors of shape (2,). It mixed coordinates from different samples and could then fail inside plot_point() or plot incorrect poses.

Fix

  • iterate over the sample axis (samples.shape[0]);
  • read quaternion and linear coordinates from each sample row;
  • preserve the existing showMarginalized=True behavior by combining each sampled quaternion with the mode's linear position;
  • add a regression asserting that two row-major SE(3) samples produce exactly two unchanged plotted states.

Validation

  • isolated pre-fix reproduction: 2 samples shaped (2, 7) became 7 vectors shaped (2,);
  • isolated patched reproduction: the same input remains 2 vectors shaped (7,) and matches the original samples;
  • branch is 2 commits ahead and 0 behind main;
  • final diff is limited to the SE(3) plotting method and its focused test.

GitHub Actions should run the repository's full supported backend and test matrix.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 25.38s
✅ JSON prettier 7 0 0 0 0.97s
✅ JSON v8r 7 0 0 3.49s
✅ MARKDOWN markdownlint 68 0 0 0 1.88s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.55s
✅ PYTHON black 1809 56 0 0 86.34s
✅ PYTHON isort 1809 88 0 0 2.66s
✅ REPOSITORY betterleaks yes no no 1.27s
✅ REPOSITORY checkov yes no no 53.35s
✅ REPOSITORY gitleaks yes no no 16.0s
✅ REPOSITORY git_diff yes no no 0.15s
✅ REPOSITORY secretlint yes no no 79.55s
✅ REPOSITORY syft yes no no 5.64s
✅ REPOSITORY trivy-sbom yes no no 6.46s
✅ REPOSITORY trufflehog yes no no 31.3s
✅ YAML prettier 11 0 0 0 0.75s
✅ YAML v8r 11 0 0 12.18s
✅ YAML yamllint 11 0 0 0.61s

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 August 3, 2026 08:45
@FlorianPfaff
FlorianPfaff merged commit bbb018f into main Aug 3, 2026
26 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