예제 #1
0
    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
예제 #2
0
    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)
예제 #3
0
파일: object.py 프로젝트: zhangkehua/PyRep
    def get_name(self) -> str:
        """Gets the objects name in the scene.

        :return: The objects name.
        """
        return vrep.simGetObjectName(self._handle)
예제 #4
0
파일: object.py 프로젝트: zhangkehua/PyRep
    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) != ''