-
Notifications
You must be signed in to change notification settings - Fork 12
Debugging
konodoki edited this page Jul 23, 2026
·
26 revisions
colcon build --packages-select remote_controller bxi_example_py_elf3 \
--symlink-install --merge-install
source install/setup.bash若提示 install layout 不一致,使用匹配的 --merge-install,或换一组全新的 build/install/log 目录。旧构建缓存仍引用已删除模型目录时,只清理对应包缓存。
ros2 topic echo /motion_commands
ros2 topic echo /simulation/state_machine_info硬件前缀时将 simulation/ 换成 hardware/。状态信息 JSON 包含 current、pending、active transition、事件和图快照。
-
mod.yaml是否位于内置mods/或mod_paths子树。 - 安装后的
share/bxi_example_py_elf3/mods/是否包含文件。 -
schema/api是否为1,id 和版本是否合法。 - 是否出现重复 id。
- 日志是否打印
Mod <id>@<version>: <root>。
-
entrypoint module does not exist:entrypoint 与文件名不一致。 -
entrypoint is not callable:冒号后的工厂不存在。 -
state manifest/factory mismatch:states和state_factories键不同。 -
requires missing/version:依赖缺失或版本不匹配。 -
dependency cycle:Mod 依赖形成环。 -
unknown params:清单参数未被StateBuildContext消费。
- 资产必须在当前 Mod 的
assets/。 -
context.asset()路径应写assets/file.onnx。 - 模型是惰性资源;仅加载 Mod 不会打开文件,首次
ResourceHandle.get()才加载。 - 在
on_prepare()预热,不要在插件 import 时创建推理 Session。 - 模型热重载失败时旧模型会继续工作,查看具体异常。
-
/motion_commands的槽位和值是否与mod.yaml events一致。 - 当前完整状态名是否存在对应 route。
- 跨 Mod名称是否含
/且依赖存在。 - 是否正在等待
delay或处于活动过渡。 - 同一状态是否存在可同时触发的输入;加载器会提前拒绝。
重复 manifest.index 会产生警告但不会退出:
RuntimeWarning: ... keeps index N; ... was reassigned to index M
首次声明者保留,后续状态自动移动。负数、布尔值、字符串仍是配置错误。
-
must implement EntryFrameProvider:目标没有进入帧。 -
must implement RunningFrameProvider:动态采样侧没有运行帧能力。 -
unknown transition type:业务过渡模块未被 Mod entrypoint 导入。 -
unknown fields:ConfigReader.finish()发现字段拼写错误。 - 发生突跳:检查进入帧与
on_enter()后第一帧是否一致。
-
/hot_reload是否为 true。 - 文件是否位于系统 YAML、内置 mods 或
mod_paths。 - 状态机正在过渡时会暂缓。
- 查看
Mod hot reload failed;失败不会替换旧运行时。 - 核心
utils/和内置transitions/修改需要重启。
python3 tools/sanitize_release.py --out /tmp/public_release --self-check若报告公开 Mod 依赖 protected Mod,检查显式 requires 和跨 Mod route。共享资源应移到 public 资源 Mod。
模型是惰性的,因此可以只验证 Mod 和状态图:
from pathlib import Path
import yaml
from bxi_example_py_elf3.utils.mod_system import load_mod_runtime
package = Path("src/bxi_example_py_elf3")
base = yaml.safe_load((package / "config/elf3_state_machine.yaml").read_text())
runtime = load_mod_runtime(base, built_in_root=package / "mods")
print([mod.id for mod in runtime.mods])
print(sorted(runtime.state_factories))
runtime.close()当前默认树应发现 4 个 Mod 和 14 个状态。