I'm still confused about the reasons that could make Moveit failing to plan.
I use Baxter with the electric gripper and a simplified collision model of the gripper containing 3 cylinders. Let's assume I've reached a cylinder collision_object1 and want now to reach collision_object2 20 cm away.
On the enclosed capture you see the visual of the gripper with co1 "inside" (inside but not really to avoid problems...) corresponding to the starting state. The goal state corresponds to the grasp of the second collision object. Moveit founds a solution but this solution is almost a linear trajectory so it will fail because the gripper collides with both co1 and co2 along its path. On the capture you also see a well-chosen step of the planned path shown in loop in Moveit, where the collision model of the gripper collides indisputably with the cylinder co1. And iIndeed Moveit complains because the computed path is invalid:
[ INFO] [1409735129.647093022, 9991.697000000]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1409735129.647180470, 9991.697000000]: Starting state is just outside bounds (joint 'right_s1'). Assuming within bounds.
[ INFO] [1409735129.666577012, 9991.716000000]: No planner specified. Using default.
[ INFO] [1409735129.666764683, 9991.716000000]: LBKPIECE1: Attempting to use default projection.
[ INFO] [1409735129.673802766, 9991.721000000]: LBKPIECE1: Starting with 1 states
[ INFO] [1409735132.262129865, 9994.200000000]: LBKPIECE1: Created 104 (31 start + 73 goal) states in 87 cells (27 start (27 on boundary) + 60 goal (60 on boundary))
[ INFO] [1409735132.262226533, 9994.200000000]: Solution found in 2.595382 seconds
[ INFO] [1409735132.268185064, 9994.206000000]: Path simplification took 0.005870 seconds
[ INFO] [1409735132.268866125, 9994.207000000]: Planning adapters have added states at index positions: [ 0 ]
[ERROR] [1409735132.313300629, 9994.251000000]: Computed path is not valid. Invalid states at index locations: [ 2 3 4 8 ] out of 11. Explanations follow in command line. Contacts are published on /move_group/display_contacts
[ INFO] [1409735132.315719223, 9994.253000000]: Found a contact between 'collision_object1' (type 'Object') and 'right_gripper_r_finger' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
[ INFO] [1409735132.315773983, 9994.253000000]: Collision checking is considered complete (collision was found and 0 contacts are stored)
[ INFO] [1409735132.321978488, 9994.259000000]: Found a contact between 'collision_object1' (type 'Object') and 'right_gripper_r_finger' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
[ INFO] [1409735132.322057903, 9994.259000000]: Collision checking is considered complete (collision was found and 0 contacts are stored)
[ INFO] [1409735132.329804726, 9994.267000000]: Found a contact between 'collision_object1' (type 'Object') and 'right_gripper_r_finger' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
[ INFO] [1409735132.329910988, 9994.267000000]: Collision checking is considered complete (collision was found and 0 contacts are stored)
[ INFO] [1409735132.339982659, 9994.276000000]: Found a contact between 'collision_object2' (type 'Object') and 'right_gripper_l_finger' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
[ INFO] [1409735132.340073949, 9994.277000000]: Collision checking is considered complete (collision was found and 0 contacts are stored)
[ERROR] [1409735132.345946218, 9994.282000000]: Completed listing of explanations for invalid states.
I ask a tolerence of 0.005 in position, 0.01 in orientation, 0.005 for the joints. I don't understand why it would fail. I guess the best collision-free motion is to move the gripper back to leave co1 free before continuing. Anyway the planned path shown in RViz is almost a direct translation, so indeed the gripper collides with co1 and co2. Thus if there is a collision.... let's try another path! I would especially like to understand why the planner finds a "solution" in a short time (2 seconds over 15 allowed)... and then gives up because it's invalid.
I've changed the kinematics parameters more or less randomly (a higher kinematics_solver_attempts with a higher/lower timeout) without real change, here is my current config:
Any help or clue about these issues? What parameters should I tune? Why does not Moveit jump to another solution if it finds collisions?