Calibrate and install GPS lane weighting archive

This commit is contained in:
2026-06-19 20:24:27 -05:00
parent 85d1e326ee
commit 20daac34e5
10 changed files with 407 additions and 31 deletions
+13 -3
View File
@@ -1,6 +1,7 @@
import json
import subprocess
import sys
import tempfile
from pathlib import Path
@@ -8,7 +9,7 @@ ROOT = Path(__file__).resolve().parents[1]
TOOL = ROOT / "tools" / "patch_traffic_lanes.py"
def test_patch_sample(tmp_path):
def run_patch_sample(tmp_path):
output = tmp_path / "patched.json"
result = subprocess.run(
@@ -28,6 +29,15 @@ def test_patch_sample(tmp_path):
patched = json.loads(output.read_text(encoding="utf-8"))
lanes = patched["Data"]["RootChunk"]["data"]["lanes"]
assert lanes[0]["maxSpeed"] == 90
assert lanes[1]["maxSpeed"] == 45
assert lanes[0]["maxSpeed"] == 25
assert lanes[1]["maxSpeed"] == 15
assert lanes[2]["maxSpeed"] == 10
def test_patch_sample(tmp_path):
run_patch_sample(tmp_path)
if __name__ == "__main__":
with tempfile.TemporaryDirectory() as tmp:
run_patch_sample(Path(tmp))