print("") print("ERROR: Executable '"+executable+"' does not exist.") print("Please call 'make install' in the build directory first.") print("") sys.exit(-1); # Call the executable with the directory to which results should be written directory = "/tmp/demoDmp" subprocess.call([executable, directory]) print("Plotting") fig = plt.figure(1) axs = [ fig.add_subplot(131), fig.add_subplot(132), fig.add_subplot(133) ] lines = plotTrajectoryFromFile(directory+"/demonstration_traj.txt",axs) plt.setp(lines, linestyle='-', linewidth=4, color=(0.8,0.8,0.8), label='demonstration') lines = plotTrajectoryFromFile(directory+"/reproduced_traj.txt",axs) plt.setp(lines, linestyle='--', linewidth=2, color=(0.0,0.0,0.5), label='reproduced') plt.legend() # Read data xs_xds = numpy.loadtxt(directory+'/reproduced_xs_xds.txt') forcing_terms = numpy.loadtxt(directory+'/reproduced_forcing_terms.txt') fa_output = numpy.loadtxt(directory+'/reproduced_fa_output.txt') fig = plt.figure(2) plotDmp(xs_xds,fig,forcing_terms,fa_output)
print "" print "ERROR: Executable '"+executable+"' does not exist." print "Please call 'make install' in the build directory first." print "" sys.exit(-1); # Call the executable with the directory to which results should be written directory = "/tmp/demoDmp" subprocess.call([executable, directory]) print "Plotting" fig = plt.figure(1) axs = [ fig.add_subplot(131), fig.add_subplot(132), fig.add_subplot(133) ] lines = plotTrajectoryFromFile(directory+"/demonstration_traj.txt",axs) plt.setp(lines, linestyle='-', linewidth=4, color=(0.8,0.8,0.8), label='demonstration') lines = plotTrajectoryFromFile(directory+"/reproduced_traj.txt",axs) plt.setp(lines, linestyle='--', linewidth=2, color=(0.0,0.0,0.5), label='reproduced') plt.legend() # Read data xs_xds = numpy.loadtxt(directory+'/reproduced_xs_xds.txt') forcing_terms = numpy.loadtxt(directory+'/reproduced_forcing_terms.txt') fa_output = numpy.loadtxt(directory+'/reproduced_fa_output.txt') fig = plt.figure(2) plotDmp(xs_xds,fig,forcing_terms,fa_output)
subprocess.call(command, shell=True) print("Plotting") task_parameters_demos = numpy.loadtxt(directory+"/task_parameters_demos.txt") task_parameters_repros = numpy.loadtxt(directory+"/task_parameters_repros.txt") n_demos = len(task_parameters_demos) n_repros = len(task_parameters_repros) fig = plt.figure(n_dmp_contextual_step) fig.suptitle(str(n_dmp_contextual_step)+"-step Contextual Dmp") axs = [ fig.add_subplot(131), fig.add_subplot(132), fig.add_subplot(133) ] for i_demo in range(n_demos): filename = "demonstration0"+str(i_demo); lines = plotTrajectoryFromFile(directory+"/"+filename+".txt",axs) plt.setp(lines, linestyle='-', linewidth=4, color=(0.7,0.7,1.0), label=filename) for i_repro in range(n_repros): filename = "reproduced0"+str(i_repro); lines = plotTrajectoryFromFile(directory+"/"+filename+".txt",axs) plt.setp(lines, linestyle='-', linewidth=1, color=(0.5,0.0,0.0), label=filename) #ax = fig.add_subplot(144) #inputs = numpy.loadtxt(directory+'/inputs.txt') #targets = numpy.loadtxt(directory+'/targets.txt') #lines = ax.plot(inputs[:,0],targets,linestyle='-',color='red') #ax.set_xlabel('input') #ax.set_ylabel('targets') #ax = fig.add_subplot(155)
subprocess.call(command, shell=True) print "Plotting" task_parameters_demos = numpy.loadtxt(directory+"/task_parameters_demos.txt") task_parameters_repros = numpy.loadtxt(directory+"/task_parameters_repros.txt") n_demos = len(task_parameters_demos) n_repros = len(task_parameters_repros) fig = plt.figure(n_dmp_contextual_step) fig.suptitle(str(n_dmp_contextual_step)+"-step Contextual Dmp") axs = [ fig.add_subplot(131), fig.add_subplot(132), fig.add_subplot(133) ] for i_demo in range(n_demos): filename = "demonstration0"+str(i_demo); lines = plotTrajectoryFromFile(directory+"/"+filename+".txt",axs) plt.setp(lines, linestyle='-', linewidth=4, color=(0.7,0.7,1.0), label=filename) for i_repro in range(n_repros): filename = "reproduced0"+str(i_repro); lines = plotTrajectoryFromFile(directory+"/"+filename+".txt",axs) plt.setp(lines, linestyle='-', linewidth=1, color=(0.5,0.0,0.0), label=filename) #ax = fig.add_subplot(144) #inputs = numpy.loadtxt(directory+'/inputs.txt') #targets = numpy.loadtxt(directory+'/targets.txt') #lines = ax.plot(inputs[:,0],targets,linestyle='-',color='red') #ax.set_xlabel('input') #ax.set_ylabel('targets') #ax = fig.add_subplot(155)