Exemplo n.º 1
0
            values = []
            for i in np.arange(len(y)):
                if(len(y[i]) > j):
                    values.append(y[i][j]-average)
            means.append(mean(values))
#             stds.append((mean(np.array(values)**(2.0)))**0.5) # TODO
            stds.append(std(values))
        plot(np.arange(200)*0.05,np.ones(200)*average,'b', lw=3)
        plot(np.arange(200)*0.05,average+np.array(means),'r', lw=3)
        plot(np.arange(200)*0.05,average+np.array(means)+np.array(stds),'r--', lw=3)
        plot(np.arange(200)*0.05,average+np.array(means)-np.array(stds),'r--', lw=3)
        
if len(plotLeutiDistances) > 0: # Leute Score evaluation
    spacings = plotLeutiDistances
    if doRovio:
        leutiOutputRovio = td_rovio.computeLeutiScore(rovio_posID, rovio_attID, rovio_velID, td_vicon, vicon_posID, vicon_attID, plotLeutiDistances, spacings, 0.0)
        figure()
        ax = axes()
        boxplot(leutiOutputRovio, positions = np.arange(len(plotLeutiDistances)), widths = 0.8)
        ax.set_xticklabels(plotLeutiDistances)
        ax.set_xlabel('Travelled Distance [m]')
        ax.set_ylabel('Position Error [m]')
    if doOkvis:
        leutiOutputOkvis = td_okvis.computeLeutiScore(okvis_posID, okvis_attID, okvis_velID, td_vicon, vicon_posID, vicon_attID, plotLeutiDistances, spacings, 0.0)
        figure()
        ax = axes()
        boxplot(leutiOutputOkvis, positions = np.arange(len(plotLeutiDistances)), widths = 0.8)
        ax.set_xticklabels(plotLeutiDistances)
        ax.set_xlabel('Travelled Distance [m]')
        ax.set_ylabel('Position Error [m]')
Exemplo n.º 2
0
            plot(x[i],
                 np.abs(np.array(y[i]) - average) / np.array(cov[i]),
                 '#999999')
        plt.axis([0, plotFeaTimeEnd, 0, 5])
        plt.legend()
        plt.suptitle('Convergence of Landmark Distance')
        axis.set_ylabel('Normalized error')
        axis.set_xlabel('Time [s]')

if len(plotLeutiDistances) > 0:  # Leute Score evaluation
    spacings = plotLeutiDistances
    if leutiSpacing > 0:
        spacings = np.ones(len(plotLeutiDistances)) * leutiSpacing
    if doRovio:
        leutiOutputRovio = td_rovio.computeLeutiScore('pos', 'att', 'vel',
                                                      td_vicon, 'pos', 'att',
                                                      plotLeutiDistances,
                                                      spacings, 0.0)
        figure()
        ax = axes()
        p = np.arange(len(plotLeutiDistances))
        boxplot(leutiOutputRovio, positions=p, widths=0.8)
        ax.set_xticklabels(plotLeutiDistances)
        ax.set_xlabel('Travelled Distance [m]')
        ax.set_ylabel('Position Error [m]')
        med = np.zeros(len(leutiOutputRovio))
        for i in range(len(leutiOutputRovio)):
            med[i] = median(leutiOutputRovio[i])
        s = np.array(plotLeutiDistances)**0.5
        a = s.dot(med) / s.dot(s)
        fit = a * s
        plot(p, fit)
        axis = subplot(2,1,2)
        line_th = plot([0, plotFeaTimeEnd], [sqrt(6.64), sqrt(6.64)],'g--', lw=3, label='1% threshold')
        for i in np.arange(len(x)):
            plot(x[i],np.abs(np.array(y[i])-average)/np.array(cov[i]),'#999999')
        plt.axis([0, plotFeaTimeEnd, 0, 5])
        plt.legend()
        plt.suptitle('Convergence of Landmark Distance')
        axis.set_ylabel('Normalized error')
        axis.set_xlabel('Time [s]')
          
if len(plotLeutiDistances) > 0: # Leute Score evaluation
    spacings = plotLeutiDistances
    if leutiSpacing > 0:
        spacings = np.ones(len(plotLeutiDistances))*leutiSpacing
    if doRovio:
        leutiOutputRovio = td_rovio.computeLeutiScore('pos', 'att', 'vel', td_vicon, 'pos', 'att', plotLeutiDistances, spacings, 0.0)
        figure()
        ax = axes()
        p = np.arange(len(plotLeutiDistances))
        boxplot(leutiOutputRovio, positions = p, widths = 0.8)
        ax.set_xticklabels(plotLeutiDistances)
        ax.set_xlabel('Travelled Distance [m]')
        ax.set_ylabel('Position Error [m]')
        med = np.zeros(len(leutiOutputRovio))
        for i in range(len(leutiOutputRovio)):
            med[i] = median(leutiOutputRovio[i])
        s = np.array(plotLeutiDistances)**0.5
        a = s.dot(med)/s.dot(s)
        fit = a*s
        plot(p,fit)
        title('Error Plot for Position, a = ' + str(a))