def get_object_name(self, sensor_handle): object_id = vrep.simReadVisionSensor(sensor_handle) if object_id[0] == 1: object_name = vrep.simGetObjectName(object_id[1][0]) else: object_name = "None" return object_name
def copy(self) -> 'RobotComponent': """Copy and pastes the arm in the scene. The arm is copied together with all its associated calculation objects and associated scripts. :return: The new pasted arm. """ # Copy whole model handle = vrep.simCopyPasteObjects([self._handle], 1)[0] name = vrep.simGetObjectName(handle) # Find the number of this arm num = name[name.rfind('#') + 1:] if len(num) > 0: num = int(num) + 1 else: num = 0 return self.__class__(num)
def get_name(self) -> str: """Gets the objects name in the scene. :return: The objects name. """ return vrep.simGetObjectName(self._handle)
def still_exists(self) -> bool: """Gets whether this object is still in the scene or not. :return: Whether the object exists or not. """ return vrep.simGetObjectName(self._handle) != ''