sick_scan_timing_dump_analyser.py
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 #MRS600 TIMING BEGIN
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 #plt.plot(LayerFirstTime[:-1],DeltaLayerFirstTime,lael="")
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 # MRS600 TIMING END
00053 #ImuMsgCount=np.min([ImuXArayTmp.size,ImuYArayTmp.size,ImuYArayTmp.size])
00054 #ImuDataCombined=np.zeros([ImuMsgCount,4])
00055 #for i in range(0, ImuMsgCount):
00056 #    ImuDataCombined[i,0]=ImuTimeArray[i]
00057 #    ImuDataCombined[i, 1] = ImuXArayTmp[i]
00058 #    ImuDataCombined[i, 2] = ImuYArayTmp[i]
00059 #    ImuDataCombined[i, 3] = ImuZArayTmp[i]
00060 #    if(i>0):
00061 #        DiffArray=ImuDataCombined[i-1,1:]==ImuDataCombined[i,1:]
00062 #        if(DiffArray[0] and DiffArray[1] and DiffArray[2]):
00063 #            print("Identical Imu Data found")
00064 #            print(ImuDataCombined[i-1,1:]==ImuDataCombined[i,1:])
00065 #            print(ImuDataCombined[i-1])
00066 #            print(ImuDataCombined[i])
00067 
00068 #DeltaImuTimes=ImuTimeArray[1:].astype(float)-ImuTimeArray[:-1].astype(float)
00069 #DeltaImuTimesMean=np.mean(DeltaImuTimes)
00070 #DeltaImuTimesStd=np.std(DeltaImuTimes)
00071 #DeltaX=DISTTmp[1:].astype(float)-DISTTmp[:-1].astype(float)
00072 #DeltaXT=DISTTimeTmp[1:].astype(float)-DISTTimeTmp[:-1].astype(float)
00073 #AX=DeltaX.astype(float)/(DeltaXT.astype(float)*1e-6)-9.81
00074 #AXT=DISTTimeTmp[1:].astype(float)
00075 #print("Imu Stats: Samples,Mean DeltaT,Sigma Delta T")
00076 #print(DeltaImuTimes.size+1)
00077 #print(DeltaImuTimesMean)
00078 #print(DeltaImuTimesStd)
00079 #DeltaScanTimeArray=ScanTimeArray[1:].astype(float)-ScanTimeArray[:-1].astype(float)
00080 #DeltaScanTimeArrayMean=np.mean(DeltaScanTimeArray)
00081 #DeltaScanTimeArrayStd=np.std(DeltaScanTimeArray)
00082 #print("Laser Stats: Samples,Mean DeltaT,Sigma Delta T")
00083 #print(DeltaScanTimeArray.size+1)
00084 #print(DeltaScanTimeArrayMean)
00085 #print(DeltaScanTimeArrayStd)
00086 #plt.plot(ImuDataCombined[:,0],ImuDataCombined[:,1],label='X acceleration / m/s^2')
00087 #plt.plot(DISTTimeTmp.astype(float),DISTTmp.astype(float),label='X distance /m')
00088 #plt.xlabel('Time since scanner start /µs')
00089 #plt.ylabel('Readings')
00090 #plt.title('IMU vs distance coherence checking')
00091 #plt.legend(loc='upper left')
00092 #plt.show()


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Tue Jul 9 2019 05:05:35