| | |
| | | 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) |