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

Fastest way to detect collisions

#1
Hi,

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 around15 000points.


My code is below.What would be the fastest way to detect collisions?现在我得到约1.2秒onds 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.

Code:
RDK = robolink.Robolink()
RDK.setCollisionActive(True)
RDK.setSimulationSpeed(500)

RDK.Render(False)

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

Thanks!
#2
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:
//www.sinclairbody.com/doc/en/Collision-Avoi...isionCheck

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.
#3
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?

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




Users browsing this thread:
1 Guest(s)