|
|
@ -20,7 +20,7 @@ |
|
|
|
"source": [ |
|
|
|
"source": [ |
|
|
|
"\"\"\"In this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\"\"\"\n", |
|
|
|
"\"\"\"In this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\"\"\"\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
"from openpilot.tools.lib.logreader import LogReader\n", |
|
|
|
"from openpilot.tools.lib.logreader import LogReader, comma_car_segments_source\n", |
|
|
|
"from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database\n", |
|
|
|
"from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database\n", |
|
|
|
"from opendbc.car.ford.values import CAR\n", |
|
|
|
"from opendbc.car.ford.values import CAR\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
@ -100,7 +100,7 @@ |
|
|
|
" if platform not in database:\n", |
|
|
|
" if platform not in database:\n", |
|
|
|
" print(f\"Skipping platform: {platform}, no data available\")\n", |
|
|
|
" print(f\"Skipping platform: {platform}, no data available\")\n", |
|
|
|
" continue\n", |
|
|
|
" continue\n", |
|
|
|
" \n", |
|
|
|
"\n", |
|
|
|
" all_segments = database[platform]\n", |
|
|
|
" all_segments = database[platform]\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
" NUM_SEGMENTS = min(len(all_segments), MAX_SEGS_PER_PLATFORM)\n", |
|
|
|
" NUM_SEGMENTS = min(len(all_segments), MAX_SEGS_PER_PLATFORM)\n", |
|
|
@ -110,7 +110,7 @@ |
|
|
|
" segments = random.sample(all_segments, NUM_SEGMENTS)\n", |
|
|
|
" segments = random.sample(all_segments, NUM_SEGMENTS)\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
" for segment in segments:\n", |
|
|
|
" for segment in segments:\n", |
|
|
|
" lr = LogReader(segment)\n", |
|
|
|
" lr = LogReader(segment, sources=[comma_car_segments_source])\n", |
|
|
|
" CP = lr.first(\"carParams\")\n", |
|
|
|
" CP = lr.first(\"carParams\")\n", |
|
|
|
" if \"FORD\" not in CP.carFingerprint:\n", |
|
|
|
" if \"FORD\" not in CP.carFingerprint:\n", |
|
|
|
" print(segment, CP.carFingerprint)\n", |
|
|
|
" print(segment, CP.carFingerprint)\n", |
|
|
|