In [1]:
import sys
from explauto.utils import rand_bounds
sys.path.append('../')

from cogsci2017.environment.arm_diva_env import CogSci2017Environment


env = CogSci2017Environment()


# Motor Babbling

for i in range(100):
    m = env.motor_babbling()
    #print "m", m
    print i
    print "formants:", env.formants
    print "vowel:", env.vowel
    s = env.update(m)
    #print "s", s


0
formants: None
vowel: None
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-21b281a9e8f8> in <module>()
     17     print "formants:", env.formants
     18     print "vowel:", env.vowel
---> 19     s = env.update(m)
     20     #print "s", s

/home/seb/scm/Flowers/explauto/explauto/environment/environment.pyc in update(self, m_ag, reset, log)
     91             self.reset()
     92         if len(array(m_ag).shape) == 1:
---> 93             s = self.one_update(m_ag, log)
     94         else:
     95             s = []

/home/seb/scm/Flowers/explauto/explauto/environment/environment.pyc in one_update(self, m_ag, log)
     68     def one_update(self, m_ag, log=True):
     69         m_env = self.compute_motor_command(m_ag)
---> 70         s = self.compute_sensori_effect(m_env)
     71 
     72         if log:

/home/seb/scm/Flowers/CogSci2017/src/environment/arm_diva_env.py in compute_sensori_effect(self, m)
    198 
    199         if self.arm.gui:
--> 200             self.plot()
    201 
    202         return self.current_context + self.hand + self.tool + self.toy1 + self.toy2 + self.toy3 + self.sound

TypeError: plot() takes exactly 4 arguments (1 given)

In [6]:
import numpy as np
sound_o = list(np.log2([500, 900]))
sound_y = list(np.log2([300, 1700]))
sound_u = list(np.log2([300, 800]))
sound_e = list(np.log2([600, 1700]))

print "o:", sound_o
print "y:", sound_y
print "u:", sound_u
print "e:", sound_e


o: [8.965784284662087, 9.8137811912170374]
y: [8.2288186904958813, 10.731319031025064]
u: [8.2288186904958813, 9.6438561897747253]
e: [9.2288186904958813, 10.731319031025064]