fix: add acceleration values to test packet for G-force dashboard

This commit is contained in:
2026-07-27 08:15:19 +08:00
parent d3a269b5cd
commit 8c78393fb5
+3
View File
@@ -87,6 +87,9 @@ class TestDataGenerator:
struct.pack_into("<f", buf, 244, random.uniform(-5000, 5000)) struct.pack_into("<f", buf, 244, random.uniform(-5000, 5000))
struct.pack_into("<f", buf, 248, random.uniform(-50, 50)) struct.pack_into("<f", buf, 248, random.uniform(-50, 50))
struct.pack_into("<f", buf, 252, random.uniform(-5000, 5000)) struct.pack_into("<f", buf, 252, random.uniform(-5000, 5000))
struct.pack_into("<f", buf, 20, steering * 9.81 * 2) # lateral G
struct.pack_into("<f", buf, 24, 0.0)
struct.pack_into("<f", buf, 28, (throttle - brake) * 9.81 * 2) # longitudinal G
struct.pack_into("<f", buf, 256, speed_mps) struct.pack_into("<f", buf, 256, speed_mps)
struct.pack_into("<f", buf, 260, hp * 745.7) struct.pack_into("<f", buf, 260, hp * 745.7)
struct.pack_into("<f", buf, 264, torque) struct.pack_into("<f", buf, 264, torque)