ethz-asl / vgn

Real-time 6 DOF grasp detection in clutter.
BSD 3-Clause "New" or "Revised" License
254 stars 55 forks source link

About the infinite loop in 'generate_data.py' #27

Open Jinbo-Zuo opened 1 year ago

Jinbo-Zuo commented 1 year ago

` while not ok:

TODO this could result in an infinite loop, though very unlikely

    idx = np.random.randint(len(points))
    point, normal = points[idx], normals[idx]
    ok = normal[2] > -0.1  # make sure the normal is poitning upwards

` I want to know why the infinite loop may happen? I found if I set object_count = 1, the infinite loop will happen easily, but if I set object_count as a little big number, the infinite loop won't happen. And I want to know how could I avoid the infinite loop by some engineering method?

Jinbo-Zuo commented 1 year ago

I tried to use 'break' to jump out the loop when the loop run enough. But I don't know if this way may cause any bad result ...