ObjectInspect

class grid.model.navigation.objectinspection.ObjectInspect(*args, **kwargs)

objection inspection model

__init__()
Return type:

None

inspect_object(seg_mask, depth_image, depth_camera_param, suface_normals_image=None)

plant points near object surface for inspection of the object which is delineated by the segmenation mask

Parameters:
  • seg_mask (np.ndarray) -- boolean np.array shape (H, W, 1)

  • depth_image (np.ndarray) -- shape (H, W, 1)

  • depth_camera_param (dict) -- parameters of camera that take the depth image

  • suface_normals_image (Optional[np.ndarray]) -- surface normals of the object, shape (H, W, 3)

Returns:

Optional[np.ndarray]: inspection poses near the object surface, shape (N, 6), (x, y, z, pitch, roll, yaw) in meters and degrees Optional[np.ndarray]: nextview pose for inspection on different side, shape (6,) (x,y,z, pitch, roll, yaw) in meters and degrees

Return type:

Tuple[Optional[np.ndarray], Optional[np.ndarray]]

Example

>>> inspect_pose, nextview_pose = self.inspect_object(depth_image, depth_camera_param, "turbine")
>>> if inspect_poses is not None:
>>>     for i, pose in enumerate(inspect_poses):
>>>         # pose: (x, y, z, pitch, roll, yaw) in meters and degrees
>>>         drone.moveToPosition(pose[0], pose[1], pose[2])
>>>         drone.setYaw(poses[5])
>>>     # inspect nextview
>>>     if nextview_pose is not None:
>>>     drone.moveToPosition(nextview_pose[0], nextview_pose[1], nextview_pose[2])
>>>     drone.setYaw(nextview_pose[5])