-
Notifications
You must be signed in to change notification settings - Fork 111
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
DATA-776 Motion planning redesign for speed and quality #1604
DATA-776 Motion planning redesign for speed and quality #1604
Conversation
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.
Ok I think this is the last round of changes I'm going to request, its looking like its in a really great spot now! These abstractions make the whole thing a lot cleaner, I'm in particular really liking how easily you were able to add the fallback options, as well as the Planager
motionplan/rrtStarConnect.go
Outdated
|
||
solution := shortestPath(rrt.rm, shared, optimalCost) | ||
solutionCost = EvaluatePlan(solution, rrt.planOpts) | ||
mp.logger.Warnf("RRT* progress: %d%%\tpath cost: %.3f", 100*i/algOpts.PlanIter, solutionCost) | ||
// check if an early exit is possible | ||
if solutionCost-optimalCost < algOpts.OptimalityThreshold*optimalCost { |
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.
[minor] I wonder how often this is happening. Now that we are directly checking for interpolations, my hunch is this will never evaluate to true. We could save ourselves an if statement per iteration by removing this. As well as clean up the code a little more
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.
and if we do that there is also no point of even having an OptimalityThreshold
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.
Good point, I will remove.
@@ -209,12 +233,14 @@ func (mp *rrtStarConnectMotionPlanner) extend(algOpts *rrtStarConnectOptions, tr | |||
if cost < minCost && mp.checkPath(algOpts.planOpts, neighborNode.Q(), target) { | |||
minIndex = i | |||
minCost = cost | |||
break |
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.
can you explain why we're breaking out now?
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.
kNearestNeighbors was updated to return the neighbors sorted by cost (if they are cost nodes).
So the first valid node we find, is going to be the minimum cost.
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.
sweet. Can you add a comment explaining this?
motionplan/planManager.go
Outdated
seed []referenceframe.Input, | ||
opt *plannerOptions, | ||
) ([][]referenceframe.Input, error) { | ||
return nil, nil |
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.
This is TBD i take it? Maybe should remove this until we're ready to write it so its not sitting here returning nils
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.
This is unused and unneeded; surprised no one noticed before now. Deleting.
a99bd55
to
9a58069
Compare
|
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.
LGTM, I left a couple more minor nits but want to give the green checkmark so I don't block this from merging. Nice job!
@@ -209,12 +233,14 @@ func (mp *rrtStarConnectMotionPlanner) extend(algOpts *rrtStarConnectOptions, tr | |||
if cost < minCost && mp.checkPath(algOpts.planOpts, neighborNode.Q(), target) { | |||
minIndex = i | |||
minCost = cost | |||
break |
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.
sweet. Can you add a comment explaining this?
Firstly, this comes with a significant speed boost, solving most motion path problems in under 1/3 the time.
Secondly, this simplifies the amount of motion planning that is surfaced to the rest of RDK. All structs, algorithms, etc are now private. Instead, helper functions in
motionPlanner.go
are now the Official, and indeed only, way to get motion steps for your component. Arms, etc have been updated to use these functions.