sick_scan_timing_dump_analyser.py
Go to the documentation of this file.
1 import csv
2 import numpy as np
3 import matplotlib.pyplot as plt
4 plt.rcParams.update({'font.size': 30})
5 ScanTimeArray=np.zeros(0)
6 ImuTimeArray=np.zeros(0)
7 ImuXArayTmp=np.zeros(0)
8 ImuYArayTmp=np.zeros(0)
9 ImuZArayTmp=np.zeros(0)
10 DISTTmp=np.zeros(0)
11 DISTTimeTmp=np.zeros(0)
12 LayerTmp=np.zeros(0)
13 LayerTimeTmp=np.zeros(0)
14 LayerFirstTime=np.zeros(0)
15 with open('/home/rosuser/mrs6xxx_moved.csv', 'r') as csvfile:
16  debugreader = csv.reader(csvfile, delimiter=';', quotechar='#')
17  for row in debugreader:
18  keyword=row[1]
19  if('LASESCANTIME' in keyword):
20  ScanTimeArray=np.append(ScanTimeArray,row[0])
21  elif('ACCX'in keyword):
22  ImuTimeArray=np.append(ImuTimeArray,row[0])
23  ImuXArayTmp = np.append(ImuXArayTmp, row[2])
24  elif('ACCY'in keyword):
25  ImuYArayTmp = np.append(ImuYArayTmp, row[2])
26  elif('ACCZ'in keyword):
27  ImuZArayTmp = np.append(ImuZArayTmp, row[2])
28  elif('DIST'in keyword):
29  DISTTmp = np.append(DISTTmp, row[2])
30  DISTTimeTmp = np.append(DISTTimeTmp, row[0])
31 
32 #MRS600 TIMING BEGIN
33  elif ('LAYER' in keyword):
34  LayerTmp = np.append(LayerTmp, row[2]).astype(float)
35  LayerTimeTmp = np.append(LayerTimeTmp, row[0]).astype(float)
36  if(row[2]=='13.19000000'):
37  LayerFirstTime=np.append(LayerFirstTime,row[0]).astype(float)
38  print(row[0])
39 DeltaLayerFirstTime=(LayerFirstTime[1:]-LayerFirstTime[:-1])/1000
40 DeltaMean=np.mean(DeltaLayerFirstTime)
41 TimePredictetVal=np.arange(0,DeltaLayerFirstTime.size,1)
42 TimePredictetVal=TimePredictetVal*DeltaMean
43 TimePredictionDiff=LayerFirstTime[1:]*1000-LayerFirstTime[0]-TimePredictetVal
44 LayerFirstTime=(LayerFirstTime-LayerFirstTime[0])/1e6
45 #plt.plot(LayerFirstTime[:-1],DeltaLayerFirstTime,lael="")
46 plt.plot(LayerFirstTime[:-1],TimePredictionDiff)
47 plt.xlabel('Time since scaner start /s')
48 plt.ylabel('Time betwean first Layers /ms')
49 plt.title('MRS6xxx timing moved scaner')
50 plt.legend(loc='upper left')
51 plt.show()
52 # MRS600 TIMING END
53 #ImuMsgCount=np.min([ImuXArayTmp.size,ImuYArayTmp.size,ImuYArayTmp.size])
54 #ImuDataCombined=np.zeros([ImuMsgCount,4])
55 #for i in range(0, ImuMsgCount):
56 # ImuDataCombined[i,0]=ImuTimeArray[i]
57 # ImuDataCombined[i, 1] = ImuXArayTmp[i]
58 # ImuDataCombined[i, 2] = ImuYArayTmp[i]
59 # ImuDataCombined[i, 3] = ImuZArayTmp[i]
60 # if(i>0):
61 # DiffArray=ImuDataCombined[i-1,1:]==ImuDataCombined[i,1:]
62 # if(DiffArray[0] and DiffArray[1] and DiffArray[2]):
63 # print("Identical Imu Data found")
64 # print(ImuDataCombined[i-1,1:]==ImuDataCombined[i,1:])
65 # print(ImuDataCombined[i-1])
66 # print(ImuDataCombined[i])
67 
68 #DeltaImuTimes=ImuTimeArray[1:].astype(float)-ImuTimeArray[:-1].astype(float)
69 #DeltaImuTimesMean=np.mean(DeltaImuTimes)
70 #DeltaImuTimesStd=np.std(DeltaImuTimes)
71 #DeltaX=DISTTmp[1:].astype(float)-DISTTmp[:-1].astype(float)
72 #DeltaXT=DISTTimeTmp[1:].astype(float)-DISTTimeTmp[:-1].astype(float)
73 #AX=DeltaX.astype(float)/(DeltaXT.astype(float)*1e-6)-9.81
74 #AXT=DISTTimeTmp[1:].astype(float)
75 #print("Imu Stats: Samples,Mean DeltaT,Sigma Delta T")
76 #print(DeltaImuTimes.size+1)
77 #print(DeltaImuTimesMean)
78 #print(DeltaImuTimesStd)
79 #DeltaScanTimeArray=ScanTimeArray[1:].astype(float)-ScanTimeArray[:-1].astype(float)
80 #DeltaScanTimeArrayMean=np.mean(DeltaScanTimeArray)
81 #DeltaScanTimeArrayStd=np.std(DeltaScanTimeArray)
82 #print("Laser Stats: Samples,Mean DeltaT,Sigma Delta T")
83 #print(DeltaScanTimeArray.size+1)
84 #print(DeltaScanTimeArrayMean)
85 #print(DeltaScanTimeArrayStd)
86 #plt.plot(ImuDataCombined[:,0],ImuDataCombined[:,1],label='X acceleration / m/s^2')
87 #plt.plot(DISTTimeTmp.astype(float),DISTTmp.astype(float),label='X distance /m')
88 #plt.xlabel('Time since scanner start /µs')
89 #plt.ylabel('Readings')
90 #plt.title('IMU vs distance coherence checking')
91 #plt.legend(loc='upper left')
92 #plt.show()


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