ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Thu, 13 Aug 2020 08:26:43 -0500better ways to calculate the cartesian path for move_grouphttps://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/ Hi all,
I wonder if there are better ways to calculate the cartesian path other than the `computeCartesianPath()` of move_group.
Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.
I think `computeCartesianPath()` does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type `moveit_msgs::RobotTrajectory`). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as `moveit_msgs::RobotTrajector`, seems a lot of work..
trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in https://bitbucket.org/traclabs/trac_ik/src/master/Wed, 12 Aug 2020 09:15:51 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/Comment by gvdhoorn for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359443#post-id-359443I'm not claiming you're wrong immediately. Afaict, in the end `setFromIK(..)` is used ([here](https://github.com/ros-planning/moveit/blob/7ad2bc7b86dad08061d98668ba34feba54bb05cc/moveit_core/robot_state/src/cartesian_interpolator.cpp#L163)), which ends up [here](https://github.com/ros-planning/moveit/blob/7ad2bc7b86dad08061d98668ba34feba54bb05cc/moveit_core/robot_state/src/robot_state.cpp#L1519-L1754). This can be passed a constraint callback I believe (in the `constraint` argument), but I'm not sure whether that ends up in/with the file you link to.
Perhaps @v4hn can add something here.Thu, 13 Aug 2020 08:26:43 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359443#post-id-359443Comment by xibeisiber for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359439#post-id-359439quote: "As far as I can tell, constraint samplers are not used in computeCartesianPath(..)."
Then I might be wrong, sorry for that. I thought `computeCartesianPath(..)` also uses it to solve ik of interpolation points.Thu, 13 Aug 2020 07:49:29 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359439#post-id-359439Comment by gvdhoorn for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359425#post-id-359425That would be [moveit_core/constraint_samplers/src/default_constraint_samplers.cpp; L414 to L506](https://github.com/ros-planning/moveit/blob/4ea1fcce1a24c7e6123092d84d4c0222544f13d7/moveit_core/constraint_samplers/src/default_constraint_samplers.cpp#L414-L506) in `ros-planning/moveit`.
Please try to always link to the Github repository.
As far as I can tell, constraint samplers are not used in `computeCartesianPath(..)`. Could you point to the lines in `computeCartesianPath(..)` which you believe are using the constraint sampler? Or any other place where it adds randomness?Thu, 13 Aug 2020 06:26:00 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359425#post-id-359425Comment by xibeisiber for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359420#post-id-359420one possible place in the code is [here](http://docs.ros.org/kinetic/api/moveit_core/html/default__constraint__samplers_8cpp_source.html). line 414-506. Not sure if other place also does that.Thu, 13 Aug 2020 05:59:14 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359420#post-id-359420Comment by gvdhoorn for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359419#post-id-359419It would still be good if you could link to the code.Thu, 13 Aug 2020 05:54:00 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359419#post-id-359419Comment by xibeisiber for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359416#post-id-359416Sorry, I didn't state it very clearly. I mean when moveit tries to get the ik solution of these interpolation points, it passes these points plus a random noise within tolerance, rather than pass the exact interpolation points to the iksolver. Like I posted [here](https://answers.ros.org/question/358467/goal-tolerance-of-move_group-and-tolerance-of-ik/).Thu, 13 Aug 2020 05:48:24 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359416#post-id-359416Comment by gvdhoorn for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359399#post-id-359399> Instead of letting move_group pass random samples of target pose within tolerance to the ik solver
Could you point to where you believe this is happening? IIUC, `computeCartesianPath(..)` uses linear interpolation with [slerp](https://en.wikipedia.org/wiki/Slerp) between two poses with a given step-size.
I'm not aware of it doing anything "random".Thu, 13 Aug 2020 02:54:47 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359399#post-id-359399Answer by achille for <p>Hi all,</p>
<p>I wonder if there are better ways to calculate the cartesian path other than the <code>computeCartesianPath()</code> of move_group.</p>
<p>Instead of letting move_group pass random samples of target pose within tolerance to the ik solver, now I call the ik solver directly, which can increase the efficiency of finding solutions.</p>
<p>I think <code>computeCartesianPath()</code> does the same trick, i.e. passing random samples of target pose to ik solver, right? But it seems this function also does other things like calculating the velocity, finally generating a trajectory (type <code>moveit_msgs::RobotTrajectory</code>). Therefore if I call the ik solver directly here, I also need to calculate the velocity and enclose them as <code>moveit_msgs::RobotTrajector</code>, seems a lot of work..</p>
<p>trac_ik seems to have a cartesian path planner, but I can't find the source code of this part in <a href="https://bitbucket.org/traclabs/trac_ik/src/master/">https://bitbucket.org/traclabs/trac_i...</a></p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?answer=359366#post-id-359366If you have access to the analytical IK solutions, I recommend [Descartes](http://wiki.ros.org/descartes), which builds a grid and searches it. Otherwise, I've seen people roll their own. That typically depends on the robot and the complexity of the cartesian paths.Wed, 12 Aug 2020 15:45:59 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?answer=359366#post-id-359366Comment by xibeisiber for <p>If you have access to the analytical IK solutions, I recommend <a href="http://wiki.ros.org/descartes">Descartes</a>, which builds a grid and searches it. Otherwise, I've seen people roll their own. That typically depends on the robot and the complexity of the cartesian paths.</p>
https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359394#post-id-359394thanks! I will check this.Thu, 13 Aug 2020 01:43:10 -0500https://answers.ros.org/question/359338/better-ways-to-calculate-the-cartesian-path-for-move_group/?comment=359394#post-id-359394