Skip to content

Commit

Permalink
🐛 Fix: handling an edge case that makes the object position to be on …
Browse files Browse the repository at this point in the history
…the camera sometimes.
  • Loading branch information
igormaurell committed Nov 13, 2024
1 parent ac5127e commit 1375c15
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def __detectionDescriptionProcessing(self, data, description2d, header):

if center_depth <= 0:
rospy.logwarn('INVALID DEPTH VALUE')
return None

center_depth/= 1000.

Expand Down Expand Up @@ -311,7 +312,9 @@ def __instanceSegmentationDescriptionProcessing(self, source_data, description2d
return None

def __poseDescriptionProcessing(self, data, description2d : Description2D, header):
description3d : Description3D = self.__detectionDescriptionProcessing(data, description2d ,header)
description3d = self.__detectionDescriptionProcessing(data, description2d ,header)
if description3d is None:
return None

if 'image_depth' in data and 'camera_info' in data:
image_depth = data['image_depth']
Expand Down Expand Up @@ -357,9 +360,10 @@ def __poseDescriptionProcessing(self, data, description2d : Description2D, heade

def __createDescription3D(self, source_data, description2d : Description2D, header):
if description2d.type in self.DESCRIPTION_PROCESSING_ALGORITHMS:
description3D : Description3D = self.DESCRIPTION_PROCESSING_ALGORITHMS[description2d.type](source_data, description2d, header)
description3D.bbox2D = description2d.bbox
description3D.class_num = description2d.class_num
description3D = self.DESCRIPTION_PROCESSING_ALGORITHMS[description2d.type](source_data, description2d, header)
if description3D is not None:
description3D.bbox2D = description2d.bbox
description3D.class_num = description2d.class_num
return description3D
else:
return None
Expand Down

0 comments on commit 1375c15

Please sign in to comment.