Only cast rays that intersect with the bbox

This commit is contained in:
Michel Breyer
2021-08-16 15:33:52 +02:00
parent 6da198a5bf
commit 4b4d54240b
3 changed files with 60 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
import itertools
import numpy as np
import active_grasp.msg
@@ -9,6 +10,10 @@ class AABBox:
self.min = bbox_min
self.max = bbox_max
@property
def corners(self):
return list(itertools.product(*np.vstack((self.min, self.max)).T))
def is_inside(self, p):
return np.all(p > self.min) and np.all(p < self.max)