rafaelrojasmiliani/moveit_tutorial

Improve inverse kinematics to get first approach point

Opened this issue · 0 comments

  • Topic [09] Manipulatiion

  • Issue: The pose of the robot for the grasping changes randomly and provokes an unpredictable behaviors of the robot

  • Reason: The commit a2be2d8 of Moveit Noetic has an error in its manipulation package. The error is in the first point computed by the grasping here, here the variable token_state was generated by a constrained sampler. Because the constraints are generated here, i.e. from the complete pose of the arm-group, this can be perfeclty substituted by an inverse kinmatics

  • Solution:
    Change

-      if (plan->goal_sampler_->sample(*token_state, plan->shared_data_->max_goal_sampling_attempts_))
+      if (token_state->setFromIK(plan->shared_data_->planning_group_, pose_eigen, 10.0))

And the following diff

--- a/moveit_ros/manipulation/CMakeLists.txt
+++ b/moveit_ros/manipulation/CMakeLists.txt
@@ -22,6 +22,7 @@ find_package(catkin REQUIRED COMPONENTS
   tf2_eigen
   pluginlib
   actionlib
+  eigen_conversions
 )
 find_package(Eigen3 REQUIRED)
 find_package(Boost REQUIRED thread system filesystem date_time program_options)
@@ -41,6 +42,8 @@ catkin_package(
     moveit_msgs
     moveit_ros_planning
     roscpp
+    tf2_eigen
+    eigen_conversions
   DEPENDS
     EIGEN3
 )
diff --git a/moveit_ros/manipulation/package.xml b/moveit_ros/manipulation/package.xml
index bfe97f7ad..d30f88c5a 100644
--- a/moveit_ros/manipulation/package.xml
+++ b/moveit_ros/manipulation/package.xml
@@ -27,6 +27,7 @@
   <depend>roscpp</depend>
   <depend>rosconsole</depend>
   <depend>tf2_eigen</depend>
+  <depend>eigen_conversions</depend>
   <depend version_gte="1.11.2">pluginlib</depend>
 
   <build_depend>eigen</build_depend>

In other words, add eigen_conversions dependency.