-
Notifications
You must be signed in to change notification settings - Fork 695
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
WIP: Tutorial on using OMPL's Constrained State Space #518
base: master
Are you sure you want to change the base?
Conversation
The clang-format check fails for some C++ tutorials. (I used black for formatting Python code, I hope that's ok.) |
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 looks good except that creating another class here (ConstrainedPlanningTutorial) might confuse some readers, I would prefer not to have any new class. For example, move_group.plan() is more familiar for readers comparing to tutoial.solve() where they have to figure out what solve() function is here. Moreover, it (not creating any new classes for tutorials) would be more consistent with other parts of the MoveIt tutorial if I am not mistaken
doc/ompl_constrained_planning/scripts/ompl_constrained_planning_tutorial.py
Outdated
Show resolved
Hide resolved
@ommmid Thank you for the review!
I borrowed the approach with a class from the existing Python tutorial. But whenever they use the move_group, they add the following lines at the start of a method: # Copy class variables to local variables to make the web tutorials more clear.
# In practice, you should use the class variables directly unless you have a good
# reason not to.
move_group = self.move_group Is the The advantage of using a class is that it encapsulates variables that are used all over the place, such as the name of the end-effector link. This would otherwise be global variables and function input arguments whenever they are used. The class approach also better reflects how a user might program its own application in a structured way, maybe? But I will happily create a non-class version so we can compare the two. |
I removed the # Now we have everything we need to configure and solve a planning problem
move_group.set_start_state(start_state)
move_group.set_pose_target(pose_goal)
# Don't forget the path constraints! That's the whole point of this tutorial.
move_group.set_path_constraints(path_constraints)
# And let the planner find a solution.
# The move_group node should automatically visualize the solution in Rviz if a path is found.
move_group.plan()
# Clear the path constraints for our next experiment
move_group.clear_path_constraints() |
Just wanted to say I would really love to use all this constrained planning stuff! |
Hey @PeterMitrano, it is there in MoveIt2! (In a PR, waiting to be merged.) It even has a good tutorial already. Unfortunately one thing we've found so far -- you can only apply position constraints OR orientation constraints. Not both at the same time :( |
There's still work to do on the MoveIt and MoveIt2 patches for this. :)
|
Hey @JeroenDM Wondering if it is implemented and make it available in default ros moveit installation or do I need to build some branch from source? |
Yes, I am also trying to figure this out at the moment. Did you find an answer yet? |
I tried with cpp and it is kind of working ig. Although for the first time in my life it looked more difficult with python as i haven't figured it out yet 😆 |
Description
The tutorial that goes together with the pull request on the main MoveIt repo:
moveit/moveit#2273
Checklist