Strymmap Example¶
Apart from CAN bus data, comma.ai’s grey panda and black panda devices also record GPS data. strymmap
enables to read the GPS data from such recording and make interesting observation.
[2]:
import strym
from strym import strymmap
import matplotlib.pyplot as plt
import pandas as pd
[3]:
datafolder='../../PandaData/2020_03_12/'
file = '2020-03-12-10-56-10_GPS_Messages.csv'
g = strymmap(csvfile=datafolder+file)
g.dataframe = g.dataframe.dropna()
GPS signal first acquired at 2020-03-12 17:56:20:600000
Looking for [chromedriver 85.0.4183.87 linux64] driver in cache
File found in cache by path [/home/ivory/.wdm/drivers/chromedriver/85.0.4183.87/linux64/chromedriver]
[5]:
fig = g.plotroute(interactive=False)
We can create such maps for all drive for which we have GPS recording¶
[ ]:
import glob
parentfolder = '../../PandaData/'
folderlist = glob.glob(parentfolder+"*")
csvlist = []
for datafolder in folderlist:
csvlisttmp = glob.glob(datafolder+"/*.csv")
for f in csvlisttmp:
csvlist.append(f)
for index, f in enumerate(csvlist):
if 'GPS' in f:
print('{}. File currently being read is {}'.format(index, f))
g = strymmap(csvfile=f)
try:
g.dataframe = g.dataframe.dropna()
except AttributeError:
pass
print('\n')