def subtract_object(self, obj: Object, options: int = 0) -> None: """Subtract object from the octree. :param obj: Object to subtract. :param options: Object subtraction options. """ sim.simSubtractObjectFromOctree(self._handle, obj.get_handle(), options) return
def is_detected(self, obj: Object) -> bool: """Checks whether the proximity sensor detects the indicated object. :param obj: The object to detect. :return: Bool indicating if the object was detected. """ state, point = vrep.simCheckProximitySensor(self._handle, obj.get_handle()) return state == 1
def insert_object(self, obj: Object, color: Optional[float] = None, options: int = 0) -> None: """Inserts object into the octree. :param obj: Object to insert. :param color: A list containing RGB data, or None. :param options: Object insertion options. """ if color is not None: if not isinstance(color, list): raise ValueError( 'Octree.insert_object: color parameter not a list.') elif len(color) is not 3: raise ValueError( 'Octree.insert_object: color parameter not an RGB list.') sim.simInsertObjectIntoOctree(self._handle, obj.get_handle(), options, color, 0) return
def __init__(self, gripper: Gripper, object: Object): self._gripper = gripper self._object_handle = object.get_handle()