Skip to content

test(native_sim): cover wheel chassis and motor load#35

Merged
ttwards merged 4 commits into
masterfrom
test/native-sim-wheel-motor
Jul 8, 2026
Merged

test(native_sim): cover wheel chassis and motor load#35
ttwards merged 4 commits into
masterfrom
test/native-sim-wheel-motor

Conversation

@ttwards

@ttwards ttwards commented Jul 8, 2026

Copy link
Copy Markdown
Owner

概要

  • 新增 wheel_chassis native_sim ztest,覆盖 mecanum、steerwheel 和 chassis 公共命令映射。
  • 更新 LK 电机发送语义:set 立即发送控制帧,timer 平常重发当前控制命令,无可用控制目标时 fallback 到 0x9C 状态读取,并保留 3ms 状态回复新鲜度检查。
  • 扩展 motor_driver_sim fake CAN,加入 nominal 总线时间模型,并新增 7 个 DJI 电机同 CAN、每电机不低于 950Hz 控制频率的负载测试。
  • 更新 native_sim、LK 和麦克纳姆轮文档,包括麦克纳姆轮示意图。

测试

  • git diff --check origin/master..HEAD
  • ZEPHYR_TOOLCHAIN_VARIANT=host west twister -T tests/native_sim/motor_driver_sim --platform native_sim/native/64 --inline-logs --outdir twister-out-motor-driver-sim-lk-revert
  • ZEPHYR_TOOLCHAIN_VARIANT=host west twister -T tests/native_sim/wheel_chassis --platform native_sim/native/64 --inline-logs --outdir twister-out-wheel-chassis-pr

硬件

未进行硬件验证;本 PR 仅通过 native_sim/fake CAN 仿真验证。

影响

  • LK 的 timer 发送路径会继续发送当前控制命令;仅在没有可打包控制目标时发送 0x9C 读取帧。
  • fake CAN 现在会按 bitrate 和经典 CAN 帧长度模拟 nominal 总线占用时间,但不模拟 bit stuffing、仲裁失败、错误帧或真实 FIFO 深度。
  • DJI 测试 overlay 扩展为 7 个 DJI 电机共用同一个 fake CAN。

限制

  • 7 DJI 950Hz 测试是 nominal bus-time 负载测试,不等同于真实硬件总线最坏情况验证。

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

👋 感谢您的贡献!

请确保:

  • ✅ 代码通过所有 CI 检查
  • ✅ 遵循项目编码规范
  • ✅ 添加必要的文档说明
  • ✅ 在实际硬件上测试(如果适用)

详细的贡献指南请参考 CONTRIBUTING.md

@ttwards
ttwards marked this pull request as ready for review July 8, 2026 08:27
@ttwards
ttwards merged commit 2b22cf9 into master Jul 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant