Repository navigation
fix(mobile): DistanceTransform, PRM, QuinticPoly and CurvaturePoly planners - #781
Merged
Merged
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 2 high |
| Security | 1 high |
🟢 Metrics 58 complexity · 0 duplication
Metric Results Complexity 58 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.
5 tasks
…anners Defects (each with a test that failed first): - DistanceTransformPlanner.next wrapped around at the left and top borders, so a path from the left edge to a goal on the right edge never ended (query looped forever); an unknown metric raised UnboundLocalError; plot_3d always called a blocking plt.show() and its ls argument is renamed path_style - PRMPlanner.plot printed debug text; vertex/edge become vertex_style/ edge_style (the old names deprecated); plan(animate=) was accepted and did nothing (deprecated); query required start and goal and inserted the raw arguments rather than the validated ones - QuinticPolyPlanner ignored goal_vel and goal_acc (the start values were used for the goal), returned an infeasible path silently when no time met the limits (now RuntimeError), printed 'find path!!', and kept start and goal as given rather than as arrays - CurvaturePolyPlanner printed the optimizer result, its docstring example imported the wrong class and had a mutable default argument Docstrings and types: ArrayLike2/ArrayLike3, the class docstring of PRMPlanner described a distance transform planner, typos, stale __main__ demos removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
_create_roadmap visited every ordered pair of vertices, so each connection was added from both of its ends. pgraph's UGraph does not de-duplicate (it is a multigraph), so the roadmap had two parallel edges per connection: the edge count shown was doubled (the book's 10,000 is 5,000 connections), and current pgraph draws parallel edges as two arcs instead of one straight line. Each unordered pair is now considered once, from the earlier vertex. For the house floorplan, seed 0: 50 points 222 -> 111 edges, 300 points 10,000 -> 5,000 edges; the number of components and both query paths are identical. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
petercorke
force-pushed
the
bug/mobile-planners-a
branch
from
October 15, 2026 02:34
8d7e64c to
cd9443f
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #781 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 144 144
Lines 14733 14746 +13
=====================================
- Misses 14733 14746 +13 ☔ 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
Entries 26-30 of the typing-pass problem list, and what a full review of the four planner files turned up. Stacked on #778 (the
PRMPlanner.plotoverride has to match the newPlannerBase.plot); until #778 merges this PR also shows its commits.Bugs fixed (each test failed first)
DistanceTransformPlannernext()wrapped around at the left and top borders: for a goal on the opposite edge it stepped off the map, andquery()never terminated.metricraisedUnboundLocalError; it is aValueError(also from the constructor).plot_3dalways called a blockingplt.show(). It hasblock(defaultTrue, as before) andpath_style(lsis deprecated).distance="manhattan"; the argument ismetric. It only ran because unknown arguments were swallowed (fixed on fix(mobile): PlannerBase argument checks, plot without side effects, and <thing>_style arguments #778 itself).PRMPlannerplotprinted "plotted background" and "plotted roadmap" (entry 27) and returnedNone; it now returns the axes.vertex=/edge=becomevertex_style=/edge_style=, defaultsVERTEX_STYLE/EDGE_STYLE, old names deprecated (the book'sfig5_19.pyandfig5_20.pyuse them).plan(animate=...)was accepted and did nothing (deprecated).queryrequiredstartandgoal, and inserted the arguments as given rather than the validated start and goal; both are now optional and default to the constructor's.QuinticPolyPlannergoal_velandgoal_accwere ignored: the start values were passed as the goal (entry 28). The book does not use this planner.RuntimeError.start/goalwere kept as given (a tuple), not as arrays (entry 29).CurvaturePolyPlannerDubinsPlannerand then usedCurvaturePolyPlanner(aNameErrorin the docs build), andsolvepathhad a mutable default argument.Test changes
tests/test_prm_constructor.pyasserted the private call_create_roadmap(npoints, thresh, None), including the deadanimateargument; it now asserts(npoints, thresh).Each roadmap connection is one edge, not two
_create_roadmapvisited every ordered pair of vertices, so each connection was added from both of its ends. pgraph'sUGraphis a multigraph and does not de-duplicate, so the roadmap held two parallel edges per connection:10,000 edgesis 5,000 connections);Each unordered pair is now considered once. Measured on the house floorplan,
seed=0:querybr3 -> kitchen, br2 -> kitchenThe two printed edge counts in the book's notebook change (erratum, petercorke/RVC3-python#55).
Not changed, noted
PRMPlanner._test_pathsamplesround(length)points along an edge, so an edge shorter than half a cell is not tested at all. A denser test is not "more correct": three plausible tests (the current one, both ends plus a point per cell, and the grid cells along the segment) disagree on at most 16 of 13,640 candidate connections, and none is exact. Left as it is.CurvaturePolyPlannerdoes not check whether the optimizer succeeded. On the book's cases it does (end error 1e-4 to 4e-3). A warning is proposed separately.Full suite 1106 passed (both compiled extensions, pinned SMTB), mypy clean.
🤖 Generated with Claude Code