Skip to content

Preserve clean controls in histogram localization observations - #1515

Open
Elon-Jiang wants to merge 1 commit into
AtsushiSakai:masterfrom
Elon-Jiang:fix/histogram-clean-control
Open

Elon-Jiang wants to merge 1 commit into
AtsushiSakai:masterfrom
Elon-Jiang:fix/histogram-clean-control

Conversation

@Elon-Jiang

Copy link
Copy Markdown

Reference issue

No matching open Issue/PR found after checking all open PR file lists, complete focused searches and the full histogram-filter source history.

What does this implement/fix?

observation creates a view of the supplied clean control (ud = u[:, :]) and adds speed-sensor noise in place. This changes the caller's command. Reusing a constant command therefore feeds accumulated measurement noise into subsequent true-state propagation; a read-only command also raises instead of producing an observation.

Copy the control before adding noise, keeping the simulated noisy measurement separate from the clean input. The noise distribution, random draws, kinematic model, filter and public interface are unchanged. The default example, which constructs a fresh command each step, retains its behaviour; reused commands now preserve the intended true trajectory.

For a command [1.0, 0.1] and NumPy seed 0, the old caller-owned speed becomes 1.8820, 2.0821, then 2.5715 over three observations. The third true-position error against propagation with the original command is 0.1964 m. The fix leaves the command unchanged and that error at zero.

Additional information

Normal source imports and pinned requirements, Python 3.13.11 on macOS arm64. Tests run the actual observation and kinematic functions; a supplied distant RFID landmark gives a legitimate no-landmark-in-range case. No simulator, hardware or replacement sensor algorithm is claimed.

  • Original focused tests: 3 failed, 1 passed (existing unanimated simulation).
  • Fixed focused tests: 4 passed, warnings treated as errors. Coverage includes reused/read-only inputs, independent measured controls and the true trajectory.
  • bash runtests.sh: 159 passed in 69.19 s, including changed-file Ruff/type checks and warnings-as-errors, with BLAS/OMP threads limited to one.
  • Ruff and git diff --check: passed.
  • make html with warnings-as-errors: passed. Existing official page updated; generated paragraph and parent navigation verified.

Prepared and tested with assistance from OpenAI Codex.

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example? (Updated the existing official page.)
  • All CIs are green? (Hosted checks pending.)

Co-authored-by: OpenAI Codex <noreply@openai.com>

This branch has not been deployed

No deployments
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