Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 3
0
    def get_name(self) -> str:
        """Gets the objects name in the scene.

        :return: The objects name.
        """
        return vrep.simGetObjectName(self._handle)
Ejemplo n.º 4
0
    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) != ''