5 import matplotlib.pyplot
as plt
15 with open(self.
logName,
"r")
as f:
22 timestamps = np.zeros(1)
32 timeStampVal = secVal + 1E-9 * nanoVal
33 print(
"Timestamp: {timestamp}".format(timestamp=timeStampVal))
36 timestamps[0] = timeStampVal
38 timestamps = np.append(timestamps, timeStampVal)
44 if (word ==
'nsecs:'):
50 deltaT = timestamps[1:] - timestamps[:-1]
51 X = np.arange(0, timestamps.size, 1)
54 plt.ylabel(
'Zeitdifferenz t(x)-t(x-1)')
55 plt.xlabel(
'relativer Rospaketindex x')
56 plt.title(
'Zeitverhalten der IMU Timestamps nach langen Differenzen')
57 ax.grid(which=
'major', axis=
'both', linestyle=
'--')
59 for i
in range(0, deltaT.size - 1):
60 if deltaT[i] > np.mean(deltaT) + 2 * np.std(deltaT):
61 print(
'ERROR INDEX:' + str(i) +
' Timestamp[INDEX-1]:' + str(timestamps[i]) +
' Timestamp[INDEX]:' + str(
65 plt.savefig(
'imutimestampsmu+2sigma.png', dpi=300)
68 if __name__ ==
"__main__":
69 filename =
"/tmp/imu.txt"