Repository navigation
fix(mobile): VehicleBase control handling and plot_xyt, tests and docstrings - #774
Merged
Merged
Conversation
…strings - constructor control= used the deprecated add_driver for every control, so a constant tuple raised AttributeError and every driver emitted a deprecation warning; now uses the control setter - init(control=...) and run(control=driver) assigned _control directly and never connected the driver to the vehicle; now uses the control setter - plot_xyt plotted x, y and theta against x, not time (t was computed and unused) - plot_xy had an unreachable default-color branch (args is a tuple); removed, behaviour is unchanged - docstring fixes: placeholder type, broken class reference, :note: field, :raises: for polygon() and run_animation(), MATLAB comments - tests for the above, and for the ValueError paths of polygon(), eval_control() and run_animation() Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 1 |
| Duplication | 0 |
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.
…hicleBase Neither was read, and nothing in RTB or the RVC3 notebooks and figure scripts passes them to a vehicle. VehicleTrailer keeps its own trailers argument. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #774 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14667 14663 -4
=====================================
+ Misses 14667 14663 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes in
VehicleBase(mobile/Vehicle.py) found during the typing pass, with tests and a docstring pass. Trailer classes (Trailer,DiffSteerTrailer,VehicleTrailer) are out of scope, see #773.Bugs fixed
control=in the constructor raisedAttributeError, and every driver passed that way emitted an "add_driver is deprecated" warning. The constructor now uses thecontrolsetter. (A function ascontrol=already worked.)init(control=...)and sorun(control=driver)assigned_controldirectly and never connected the driver to the vehicle, sodemand()failed. Same one-line fix.plot_xytplotted x, y and theta against the x coordinate, not time (twas computed and never used). It now plots against time with an axis label.plot_xy: removed an unreachable "default color" branch (argsis a tuple, neverNone). Behaviour is unchanged.Removed
The
plotandtrailersarguments ofVehicleBase.__init__were never read. Nothing in RTB, or in the RVC3 notebooks and figure scripts, passes them to a vehicle.VehicleTrailerkeeps its owntrailersargument. Anyone passing them now gets aTypeError.Docstrings
Placeholder type, broken class reference,
:note:that was not a valid field, missing:raises:forpolygon()andrun_animation(), a nonexistent:param args:, and leftover MATLAB comments.Testing
Nine new tests in
TestVehicleBase. Six fail onmainand pass here; the other three cover error paths that were already safe (polygon(),eval_control()andrun_animation()raisingValueError). mypy is clean.Related: #772 (drivers). The two PRs both add test classes to
tests/test_mobile.py, so whichever merges second may need a trivial rebase.🤖 Generated with Claude Code