Skip to content

Commit

Permalink
Stop robot if point cloud is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
hopkira committed Nov 20, 2022
1 parent 6223016 commit 85b79ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions k9_oak_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ def record_point_cloud(self,depth_image):
totals = self.bpc.populate_bins(depth_image)
focus = totals[0:7,10:15]
min_dist = float(np.nanmin(focus))
if min_dist:
if np.isnan(min_dist):
min_dist = 0.0
else:
min_dist = float(min_dist/1000.0)
mem.storeState("forward", min_dist)
mem.storeState("forward", min_dist)
# for each column in the array, find out the closest
# bin; as the robot cannot duck or jump, the
# y values are irrelevant
Expand Down

0 comments on commit 85b79ed

Please sign in to comment.