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

Compute the rollouts state costs in parallel using OpenMP. #59

Open
wants to merge 2 commits into
base: kinetic-devel
Choose a base branch
from

Conversation

Levi-Armstrong
Copy link
Contributor

No description provided.

@jrgnicho
Copy link
Contributor

jrgnicho commented Mar 5, 2018

Is it still possible to cancel out of an ongoing planning computation?

@Levi-Armstrong
Copy link
Contributor Author

I am not sure.

@davetcoleman
Copy link
Collaborator

This looks like a great optimization contribution, can it be wrapped?

@raghavendersahdev is trying to migrate more stomp integration into the main moveit and we want to port the stomp_moveit plugin over

computeTwist(last_tool_pose,tool_goal_pose_,dof_nullity_,tool_twist_error);

double pos_error = tool_twist_error.segment(0,3).norm();
double orientation_error = tool_twist_error.segment(3,3).norm();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original members that these local variables (pos_error and orientation_error) replace were initialized from yaml through ros parameters. These local variable values are never set and so the result is probably incorrect

for(auto r = 0u ; r < config_.num_rollouts; r++)
{
if(!proceed_)
if(proceed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proceed variable is never changed and so there is no point in checking it. The original code changed the proceed_ atomic boolean member from outside the function so that the optimization could be stopped upon user request. This change won't allow to cancel out of an ongoing plan.

@@ -109,7 +109,7 @@ class StompCostFunction
int iteration_number,
int rollout_number,
Eigen::VectorXd& costs,
bool& validity) = 0 ;
bool& validity) const = 0 ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too bad OpenMP requires using const functions, this doesn't allow the use of class members and in this case a couple of public interface methods need to be modified.

{0 , 0 , 0 , 1 , 0 , 0 , 0 }, // position
{0 , 1/12.0 , -2/3.0 , 0 , 2/3.0 , -1/12.0 , 0 }, // velocity
{0 , -1/12.0 , 16/12.0 , -30/12.0 , 16/12.0 , -1/12.0 , 0 }, // acceleration (five point stencil)
{1/8.0, -1 , 13/8.0 , 0 , -13/8.0 , 1 , -1/8.0 } // jerk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that last row was so off! glad you caught that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still be applied, regardless of OpenMP right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@jrgnicho
Copy link
Contributor

I really welcome these changes, however OpenMP's coding rigidity seems to make it impossible to track a class member from within the parallelized methods, this means that it won't be possible to stop the planner while it's planning. Anyone knows any workarounds for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants