Skip to content
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

tool to generate constraint approximation databases #1253

Merged
merged 4 commits into from Dec 21, 2018

Conversation

Projects
None yet
3 participants
@v4hn
Copy link
Member

v4hn commented Dec 10, 2018

This feature was on my todo list for quite some time now.
MoveIt provides some C++ demo code to generate constraint approximations.
These can be used for constraint path planning.
The demo is all hard-coded though and users had to copy&paste the code for their own use case.

This pull-request provides a way to describe constraints on the parameter server and applies the feature to configure a generic tool to generate the databases.

I'm open to change & move parts of this code if someone has a better proposal for where things should go.

Please look at the individual commits for more details.

v4hn added some commits Dec 10, 2018

OpenMP is required
The flags are never checked anyway below, so it does not build
without OpenMP at the moment.

@v4hn v4hn requested a review from mlautman Dec 10, 2018

@rhaschke
Copy link
Contributor

rhaschke left a comment

I like this. Some minor comments. Is there a tutorial that should be updated?

@v4hn

This comment has been minimized.

Copy link
Member Author

v4hn commented Dec 12, 2018

I plan to extend the constraint manifold tutorial once I got an approval on the current design.

I'm not sure where to document the structure for the constructConstraints function best, or whether it needs to be documented explicitly when the manifold-tutorial gives examples already.
Maybe it makes sense to add a link in the function's doxygen documentation?

Thanks for the feedback, I will address it later this week.

@v4hn

This comment has been minimized.

Copy link
Member Author

v4hn commented Dec 16, 2018

@rhaschke @mlautman I addressed all feedback. Please have another look.

@mlautman Personally, I prefer in-place nh.param calls over parameter structs in such small programs, but I switched to a struct here.

@rhaschke
Copy link
Contributor

rhaschke left a comment

Factoring out the parsing functions already improved readability a lot.
Please re-consider the remaining comment.

Show resolved Hide resolved moveit_core/kinematic_constraints/src/utils.cpp Outdated
Show resolved Hide resolved moveit_core/kinematic_constraints/src/utils.cpp Outdated
@rhaschke

This comment has been minimized.

Copy link
Contributor

rhaschke commented Dec 19, 2018

@v4hn Do you want to squash the cleanup commits into the first 4 commits?

@v4hn

This comment has been minimized.

Copy link
Member Author

v4hn commented Dec 21, 2018

I will clean up the commit history and merge.

v4hn added some commits Dec 10, 2018

helper function to define Constraints on the parameter server
In some situations, it makes sense to define Constraints
via ros parameters to ease configuration or circumvent
repeated definitions.

A constraint can constructed from ROS parameters with the following
structure:

path_constraint:
  name: tool0_upright
  constraints:
  - type: orientation
    frame_id: world
    link_name: tool0
    orientation: [0, 0, 0]
    tolerances: [0.01, 0.01, 3.15]
    weight: 1.0
  - type: joint
    joint_name: pan_joint
    position: 0.0
    tolerance: 1.0
    weight: 1.0
  - type: position
    frame_id: world
    link_name: tool0
    target_offset: [.5,0,1.0]
    region:
      x: [0,2]
      y: [-2,2]
      z: [.5,2.5]
Provide a tool to generate arbitrary constraint db
Previously, we only shipped a demo_construct_state_database.cpp
that hard-coded all parameters for a specific setup.

This work generalizes the code and provides a utility that
can be configured via ROS parameters.

Assuming a MoveIt configuration is running,
an example launch file to use the utility might look like this:

<launch>
  <node name="generate_state_database" pkg="moveit_planners_ompl" type="generate_state_database" output="screen">
    <param name="use_current_scene" value="false"/>
    <param name="planning_group" value="arm"/>
    <remap from="~output_folder" to="move_group/constraint_approximations_path"/>

<rosparam ns="constraints">
path_constraint:
  name: tool0_upright
  constraints:
  - type: orientation
    frame_id: world
    link_name: tool0
    orientation: [0, 0, 0]
    tolerances: [0.01, 0.01, 3.15]
    weight: 1.0
</rosparam>

  </node>
</launch>

@v4hn v4hn force-pushed the v4hn:pr-kinetic-generate-state-db branch from d59e151 to b08abe1 Dec 21, 2018

@v4hn v4hn merged commit b08abe1 into ros-planning:kinetic-devel Dec 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@v4hn

This comment has been minimized.

Copy link
Member Author

v4hn commented Dec 21, 2018

merged I'll try to get around to add the tutorial soon.

@davetcoleman davetcoleman referenced this pull request Dec 21, 2018

Open

Migrate moveit_tutorials into main moveit repo #1284

0 of 4 tasks complete

rhaschke added a commit that referenced this pull request Dec 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.