Esempio n. 1
0
    def __init__(self, robot_model, physics_client):
        """
        Constructor

        Parameters:
            robot_model - The pybullet model of the robot
            physics_client - The if of the simulated instance in which the
            robot is spawned
            frequency - If specified, the acquisition frequency of the sensor,
            in Hz
        """
        RobotModule.__init__(self, robot_model, physics_client)
        self.frequency = None
    def _clearInstance(self, physics_client):
        """
        INTERNAL METHOD, Called to kill the processes of modules running in a
        simulated instance, before resetting or stopping it.

        Parameters:
            physics_client - The client id of the simulated instance that will
            be cleared
        """
        Camera.ACTIVE_CAMERA_ID[physics_client] = -1

        for module in RobotModule._getInstances():
            if module.getPhysicsClientId() == physics_client:
                module._terminateModule()
Esempio n. 3
0
    def _clearInstance(self, physics_client):
        """
        INTERNAL METHOD, Called to kill the processes of modules running in a
        simulated instance, before resetting or stopping it.

        Parameters:
            physics_client - The client id of the simulated instance that will
            be cleared
        """
        for module in RobotModule._getInstances():
            if module.getPhysicsClientId() == physics_client:
                module._terminateModule()

        for camera in Camera._getCameraHandlesDict().values():
            if physics_client == camera.getPhysicsClientId():
                camera.unsubscribe()