petercorke / petercorke/robotics-toolbox-python

mobile/EKF.py and SensorBase have no live test coverage -- old MATLAB test stubs never ported

Open
#597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech-debt
Dominant language
C++
Stars
3.5k
Forks
624
Avg merge
2d 4h
Merged PRs (30d)
53

Description

`EKF.py` (1617 lines, 39 methods) has zero live tests -- every EKF test in `test_mobile.py` (`DeadReckoning_test`, `MapLocalization_test`, `Mapping_test`, `SLAM_test`, `ParticleFilter_test`) is commented out and is unconverted MATLAB syntax (`randinit`, `tc.TestData.Duration`, `veh.add_driver`, `numcols`) -- never ported when this was ported from the MATLAB toolbox.

`sensors.py`'s `SensorBase` has no standalone test either, only indirect exercise via `RangeBearingSensor`'s 3 tests (`test_init`, `test_reading`, `test_h`). Untested: the `_animate`/plotting branch, `range`/`angle` field-of-view filtering, and the `fail`-window simulated-failure option.

This gap is exactly why two kwarg renames on these code paths went unnoticed for years: `Bicycle`'s `vlim`/`slim` -> `speed_max`/`steer_max` (2021, fixed in #596) and `SensorBase`'s `animate` -> `plot` (2023) -- both broke the RVC3 book's own example notebooks with no test catching either.

Proper fix: port the five commented-out MATLAB test stubs to real pytest tests exercising `EKF.run()` end-to-end (dead reckoning, map-based localization, mapping, SLAM), add a standalone `SensorBase` test, and cover the `_animate` plotting branch and `range`/`angle` FOV filtering in `RangeBearingSensor`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the commented test stubs in test_mobile.py, then read mobile/EKF.py and sensors.py to identify the existing entry points and behaviors to exercise. Port the five EKF scenarios to pytest, add standalone SensorBase coverage, and cover RangeBearingSensor plotting and range/angle filtering; done means these paths run as live tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, python
Domain
robotics, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.