Skip to content

feat(mobile): animate range-bearing sensor beam and sensing region - #858

Merged
petercorke merged 3 commits into
petercorke:mainfrom
huxiaoyi-ovo:fix/range-bearing-visualization-753-clean
Oct 22, 2026
Merged

petercorke merged 3 commits into
petercorke:mainfrom
huxiaoyi-ovo:fix/range-bearing-visualization-753-clean

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown
Contributor

Summary

Closes #753.

Implement animated visualization for RangeBearingSensor:

  • Draw and update the sensing-region polygon using poly_style, accounting for the robot pose, range limits, and angular field of view.
  • Draw and update the observed-landmark beam using line_style.
  • Reuse Matplotlib artists across readings, hide the beam when no observation is available, and reset artists during initialization.
  • Remove obsolete documentation and commented-out MATLAB code.

Validation

  • Added headless Agg regression tests covering sensor movement, styling, artist reuse, missing observations, reset behaviour, and unspecified sensing limits.
  • Full fork CI passed across Linux, macOS, and Windows with Python 3.10–3.14.
  • Core tests: 1820 passed, 16 skipped, 106 subtests passed.
  • mypy, documentation build, coverage and PR title checks passed.

[Full CI results](https://github.com/huxiaoyi-ovo/robotics-toolbox-python/actions/runs/39250192578)

Behaviour changes

When plot=True, the sensing region and observation beam are now rendered and updated. Sensor measurements and returned landmark IDs are unchanged.

AI Assistance

ChatGPT (OpenAI GPT-6) assisted with implementation and regression tests. The changes were reviewed and validated before submission.

huxiaoyi-ovo and others added 2 commits October 19, 2026 20:11
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 26 high

Alerts:
⚠ 26 issues (≤ 0 issues of at least minor severity)

Results:
26 new issues

Category Results
ErrorProne 1 high
Security 25 high

View in Codacy

🟢 Metrics 31 complexity · 0 duplication

Metric Results
Complexity 31
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (6b85d77) to head (a06ce1b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/mobile/sensors.py 0.00% 55 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #858   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        146     146           
  Lines      17241   17295   +54     
=====================================
- Misses     17241   17295   +54     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke

Copy link
Copy Markdown
Owner

Thank you for this, and for the focused tests. The beam to the observed landmark and the sensing region behave well, line_style and poly_style now do what the docstring said, and hiding the beam on a missed or failed reading is a good detail. I checked it against current main: mypy is clean and the mobile tests pass. I'll update the branch with main and merge it once CI is green.

@petercorke
petercorke enabled auto-merge (squash) October 22, 2026 05:23
@petercorke
petercorke merged commit 9402635 into petercorke:main Oct 22, 2026
22 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 22, 2026
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.

RangeBearingSensor: line_style and poly_style are accepted but unused; animate the sensing beam and region

2 participants