UNPKG

node-red-node-rdk-tools

Version:

配合RDK硬件及TROS使用的Node-RED功能包(Node-RED nodes for using TROS on a RDK hardware and TROS)

199 lines (197 loc) 7.11 kB
[ { "id": "centerpoint_tab", "type": "tab", "label": "激光雷达物体检测 (CenterPoint)", "info": "# 激光雷达物体检测算法示例 (CenterPoint)\n\n**功能说明**:使用激光雷达点云文件回灌,经过推理后将算法结果渲染后的图片msg,通过websocket package实现在PC端浏览器上渲染显示发布的图片和对应的算法结果。\n\n## 🎯 快速开始\n\n### 使用流程\n1. **准备点云文件**:安装时会自动下载并解压点云文件\n2. **启动检测服务**:点击\"启动CenterPoint检测\"按钮\n3. **查看检测结果**:点击\"打开可视化页面\"在浏览器中查看渲染后的图片和算法结果\n4. **停止服务**:完成后点击\"停止所有服务\"\n\n## 支持平台\n- RDK X3 / X5 / S100\n- TROS Humble\n\n## 核心功能\n- 激光雷达点云物体检测\n- 点云数据回灌\n- 算法结果可视化渲染\n- WebSocket实时显示\n\n## 核心通信配置\n\n### WebSocket视频流\n- **视频流地址**: `http://{host}:8000`\n- **图像Topic**: `/image` (渲染后的图片)\n- **检测结果Topic**: 由launch文件配置\n- **性能**: 实时检测,延迟低\n\n## 参数说明\n- **点云数据目录**:`~/centerpoint_data`\n- **QAT目录**:从`hobot_centerpoint`包中链接\n- **Launch文件**:`hobot_centerpoint/hobot_centerpoint.launch.py`\n- **可视化地址**:http://{host}:8000(WebSocket视频流)\n\n## 注意事项\n- 首次使用前需要下载点云文件(安装时自动完成)\n- 确保已安装`hobot_centerpoint` ROS2包\n- 点云文件较大,下载可能需要一些时间" }, { "id": "comment_prepare_section", "type": "comment", "z": "centerpoint_tab", "name": "1️⃣ 准备环境(首次使用)", "info": "安装时会自动下载点云文件并创建符号链接", "x": 200, "y": 40, "wires": [] }, { "id": "comment_start_section", "type": "comment", "z": "centerpoint_tab", "name": "2️⃣ 启动检测服务", "info": "启动CenterPoint激光雷达物体检测", "x": 200, "y": 80, "wires": [] }, { "id": "inject_start", "type": "inject", "z": "centerpoint_tab", "name": "启动CenterPoint检测", "props": [ {"p": "payload"}, {"p": "topic", "vt": "str"} ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "start_detection", "payload": "start", "payloadType": "str", "x": 140, "y": 120, "wires": [["exec_start_centerpoint"]] }, { "id": "exec_start_centerpoint", "type": "exec", "z": "centerpoint_tab", "name": "CenterPoint启动器", "command": "cd /tmp && source /opt/tros/humble/setup.bash && if [ -L qat ]; then rm qat; fi && ln -s `ros2 pkg prefix hobot_centerpoint`/lib/hobot_centerpoint/qat/ qat && ln -sf ~/centerpoint_data centerpoint_data && echo \"=== 启动CenterPoint激光雷达物体检测 ===\" && ros2 launch hobot_centerpoint hobot_centerpoint.launch.py", "addpay": false, "append": "", "useSpawn": false, "timer": "120", "oldrc": false, "x": 380, "y": 120, "wires": [["debug_output"], ["debug_error"], []] }, { "id": "comment_browser_section", "type": "comment", "z": "centerpoint_tab", "name": "3️⃣ 查看检测结果", "info": "在浏览器中查看渲染后的图片和算法结果", "x": 200, "y": 160, "wires": [] }, { "id": "inject_browser", "type": "inject", "z": "centerpoint_tab", "name": "打开可视化页面", "props": [ {"p": "payload"}, {"p": "topic", "vt": "str"} ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "http://{host}:8000", "payloadType": "str", "x": 140, "y": 200, "wires": [["openurl_browser"]] }, { "id": "openurl_browser", "type": "rdk-tools openurl", "z": "centerpoint_tab", "name": "", "x": 380, "y": 200, "wires": [] }, { "id": "comment_stop_section", "type": "comment", "z": "centerpoint_tab", "name": "4️⃣ 停止服务", "info": "停止所有检测相关服务", "x": 200, "y": 240, "wires": [] }, { "id": "inject_stop", "type": "inject", "z": "centerpoint_tab", "name": "停止所有服务", "props": [ {"p": "payload"}, {"p": "topic", "vt": "str"} ], "repeat": "", "crontab": "", "once": false, "topic": "stop", "payload": "stop", "payloadType": "str", "x": 140, "y": 280, "wires": [["exec_stop_all"]] }, { "id": "exec_stop_all", "type": "exec", "z": "centerpoint_tab", "name": "停止所有服务", "command": "sudo pkill -9 -f hobot_usb_cam; sudo pkill -9 -f hobot_centerpoint; sudo pkill -9 -f hobot_codec_republish; sudo pkill -9 -f websocket; sudo pkill -9 -f python3; sudo pkill -9 -f 'ros2 launch'; sudo pkill -9 -f 'ros2 run'; sleep 2; sudo rm -rf /dev/shm/*; ros2 daemon stop 2>/dev/null; sleep 1; echo '✓ 服务已彻底停止,资源已释放'", "addpay": false, "append": "", "useSpawn": false, "timer": "10", "oldrc": false, "x": 380, "y": 280, "wires": [["debug_stop_info"], [], []] }, { "id": "debug_output", "type": "debug", "z": "centerpoint_tab", "name": "检测输出", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 650, "y": 100, "wires": [] }, { "id": "debug_error", "type": "debug", "z": "centerpoint_tab", "name": "错误信息", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 650, "y": 140, "wires": [] }, { "id": "debug_stop_info", "type": "debug", "z": "centerpoint_tab", "name": "停止服务状态", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 640, "y": 280, "wires": [] } ]