urosolia / RacingLMPC

Implementation of the Learning Model Predictive Controller for autonomous racing
284 stars 77 forks source link

Fixed Pickle compatibility issue with Python3. #4

Closed Karl-Krauth closed 5 years ago

Karl-Krauth commented 5 years ago

Running main.py from Python3 gave me the following error:

karlk@karl-desktop ~/r/R/src> python main.py
Starting PID
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    ClosedLoopDataPID = pickle.load(file_data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9e in position 2: ordinal not in range(128)

After some investigation it looks like it's because the objects were pickled in Python 2. This stackoverflow post seems to fix it: https://stackoverflow.com/questions/28218466/unpickling-a-python-2-object-with-python-3 Not extensively tested but it seems to work.