parent
82ba958eff
commit
bf1526fbc4
2 changed files with 43 additions and 196 deletions
@ -1,90 +0,0 @@ |
||||
{ |
||||
"cells": [ |
||||
{ |
||||
"cell_type": "code", |
||||
"execution_count": 1, |
||||
"metadata": {}, |
||||
"outputs": [ |
||||
{ |
||||
"name": "stderr", |
||||
"output_type": "stream", |
||||
"text": [ |
||||
"kj/filesystem-disk-unix.c++:1703: warning: PWD environment variable doesn't match current directory; pwd = /mnt/c/Users/camer/AppData/Local/Programs/Microsoft VS Code\n" |
||||
] |
||||
}, |
||||
{ |
||||
"data": { |
||||
"text/plain": [ |
||||
"(False, {<CAR.BRONCO_SPORT_MK1: 'FORD BRONCO SPORT 1ST GEN'>})" |
||||
] |
||||
}, |
||||
"execution_count": 1, |
||||
"metadata": {}, |
||||
"output_type": "execute_result" |
||||
} |
||||
], |
||||
"source": [ |
||||
"from cereal import car\n", |
||||
"from openpilot.selfdrive.car.fw_versions import match_fw_to_car\n", |
||||
"\n", |
||||
"Ecu = car.CarParams.Ecu\n", |
||||
"\n", |
||||
"\n", |
||||
"def dict_to_cereal(d):\n", |
||||
" car_fw = []\n", |
||||
" for (ecu, addr), fws in d.items():\n", |
||||
" for fw in fws:\n", |
||||
" f = car.CarParams.CarFw.new_message()\n", |
||||
" f.ecu = ecu\n", |
||||
" f.fwVersion = fw\n", |
||||
" f.address = addr\n", |
||||
" f.brand = 'ford'\n", |
||||
" f.logging = False\n", |
||||
" car_fw.append(f)\n", |
||||
" return car_fw\n", |
||||
"\n", |
||||
"\n", |
||||
"fw_dict = {\n", |
||||
" # (Ecu.debug, 2000): {b'1U5T-14G374-EM\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" # (Ecu.engine, 2016): {b'P1PA-14C204-AE\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" # (Ecu.shiftByWire, 1842): {b'PZ1P-14G395-AC\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" (Ecu.eps, 1840): {b'LX6C-14D003-AL\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" (Ecu.abs, 1888): {b'LX6C-2D053-RF\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" (Ecu.fwdCamera, 1798): {b'M1PT-14F397-AD\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
" (Ecu.fwdRadar, 1892): {b'LB5T-14D049-AB\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'},\n", |
||||
"}\n", |
||||
"\n", |
||||
"\n", |
||||
"match_fw_to_car(dict_to_cereal(fw_dict))" |
||||
] |
||||
}, |
||||
{ |
||||
"cell_type": "code", |
||||
"execution_count": null, |
||||
"metadata": {}, |
||||
"outputs": [], |
||||
"source": [] |
||||
} |
||||
], |
||||
"metadata": { |
||||
"kernelspec": { |
||||
"display_name": ".venv", |
||||
"language": "python", |
||||
"name": "python3" |
||||
}, |
||||
"language_info": { |
||||
"codemirror_mode": { |
||||
"name": "ipython", |
||||
"version": 3 |
||||
}, |
||||
"file_extension": ".py", |
||||
"mimetype": "text/x-python", |
||||
"name": "python", |
||||
"nbconvert_exporter": "python", |
||||
"pygments_lexer": "ipython3", |
||||
"version": "3.11.4" |
||||
} |
||||
}, |
||||
"nbformat": 4, |
||||
"nbformat_minor": 2 |
||||
} |
Loading…
Reference in new issue