-
Notifications
You must be signed in to change notification settings - Fork 957
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
Constraints Library Refactor #1428
Constraints Library Refactor #1428
Conversation
9d25f40
to
d161b1e
Compare
Fun fact: the new draft PR feature (https://help.github.com/en/articles/about-pull-requests#draft-pull-requests) apparently doesn't trigger Travis or notify |
Friendly ping (not sure if email notifications got sent out at all) @davetcoleman @v4hn |
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 tested this with the current panda setup and a simple orientation constraint (gripper downwards).
Normal planning seems to work fine in general. I noticed that sometimes plans are also generated if the start state does not satisfy the constraints. Looking at the changes I'm not sure if this is a new issue.
Also constructing constraints does not work for me. Even after filling the MotionPlanRequest parameters (inside generate_state_database.cpp
) the ConstraintsLibrary always crashes with a segfault.
...it_planners/ompl/ompl_interface/include/moveit/ompl_interface/model_based_planning_context.h
Outdated
Show resolved
Hide resolved
Thanks for the feedback @henningkayser. How did you go about trying to generate the Constraints library? I didn't see it documented anywhere, and haven't had the time to dive into what format the constraints parameter to |
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.
Given your goal to isolate the MBPC structure, this seems reasonable.
At least it is somewhat cleaner than the previous implementation. :-)
I didn't see it documented anywhere, and haven't had the time to dive into what format the constraints parameter to generate_state_database.cpp needs to be to test things.
Yes, that's my fault. :-/
I did not manage to write the tutorial (until now?) due to time constraints.
Dave scolded me for that before...
There are rather verbose commit messages though with a full example. :)
783cf74 3fc0789
I can't approve this because I did not have the time to test it.
I hope you and @henningkayser get around to fix this up in the close future.
ompl_interface.getConstraintsLibrary().addConstraintApproximation(params.constraints, params.planning_group, | ||
scene, params.construction_opts); | ||
context->getConstraintsLibrary()->addConstraintApproximation(params.constraints, params.planning_group, scene, | ||
params.construction_opts); |
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.
Specifying the constraints, planning group and scene here again feels weird when the context could/should already know them.
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.
That's fair, but I can't see another way to pass those along to the constraints library without some weird state being used behind the scenes.
@v4hn Thanks for pointing out the commit messages! Those are just enough, I had just never thought to look there. :) |
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.
Looks good, thanks!!
moveit_planners/ompl/ompl_interface/demos/generate_state_database.cpp
Outdated
Show resolved
Hide resolved
...it_planners/ompl/ompl_interface/include/moveit/ompl_interface/model_based_planning_context.h
Outdated
Show resolved
Hide resolved
moveit_planners/ompl/ompl_interface/src/detail/constraints_library.cpp
Outdated
Show resolved
Hide resolved
moveit_planners/ompl/ompl_interface/src/detail/constraints_library.cpp
Outdated
Show resolved
Hide resolved
moveit_planners/ompl/ompl_interface/src/model_based_planning_context.cpp
Outdated
Show resolved
Hide resolved
@ommmid has been creating a new PlanningContext plugin for TrajOpt + MoveIt, and would make a good reviewer for this PR. |
ping @BryceStevenWilley could you address my requested changes? |
Thanks for the ping Dave, this has been on my plate for a while, but I think I can address your comments by this weekend. |
Don't have access to a machine that can build MoveIt right now, will probably need another few days to test. |
9e65649
to
f6f7b8f
Compare
Sorry for the wait, finally had time to test and finish up the generate state database script. Also added some of @v4hn's comments from commits into actual launch files and in code comments. |
@henningkayser could you give this a second review? fyi @mamoll |
In preparation to a larger change that moves much of the context initialization internal to the ModelBasedPlanningContext as well.
Also added launch file for ease of use.
f6f7b8f
to
d503692
Compare
|
||
const PlanningContextManager& context_manager_; | ||
ModelBasedPlanningContext* context_; |
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 understand that context_ can't be const, but why can't it be a reference rather than a raw pointer? Why not use a shared_ptr if a reference is not possible?
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 believe because we are now constructing the constraints library from inside the ModelBasedPlanningContext, with a call to this (a9e91ab#diff-d949b241fc2b4781b617fdb53844ece5R85). Since this
is naturally a raw pointer, I just kept it like that, and am a little hesitant to try to convert this
to a reference or a shared pointer.
Passing Travis, and 2 reviews, in it goes! |
I believe this PR introduced regressions. Loading a constraint database now results in
|
Continuation of #897 in smaller bits, starting with the constraint library.
In order to make an OMPL plugin framework, the
ModelBasedPlanningContext
(MBPC) has to be able to be initialized by a plugin (i.e. we can no longer directly pass it the OMPL state space, simple setup, etc.), meaning that the leaky interface between the MBPC and theOMPLPlannerManager
needs to be cleaned up, starting with the constraints library.This change moves the constraints library internal to the MBPC, so it can separately load the constraint library and add its interpolation function to the OMPL state space being used.
Additionally, this removes an unused OMPL service, as mentioned here.
Much of the documentation/tutorial updates will happen later, as there are still many changes to come including:
Checklist