Skip to content

fix(mobile): reject non-positive plot and animation pauses - #896

Open
huxiaoyi-ovo wants to merge 1 commit into
petercorke:mainfrom
huxiaoyi-ovo:fix/plot-pause-zero-876
Open

huxiaoyi-ovo wants to merge 1 commit into
petercorke:mainfrom
huxiaoyi-ovo:fix/plot-pause-zero-876

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown
Contributor

Fixes #876.

plt.pause(0) can block indefinitely. This covers both PoseGraph.plot_scan() and Vehicle animation.

  • Reject non-positive pause values in PoseGraph.plot_scan().
  • Guard the actual plt.pause(dt) call in Vehicle while preserving non-blocking pause=False and notebook-inline behaviour.
  • Add timeout-protected Agg tests for zero, negative and positive durations.

Behaviour change: invalid blocking pause durations now raise ValueError. Numerical results are unchanged.

Validation: fork CI PR #11 (huxiaoyi-ovo#11), 20 jobs successful, one conditional skip; Python 3.10–3.14 across Linux, macOS and Windows, mypy, coverage and docs build.

AI assistance: ChatGPT (GPT-6) helped with code review and regression tests; I reviewed the patch and CI results.

Validate scan pause durations and guard Vehicle's actual pyplot pause
path while preserving pause=False's non-blocking refresh. Add focused
headless and timeout-protected regression tests for both call sites.

This changes invalid pause durations to a clear ValueError instead of
allowing pyplot to wait indefinitely.

Co-Authored-By: ChatGPT (GPT-6) <chatgpt@openai.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
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 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (31d99a9) to head (69dfeb6).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/mobile/PoseGraph.py 0.00% 2 Missing ⚠️
src/roboticstoolbox/mobile/Vehicle.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #896    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        146     146            
  Lines      17295   16690   -605     
======================================
+ Misses     17295   16690   -605     

☔ 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.

@alexermolovich alexermolovich left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for me.

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.

plt.pause(0) waits for ever: PoseGraph.plot_scan(pause=0) and Vehicle animation may hang

2 participants