MoveIt path planning occasionally going through obstacle
Hello community,
My setup: ROS Melodic, MoveIt, Ubuntu 18.04.5 LTS (Kernel: Linux 5.4.0-62-generic, Architecture: x86-64), Python 2.7.
I am creating a pick 'n place application using a UR3 robot with attached gripper. I am using the move_group_python_interface to set up the scene (using moveit_commander.PlanningSceneInterface()) and control the robot arm (using moveit_commander.RobotCommander()). Everything was initially setup as per this tutorial. I then built up my application from there.
I am using the OMPL with RRTConnect planner and default settings, except longest_valid_segment_fraction = 0.001. I am allowing Replanning, and have planning attempts set to 8.
After adding all my objects to the scene, including a box with objects to be pick'd 'n place'd, I then begin commanding the robot. So far so good, the robot moves the objects around and avoids bumping into anything. I added some walls and the robot successfully avoids them with the help of the path planner. However, occasionally, the robot will grab an object and move straight through the box. The object and the gripper collide with the box. This is an object that on previous runs was successfully moved. I estimate this occurs 1 in 20 maybe even 1 in 30 times. So not very often, but it is, of course, a catastrophic failure.
I would be very grateful, if anyone could please recommend a few things I could try to eliminate this issue. As per the above linked tutorial, every time I add an object, attach, detach, etc, I call self.wait_for_state_update
. So I'd like to think the robot is "aware" of the current state of the scene and all objects.
Thanks in advance.
I'm guessing that the box you describe has not been added to the collision space properly. There should be Python function to check for this, but I have never used the MoveIt Python interface. Regardless, if you can get a repeatable error, post a link to your library and we can assist you better.