Go to the documentation of this file.00001 import csv
00002 import numpy as np
00003 import matplotlib.pyplot as plt
00004 plt.rcParams.update({'font.size': 30})
00005 ScanTimeArray=np.zeros(0)
00006 ImuTimeArray=np.zeros(0)
00007 ImuXArayTmp=np.zeros(0)
00008 ImuYArayTmp=np.zeros(0)
00009 ImuZArayTmp=np.zeros(0)
00010 DISTTmp=np.zeros(0)
00011 DISTTimeTmp=np.zeros(0)
00012 LayerTmp=np.zeros(0)
00013 LayerTimeTmp=np.zeros(0)
00014 LayerFirstTime=np.zeros(0)
00015 with open('/home/rosuser/mrs6xxx_moved.csv', 'r') as csvfile:
00016 debugreader = csv.reader(csvfile, delimiter=';', quotechar='#')
00017 for row in debugreader:
00018 keyword=row[1]
00019 if('LASESCANTIME' in keyword):
00020 ScanTimeArray=np.append(ScanTimeArray,row[0])
00021 elif('ACCX'in keyword):
00022 ImuTimeArray=np.append(ImuTimeArray,row[0])
00023 ImuXArayTmp = np.append(ImuXArayTmp, row[2])
00024 elif('ACCY'in keyword):
00025 ImuYArayTmp = np.append(ImuYArayTmp, row[2])
00026 elif('ACCZ'in keyword):
00027 ImuZArayTmp = np.append(ImuZArayTmp, row[2])
00028 elif('DIST'in keyword):
00029 DISTTmp = np.append(DISTTmp, row[2])
00030 DISTTimeTmp = np.append(DISTTimeTmp, row[0])
00031
00032
00033 elif ('LAYER' in keyword):
00034 LayerTmp = np.append(LayerTmp, row[2]).astype(float)
00035 LayerTimeTmp = np.append(LayerTimeTmp, row[0]).astype(float)
00036 if(row[2]=='13.19000000'):
00037 LayerFirstTime=np.append(LayerFirstTime,row[0]).astype(float)
00038 print(row[0])
00039 DeltaLayerFirstTime=(LayerFirstTime[1:]-LayerFirstTime[:-1])/1000
00040 DeltaMean=np.mean(DeltaLayerFirstTime)
00041 TimePredictetVal=np.arange(0,DeltaLayerFirstTime.size,1)
00042 TimePredictetVal=TimePredictetVal*DeltaMean
00043 TimePredictionDiff=LayerFirstTime[1:]*1000-LayerFirstTime[0]-TimePredictetVal
00044 LayerFirstTime=(LayerFirstTime-LayerFirstTime[0])/1e6
00045
00046 plt.plot(LayerFirstTime[:-1],TimePredictionDiff)
00047 plt.xlabel('Time since scaner start /s')
00048 plt.ylabel('Time betwean first Layers /ms')
00049 plt.title('MRS6xxx timing moved scaner')
00050 plt.legend(loc='upper left')
00051 plt.show()
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092