Performance: Upgrade BEPU V1.5.1 to V2.1 and parallelization

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
DanRei
Posts: 1
Joined: Tue Jan 07, 2020 8:53 am

Performance: Upgrade BEPU V1.5.1 to V2.1 and parallelization

Post by DanRei »

Hello Norbo,
At the moment we are using BEPU Physic V1.5.1 together with HelixToolkit 3D 2015.1.715 for visualization for the simulation of industrial robots in a production environment.

Here you can see a very simple Scene:
robot_table.JPG
robot_table.JPG (29.79 KiB) Viewed 10591 times
Here you can find a video as an example:
https://www.youtube.com/watch?v=x2-fyyBAv20

We are doing path planning for the robots. For the collision detection between the robots and the environment we are using convex hulls (one convex hull for each axis of the robot). During the path planning we have approximately 100 lists with possible paths. Each path contains approximately 1000 points. For collision detection we set the robot to each of the path-points and use BEPU to check for collisions . At the moment this is a sequential testing which is the bottle neck of our implementation.
At the moment we have two ideas to speed up our system:
1.) Upgrade BEPU V1.5.1 to V2.1: What is your estimation about the performance improvements of the convex hull collision detections for our application? Do you have a gut feeling of the speedup?
2.) Do have any hint how we could parallelize the collision detection. In theory it would be possible for the application to check each of these 100 lists with the 1000 path points at the same time.
Our idea for the parallelization is to initialize as many “Bepu Spaces” or “Bepu Simulations” as we have processor cores and distribute the path-points to all instances. Is this a good idea or could you recommend a better solution?

Thank you very much in advance!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Performance: Upgrade BEPU V1.5.1 to V2.1 and parallelization

Post by Norbo »

1.) Upgrade BEPU V1.5.1 to V2.1: What is your estimation about the performance improvements of the convex hull collision detections for our application? Do you have a gut feeling of the speedup?
Hull-hull testing is one of the areas of smaller improvement from v1 to v2, but on an AVX2 capable machine, it should still be around 4x faster in v2 than v1. It'll vary a bit depending on the shape and relative pose.
2.) Do have any hint how we could parallelize the collision detection. In theory it would be possible for the application to check each of these 100 lists with the 1000 path points at the same time.
Our idea for the parallelization is to initialize as many “Bepu Spaces” or “Bepu Simulations” as we have processor cores and distribute the path-points to all instances. Is this a good idea or could you recommend a better solution?
That's a reasonable and easy approach. If you directly provide all transforms, a full simulation timestep will have some unnecessary overhead (e.g. no need to do pose integration if you're doing all of it), but the bulk of the time will be spent in the collision testing anyway. So long as your number of paths matches or exceeds core counts, it'll get pretty close to optimal results.

Speeding things up further would involve manually dispatching pair bundles with the CollisionBatcher. The CollisionQueryDemo or BatchedCollisionTests would be useful as examples. Probably not worth doing unless you reaaaally need those last few percentage points.
Post Reply