From 4ba0f63758653a1992e1ca4be99fcd1b01283606 Mon Sep 17 00:00:00 2001 From: LengedZhao <867178694@qq.com> Date: Mon, 10 Aug 2026 16:01:28 +0800 Subject: [PATCH] fix: use complete vendor message overlay for rosbag --- docs/天工3.0本地同构臂遥操迁移部署指南.md | 7 +++++-- tg3_local_teleop/README.md | 4 ++++ tg3_local_teleop/run_data_recorder.sh | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/天工3.0本地同构臂遥操迁移部署指南.md b/docs/天工3.0本地同构臂遥操迁移部署指南.md index 2546470..fd9e2f3 100644 --- a/docs/天工3.0本地同构臂遥操迁移部署指南.md +++ b/docs/天工3.0本地同构臂遥操迁移部署指南.md @@ -1052,8 +1052,11 @@ systemctl --user enable --now tg3-data-recorder.service systemctl --user restart tg3-local-teleop.service ``` -录制脚本必须能依次加载 `/opt/ros/jazzy`、`/home/nvidia/xos`、 -`/opt/robot_tele_server/install` 和本项目 `ros2_py/install`;否则自定义消息可能无法解码。 +录制脚本必须依次加载 `/opt/ros/jazzy`、`/home/nvidia/xos` 和 +`/opt/robot_tele_server/install`,但**不能**再加载本项目 `ros2_py/install`。后者是桥接 +Python 进程专用的最小 `ArmStatus` 绑定,会遮蔽厂家完整 `ros2_bridge_msgs` C++ 库,导致 +rosbag 加载 `RobotState/ArmCtrl` 时出现 undefined symbol。`run.sh` 仍需项目 overlay; +`run_data_recorder.sh` 只用厂家完整消息 overlay。 还需 Python 3 的 PyYAML(Ubuntu 包 `python3-yaml`)解析 rosbag metadata。 迁移时在 `config.toml [data_collection]` 核对 `base_directory`、20 GiB 余量、30 分钟上限、 明确 topic 白名单和 required topics。不要改成 `ros2 bag record -a`,相机/点云需另行估算 diff --git a/tg3_local_teleop/README.md b/tg3_local_teleop/README.md index ac4a0d3..3fee2de 100644 --- a/tg3_local_teleop/README.md +++ b/tg3_local_teleop/README.md @@ -179,6 +179,10 @@ MCAP 使用 `zstd_fast`、64 MiB cache、每 300 秒分片;每条 episode 最 `manifest.json` 和 `READY`,最后才原子进入 `ready/`。Nvidia 需已安装 `python3-yaml` (现场已验证 PyYAML 6.0.1)。 +录制服务只加载厂家完整 `/opt/robot_tele_server/install` 消息 overlay,不加载本项目 +`ros2_py/install`;项目 overlay 仅供桥的 Python `ArmStatus` 绑定使用。两者混在同一个 +rosbag 环境会让部分 `ros2_bridge_msgs` C++ 类型支持出现动态库符号冲突。 + 部署两个机器人侧服务: ```bash diff --git a/tg3_local_teleop/run_data_recorder.sh b/tg3_local_teleop/run_data_recorder.sh index 47be1bb..189d354 100755 --- a/tg3_local_teleop/run_data_recorder.sh +++ b/tg3_local_teleop/run_data_recorder.sh @@ -9,7 +9,6 @@ required_setups=( /opt/ros/jazzy/setup.bash /home/nvidia/xos/setup.bash /opt/robot_tele_server/install/setup.bash - "$APP_DIR/ros2_py/install/setup.bash" ) for setup_file in "${required_setups[@]}"; do if [[ ! -f "$setup_file" ]]; then @@ -19,6 +18,12 @@ for setup_file in "${required_setups[@]}"; do # shellcheck disable=SC1090 source "$setup_file" done + +# Do not source $APP_DIR/ros2_py here. That deliberately minimal package only +# supplies the two Python wire types used by tg3_local_teleop.py; placing its +# partial ros2_bridge_msgs libraries ahead of the vendor's complete C++ package +# makes rosbag2 fail to load RobotState/ArmCtrl type support. The recorder must +# use /opt/robot_tele_server/install for the complete vendor message package. set -u exec python3 "$APP_DIR/data_recorder_node.py" \