Exemple #1
0
    def __init__(self,
                 renderer=True,
                 realtime=False,
                 ip="127.0.0.1",
                 port="21590",
                 buf='16384'):
        ODEEnvironment.__init__(self, renderer, realtime, ip, port, buf)
        # load model file
        self.loadXODE(
            imp.find_module('pybrain')[1] +
            "/rl/environments/ode/models/johnnie.xode")

        # standard sensors and actuators
        self.addSensor(sensors.JointSensor())
        self.addSensor(sensors.JointVelocitySensor())
        self.addActuator(actuators.JointActuator())

        #set act- and obsLength, the min/max angles and the relative max touques of the joints
        self.actLen = self.getActionLength()
        self.obsLen = len(self.getSensors())
        #ArmLeft, ArmRight, Hip, PevelLeft, PevelRight, TibiaLeft, TibiaRight, KneeLeft, KneeRight, FootLeft, FootRight
        self.tourqueList = array(
            [0.2, 0.2, 0.2, 0.5, 0.5, 2.0, 2.0, 2.0, 2.0, 0.5, 0.5], )
        self.cHighList = array(
            [1.0, 1.0, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 0.25, 0.25], )
        self.cLowList = array(
            [-0.5, -0.5, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.25, -0.25], )

        self.stepsPerAction = 1
Exemple #2
0
    def __init__(self, xodeFile="./pa10.xode", renderer=True, realtime=True, ip="127.0.0.1", port="21590", buf='16384'):
        ODEEnvironment.__init__(self, renderer, realtime, ip, port, buf)

        # Load model file
        self.loadXODE(xodeFile)

        # Set the gravity to 0. The network can learn much easier without the
        # force of gravity to counteract
        gravity = 0.0
        self.setGravity(gravity)

        # Environment coefficient of friction
        self.FricMu = 8.0

        # Real-world time for each time step
        self.dt = 0.005

        # Number of steps time steps to simulate for each call to performAction()
        self.stepsPerAction = 1

        # Add PA10 sensors
        self.addSensor(sensors.JointSensor())
        self.addSensor(sensors.JointVelocitySensor())
        self.addSensor(sensors.SpecificBodyPositionSensor(['pa10_t2'], 'tooltipPos'))

        # Add PA10 actuators
        self.addActuator(actuators.JointActuator())

        # Reset number of actuators and sensors (observers)
        self.actLen = self.indim
        self.obsLen = self.outdim

        return
Exemple #3
0
    def __init__(self, renderer=True, realtime=False, ip="127.0.0.1", port="21590", buf='16384'):
        ODEEnvironment.__init__(self, renderer, realtime, ip, port, buf)
        # load model file
        self.loadXODE("models/tetra2.xode")

        # standard sensors and actuators
        self.addSensor(sensors.JointSensor())
        self.addSensor(sensors.JointVelocitySensor())
        self.addActuator(actuators.JointActuator())

        #set act- and obsLength, the min/max angles and the relative max touques of the joints
        self.actLen = self.indim
        self.obsLen = len(self.getSensors())
        # frontAxis, frontLeftLeg, frontRightLeg, rearAxis, rearLeftLeg, rearRightLeg
        self.tourqueList = array([6.0, 1.0, 1.0, 6.0, 1.0, 1.0])
        self.cHighList = array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
        self.cLowList = array([-1.0, -1.0, -1.0, -1.0, -1.0, -1.0])

        self.stepsPerAction = 1
Exemple #4
0
    def __init__(self,
                 renderer=True,
                 realtime=True,
                 ip="127.0.0.1",
                 port="21590",
                 buf='16384'):
        ODEEnvironment.__init__(self, renderer, realtime, ip, port, buf)
        # load model file
        self.loadXODE(
            imp.find_module('pybrain')[1] +
            "/rl/environments/ode/models/acrobot.xode")

        # standard sensors and actuators
        self.addSensor(sensors.JointSensor())
        self.addSensor(sensors.JointVelocitySensor())
        self.addActuator(actuators.JointActuator())

        #set act- and obsLength, the min/max angles and the relative max touques of the joints
        self.actLen = self.indim
        self.obsLen = len(self.getSensors())

        self.stepsPerAction = 1