Catch rare qhull errors
This commit is contained in:
parent
33d123e3ee
commit
3d7a8c8ba9
@ -161,12 +161,16 @@ class GraspController:
|
|||||||
tip = grasp.pose.apply([0.0, 0.0, 0.05])
|
tip = grasp.pose.apply([0.0, 0.0, 0.05])
|
||||||
for label in range(labels.max() + 1):
|
for label in range(labels.max() + 1):
|
||||||
segment = cloud.select_by_index(np.flatnonzero(labels == label))
|
segment = cloud.select_by_index(np.flatnonzero(labels == label))
|
||||||
hull = compute_convex_hull(segment)
|
try:
|
||||||
name = f"object_{label}"
|
hull = compute_convex_hull(segment)
|
||||||
self.add_collision_mesh(name, hull)
|
name = f"object_{label}"
|
||||||
dist = trimesh.proximity.closest_point_naive(hull, np.array([tip]))[1]
|
self.add_collision_mesh(name, hull)
|
||||||
if dist < min_dist:
|
dist = trimesh.proximity.closest_point_naive(hull, np.array([tip]))[1]
|
||||||
self.target_co_name, min_dist = name, dist
|
if dist < min_dist:
|
||||||
|
self.target_co_name, min_dist = name, dist
|
||||||
|
except:
|
||||||
|
# Qhull fails in some edge cases
|
||||||
|
pass
|
||||||
|
|
||||||
# Add collision object for the support
|
# Add collision object for the support
|
||||||
self.add_collision_mesh("support", compute_convex_hull(support_cloud))
|
self.add_collision_mesh("support", compute_convex_hull(support_cloud))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user