From dc713149918c980f23bc9405b8ffe7502d5f515e Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期六, 29 十一月 2025 18:57:26 +0800
Subject: [PATCH] IM23数据解析成功,但是硬件仿真有问题,在解决。
---
python/tests_hitl/test_simulator.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/python/tests_hitl/test_simulator.py b/python/tests_hitl/test_simulator.py
index 0e33a8f..6191c7d 100644
--- a/python/tests_hitl/test_simulator.py
+++ b/python/tests_hitl/test_simulator.py
@@ -75,11 +75,14 @@
time.sleep(0.05)
sim.stop()
- gprmi_count = sum(1 for pkt in sim.uart2.writes if pkt.startswith(b"$GPFMI"))
- gpimu_count = sum(1 for pkt in sim.uart2.writes if pkt.startswith(b"$GPIMU"))
+ nav_frames = [pkt for pkt in sim.uart2.writes if pkt.startswith(b"fmin")]
+ imu_frames = [pkt for pkt in sim.uart2.writes if pkt.startswith(b"fmim")]
- assert gprmi_count >= 2
- assert gpimu_count >= 10
+ assert all(len(pkt) == 100 for pkt in nav_frames)
+ assert all(len(pkt) == 52 for pkt in imu_frames)
+
+ assert len(nav_frames) >= 2
+ assert len(imu_frames) >= 10
assert received_controls, "鎺у埗甯ф湭琚В鏋�"
assert received_controls[-1][0] == pytest.approx(0.5, rel=0.1)
assert received_controls[-1][1] == pytest.approx(0.2, rel=0.1)
--
Gitblit v1.10.0