-
Notifications
You must be signed in to change notification settings - Fork 97
cu-rrt-star: anytime RRT* planner component, with a closed-loop example #1247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Scofield626
wants to merge
13
commits into
master
Choose a base branch
from
anytime-rrt-star-example
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1bcf0fb
example: anytime RRT* planner under two refinement policies
Scofield626 3b16d19
example: publish drivable RRT* paths and derive gamma from the map
Scofield626 9b86111
cu-rrt-star: extract the anytime RRT* planner into a component
Scofield626 0fea739
cu-rrt-star: carry the map in the plan request
Scofield626 7a45e29
cu-rrt-star: dual-policy integration test
Scofield626 925bfc3
cu_anytime_rrt_star: closed-loop navigation demo on cu-rrt-star
Scofield626 feaae1b
cu_anytime_rrt_star: patrol goals with every straight leg blocked
Scofield626 2cbdb23
cu-rrt-star: tolerate missing requests and start-on-goal jobs
Scofield626 4806008
cu_anytime_rrt_star: cap the trail, reset the clock anchor on thaw
Scofield626 d7037d6
Merge branch 'master' into anytime-rrt-star-example
Scofield626 82224cf
cu-rrt-star: narrow exports, merge the gamma sweep, drop defaults and…
Scofield626 bcdf14d
cu-rng: opaque Debug impl for CuRng
Scofield626 f300504
cu-rrt-star: unit-typed payloads, RNG via the CuRng resource, space t…
Scofield626 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [package] | ||
| name = "cu-rrt-star" | ||
| description = "An anytime RRT* path planner component for the Copper project" | ||
| version.workspace = true | ||
| authors.workspace = true | ||
| edition.workspace = true | ||
| rust-version.workspace = true | ||
| license.workspace = true | ||
| keywords.workspace = true | ||
| categories.workspace = true | ||
| homepage.workspace = true | ||
| repository.workspace = true | ||
| documentation = "https://docs.rs/cu-rrt-star" | ||
|
|
||
| [package.metadata.copper] | ||
| kind = "task" | ||
| domains = ["algorithm/planning"] | ||
| environments = ["host"] | ||
|
|
||
| [dependencies] | ||
| bincode = { workspace = true } | ||
| cu-rng = { workspace = true } | ||
| cu29 = { workspace = true } | ||
| serde = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| tempfile = { workspace = true } | ||
|
|
||
| [build-dependencies] | ||
| cu29-build = { workspace = true } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # cu-rrt-star: an anytime RRT* path planner for Copper | ||
|
|
||
| An RRT* planner (Karaman and Frazzoli) packaged as a Copper anytime task. | ||
| `base()` grows the tree until it has a first path and publishes it; every | ||
| `refine()` runs one more block of iterations and republishes only when the | ||
| path got shorter. The RON `anytime:` policy — not the task — decides how many | ||
| refinement quanta run. | ||
|
|
||
| ### Input and output | ||
|
|
||
| - Input: `cu_rrt_star::PlanRequest` — the world (up to `MAX_OBSTACLES` (16) | ||
| round obstacles in a rectangle), start and goal. The map travels with the | ||
| job: the planner has no map of its own, so the source may change the map | ||
| between jobs. Internally the algorithm only sees a sampling and collision | ||
| trait, so the round-obstacle world is one implementation, not a mandate. | ||
| - Output: `cu_rrt_star::PlanPath` — up to `MAX_WAYPOINTS` (32) waypoints. | ||
| Every consecutive pair of waypoints is collision free, so the path can be | ||
| driven as published, whichever stop point the policy picked. `cost` is the | ||
| RRT* tree path cost, an upper bound on the distance actually driven. | ||
| - Distances and costs are `cu29-units` lengths in meters; the quality is a | ||
| `Ratio`. | ||
|
|
||
| ### Usage | ||
|
|
||
| The planner draws its randomness from a `cu_rng::CuRngBundle` resource, so | ||
| the node needs a resource and a binding: | ||
|
|
||
| ```ron | ||
| resources: [ | ||
| ( id: "planner_rng", provider: "cu_rng::CuRngBundle", config: {"seed": 1} ), | ||
| ], | ||
| tasks: [ | ||
| ( | ||
| id: "planner", | ||
| type: "cu_rrt_star::RrtStarPlanner", | ||
| resources: { "rng": "planner_rng.rng" }, | ||
| config: { | ||
| "base_iterations": 400, | ||
| "block_iterations": 256, | ||
| "gamma": 0.0, | ||
| }, | ||
| anytime: ( | ||
| max_refines: 16, | ||
| time_budget_ms: 30.0, | ||
| max_stall: 4, | ||
| quality_floor: 0.05, | ||
| ), | ||
| ), | ||
| ], | ||
| ``` | ||
|
|
||
| ### Configuration | ||
|
|
||
| - `base_iterations` (default 400): iterations of the base block, aiming at a | ||
| first path. | ||
| - `block_iterations` (default 256): iterations of one refinement quantum. | ||
| - `step_size` (default 0.8): longest edge added in one extension, in meters. | ||
| - `goal_bias` (default 0.05): probability of sampling the goal. | ||
| - `goal_threshold` (default 0.5): a node this close to the goal closes a path. | ||
| - `gamma` (default 0.0): rewiring radius constant; `0.0` derives it from the | ||
| map, which is the value RRT* needs to converge to the optimum. | ||
| - `prune_interval` (default 512): branch-and-bound prune every N iterations; | ||
| 0 disables pruning. | ||
| - `max_nodes` (default 4000): hard cap on the tree size. | ||
|
|
||
| ### Anytime policy | ||
|
|
||
| All the knobs of the RON `anytime:` block apply: `max_refines`, | ||
| `time_budget_ms`, `max_age_ms`, `quality_target`, `quality_floor`, | ||
| `max_stall`. The reported quality is `straight-line distance / best path | ||
| cost` in `0.0..=1.0`: 0.0 means no path yet, 1.0 means the path is as short | ||
| as the world allows, so a `quality_target` is portable between maps. | ||
|
|
||
| A job that found no path reports quality 0.0, which stays under any | ||
| configured `quality_floor`: the node then publishes nothing for that | ||
| copperlist. A copperlist without a request also publishes nothing, and a | ||
| request whose start already lies on the goal converges at once with | ||
| quality 1.0. | ||
|
|
||
| ### Determinism and debugging | ||
|
|
||
| Randomness comes from the `CuRng` resource (ChaCha8): job N's stream is a | ||
| pure function of the resource seed and N, and the job counter is part of the | ||
| frozen task state, so replay reruns every job on the stream it used live. A | ||
| remote debug session sees a small `PlannerDebugState` projection (iterations, | ||
| tree size, best cost, published quality) instead of the whole tree. | ||
|
|
||
| ### See also | ||
|
|
||
| - `examples/cu_anytime_rrt_star`: a closed-loop navigation demo with a Rerun | ||
| viewer. | ||
| - `tests/`: the same planner under a quick and a thorough policy, compared | ||
| per copperlist. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| fn main() { | ||
| cu29_build::setup(); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templatign it to make it 2d and 3d would be difficult?