Collision detection with octrees realized with python-fcl

263 views Asked by At

I want to finish the collision detection with point cloud represented by Octrees. With the python-fcl lib, I tried the following code snippet by myself

x = np.random.random([5, 3])
y = np.random.random([5, 3])

object1 = fcl.OcTree(0.1).insertPointCloud(points=x)
object2 = fcl.OcTree(0.1).insertPointCloud(points=y)

t1 = fcl.Transform()
o1 = fcl.CollisionObject(object1, t1)

t2 = fcl.Transform()
o2 = fcl.CollisionObject(object2, t2)

request = fcl.DistanceRequest()
result = fcl.DistanceResult()

ret = fcl.distance(object1, object2, request, result)

However, I got the error like this

File "src/fcl/fcl.pyx", line 140, in fcl.fcl.CollisionObject.__cinit__ValueError

So far, there are no other examples of octree with python-fcl, even in official document.

Has anyone converted the point cloud to an Octree and completed collision detection?

Help would be greatly appreciated!

1

There are 1 answers

2
sohi On

nah bro its something to do with your machine. try using replit.com for running your code or use jupyter notebooks. appreciate your code