-
Notifications
You must be signed in to change notification settings - Fork 110
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
RSDK-8852 migrate motionplan to work on framesystems rather than individual frames #4559
base: main
Are you sure you want to change the base?
Conversation
…k-on-framesystems-rather-than-individual-frames
…k-on-framesystems-rather-than-individual-frames
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.
From a high level this makes sense. I think the biggest question is how we want to talk about Segment vs SegmentFS. I guess I'm leaning to having both now?
@@ -587,11 +566,13 @@ func NewEmptyConstraints() *Constraints { | |||
// NewConstraints initializes a Constraints object with user-defined LinearConstraint, OrientationConstraint, and CollisionSpecification. | |||
func NewConstraints( | |||
linConstraints []LinearConstraint, | |||
pseudoConstraints []PseudolinearConstraint, |
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.
Not a fan of adding this here. This should be just for the constraints we expose through proto. You can always append to the Constraints with custom constraints after the fact
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.
Fair, I think I did this as a quick one-off to get some tests working. Will update before final review
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.
Actually, not sure on this.
Since this is the structure we use for our own consumption and passing around of constraints and initialization of actual constraint functions, these structures should I think be the union of what we support in proto, and what we support via things like extra
. This allows us to better prototype what will eventually be added into proto. The alternative is creating a parallel data structure that we pass around to do the same thing, but which adds parameters, masks the putative new API, and makes it easier to forget things.
segmentConstraints map[string]SegmentConstraint | ||
segmentFSConstraints map[string]SegmentFSConstraint | ||
stateConstraints map[string]StateConstraint | ||
stateFSConstraints map[string]StateFSConstraint |
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.
Could consider making these interfaces to cut down on the need for duplication. But if the vision is we're moving away from the original versions then probably not necessary
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.
I think they would need to be generics, not just interfaces.
But yes this is a stepping stone towards the eventual removal of the originals
|
||
// linearizedFrameSystem wraps a framesystem, allowing conversion in a known order between a map[string][]inputs and a flat array of floats, | ||
// useful for being able to call IK solvers against framesystems. | ||
type linearizedFrameSystem struct { |
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.
Is this the solverframe code?
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.
No. This simply allows things to call nlopt, which requires a vector of floats.
What little code survives from solverFrame
, is now motionChain
…k-on-framesystems-rather-than-individual-frames
BoundingRegions []spatialmath.Geometry | ||
Constraints *Constraints | ||
Options map[string]interface{} | ||
allGoals PathStep // TODO: this should replace Goal and Frame |
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.
[q]: will this be capitalized in future work?
[q]: why not make this a slice in case there is are specific poses we would like to move through?
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.
It will indeed be eventually capitalized.
I don't think there's a need for this to take an array; when pre-planning is fully operational, calling pre-plans iteratively will yield the same result while giving the caller extra control.
This PR migrates
motionplan
to removesolverFrames
, and in general have all algorithms operate on entire framesystems rather than single frames.This allows new features such as enabling planning for multiple independent frames simultaneously, such as several arms moving near but independently from one another.
Most of the frame-specific motionplan functions and structures, such as constraints, now have a framesystem-specific counterpart.
The entire file for solver frames has been removed, and what little remains are now known as
motionChain
s, of which a planner may have many and which are used to inform which frames may move but do not limit planning. This PR does not change the external public Plan() function, and motion calls should continue to work the same way as they have, with few exceptions. An example of such an exception would be that since all components can now move, one may move out of the way of another if need be, something not possible before now.