Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Fastest way to detect collisions


In one of our simulations, we are trying to detect collisions between the robot's tool and an object in the cell. Our trajectories have around 15 000 points.

My code is below. What would be the fastest way to detect collisions? Right now I am getting about 1.2 seconds per joint move. (see timer below). Note that rendering is unnecessary for us.

Am I missing something? In particular, how can I entirely disable rendering? RDK.Render(False) doesn't seem to change anything. I have tried unchecking "Always display robot at the end of each movement"in Tools > Options > Motion, but that did not change anything. Note that the collision map is also configured correctly, and that only the relevant objects are checked.

RDK = robolink.Robolink()


robot = RDK.Item('KUKA KR 300 R2500 ultra')

for pose in poses: # list of points...
    start = timer()

       robot.MoveL(pose, blocking=True) # I have also tried MoveL_Test, but that seems to be even slower.

       collisions = RDK.Collisions()
       print('collisions: {0}'.format(collisions))

       end = timer()
       print(end - start) # about 1.2 seconds on average

You should use MoveL_Test to safely check for collisions. This will check collisions with the step defined in Tools-Options-Motion (4 mm and 4 deg step by default). If you use MoveL, you'll be checking collisions at the same speed you simulate (in your example you'll prevent rendering so you'll save some time compared to a manual simulation). Using MoveL, if you speed up simulation you script will finish earlier but you may be missing some collisions.

I recommend you to follow these tips to speed up collision checking:

The one that will help you the most is to simplify your geometry to prevent having rounded surfaces. You can simply use cubes or rectangles to do so or you can also simplify existing 3D models using a CAD software.
Hi Albert, 

Thanks for the rapid response.

I am now using MoveL_Test as you have recommended. However, it now takes even longer (around 7 seconds per linear move, which is unacceptable).

I have also tried setting the step to 10 mm rather than 4 mm, but that didn't change the time per cycle.

Any other ideas?

Hi David,
Collision checking takes time.
I recommend you to simplify geometries and simplify your collision map.

Users browsing this thread:
1 Guest(s)