Skip to content

fix(mobile): preserve angular turn-rate units for Unicycle - #719

Draft
Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/unicycle-turn-rate-units
Draft

Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/unicycle-turn-rate-units

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 9, 2026

Copy link
Copy Markdown

Summary

Unicycle documents its inputs as forward speed and angular turn rate. With W=0.5, a command of 0.4 rad/s currently produces 0.8 rad/s; with W=2, it produces 0.2 rad/s. The same scaling can exceed the configured angular turn-rate limit and changes the simulated heading and odometry.

Return the limited angular input directly in Unicycle.deriv(). Add modern type hints, clarify the input units in the vehicle and Unicycle documentation, and cover signed turns, non-unit widths, repeated limited steps, and differential wheel-speed controls.

Validation

  • Exact base: 968ed048639c01c9032e256565731e2703de77fe.
  • New regressions on the base: 8 failed, 7 passed. The failures reproduce in a separately built base checkout.
  • Mobile tests after the fix: 32 passed.
  • Complete configured suite with Swift, collision and QP dependencies: 859 passed, 3 existing explicit skips, 17 subtests passed on Linux/Python 3.12.14. Both compiled extensions are present. The core variant without Swift also passes: 850 passed, 12 skipped.
  • Ruff formatting and git diff --check pass. Ruff lint reports the same 24 existing diagnostics in the two changed Python files on the base and the patch, with no additions.
  • The configured Sphinx HTML build succeeds on the base and the patch. Both builds print the same 21 runblock errors at the same four existing locations; those examples are not claimed as passing.
  • Other operating systems, Python versions, physical hardware and browser/Pyodide execution were not tested locally.

Checklist

  • PR title follows Conventional Commits
  • Tests pass locally (pytest), with the existing skips listed above
  • Added tests for this change
  • Changed method and new tests use modern type hints
  • Docstrings and Sphinx documentation updated
  • Change is focused
  • No project-specific data or notebooks added

AI assistance: prepared with OpenAI Codex (gpt-6.1-sol). The validation above was executed in the native environment.

Return the documented angular input directly, clarify control units, and add width and limit regression coverage.

AI assistance: OpenAI Codex (gpt-6.1-sol).
@codacy-production

codacy-production Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
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.

Resolve the three Codacy F405 findings in the new Unicycle regression tests with explicit DiffSteer and Unicycle imports. Native mobile and full configured suites pass.

AI assistance: OpenAI Codex (gpt-6.1-sol).

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