In [5]:
import sys
from explauto.utils import rand_bounds
sys.path.append('../')
from play.environment.arm_diva_env import PlayEnvironment
%matplotlib inline
import matplotlib.pyplot as plt
env = PlayEnvironment(tau=0.5)
In [77]:
# Vocal BFS
bfs_shapes = env.diva.dmp.dmp.gen_psi(env.diva.dmp.dmp.cs.rollout())
plt.plot([list(reversed(l)) for l in bfs_shapes], lw=3)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.legend(["basis function 1", "basis function 2"], fontsize=16)
plt.xlabel("Timesteps", fontsize=16)
plt.ylabel("Power", fontsize=16)
plt.xticks(fontsize = 16)
plt.yticks(fontsize = 16)
Out[77]:
In [88]:
# Arm BFS
bfs_shapes = env.arm.motor_dmp.dmp.gen_psi(env.arm.motor_dmp.dmp.cs.rollout())
plt.plot([list(reversed(l)) for l in bfs_shapes], lw=3)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
frame = plt.legend(["bf1", "bf2", "bf3", "bf4",
"bf5", "bf6"], ncol=2, fontsize=14, loc="upper right")
plt.xlabel("Timesteps", fontsize=16)
plt.ylabel("Power", fontsize=16)
plt.xticks(fontsize = 16)
plt.yticks(fontsize = 16)
In [68]:
# Vocal DMP
for i in range(1):
m = env.motor_babbling(audio=True)
plt.plot(env.diva.trajectory(m[21:]), lw=3)
plt.legend(["art1", "art2", "art3", "art4", "art5", "art6", "art7"], ncol=2)
plt.ylim([-1., 1.])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel("Timesteps", fontsize=16)
plt.ylabel("Articulator position", fontsize=16)
plt.xticks(fontsize = 16)
plt.yticks(fontsize = 16)
Out[68]:
In [58]:
# Arm DMP
for i in range(1):
m = env.motor_babbling(arm=True)
plt.plot(env.arm.compute_traj(m[:21]), lw=3)
plt.legend(["joint1", "joint2", "joint3"], ncol=3)
plt.ylim([-1., 1.])
Out[58]:
In [ ]: