node-red-node-rdk-tools
Version:
配合RDK硬件及TROS使用的Node-RED功能包(Node-RED nodes for using TROS on a RDK hardware and TROS)
278 lines (277 loc) • 8.51 kB
JSON
[
{
"id": "tab1",
"type": "tab",
"label": "S100 Pose Detection",
"info": "S100人体检测和跟踪(YOLO Pose) - 一键启动"
},
{
"id": "inject_mipi_start",
"type": "inject",
"z": "tab1",
"name": "MIPI摄像头检测",
"props": [{"p":"payload"},{"p":"topic","vt":"str"}],
"repeat": "",
"crontab": "",
"once": false,
"topic": "mipi_detection",
"payload": "start",
"payloadType": "str",
"x": 140,
"y": 100,
"wires": [["exec_mipi_detection"]]
},
{
"id": "exec_mipi_detection",
"type": "exec",
"z": "tab1",
"name": "MIPI检测启动器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/mono2d_body_detection/config/ . 2>/dev/null || true && export CAM_TYPE=mipi && echo \"启动MIPI摄像头人体检测...\" && ros2 launch mono2d_body_detection mono2d_body_detection.launch.py kps_model_type:=1 kps_image_width:=1920 kps_image_height:=1080 kps_model_file_name:=config/yolo11x_pose_nashe_640x640_nv12.hbm",
"addpay": false,
"append": "",
"useSpawn": false,
"timer": "120",
"oldrc": false,
"x": 380,
"y": 100,
"wires": [["debug_mipi_output"],["debug_mipi_error"],[]]
},
{
"id": "inject_usb_start",
"type": "inject",
"z": "tab1",
"name": "USB摄像头检测",
"props": [{"p":"payload"},{"p":"topic","vt":"str"}],
"repeat": "",
"crontab": "",
"once": false,
"topic": "usb_detection",
"payload": "start",
"payloadType": "str",
"x": 140,
"y": 160,
"wires": [["exec_usb_detection"]]
},
{
"id": "exec_usb_detection",
"type": "exec",
"z": "tab1",
"name": "USB检测启动器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/mono2d_body_detection/config/ . 2>/dev/null || true && export CAM_TYPE=usb && echo \"启动USB摄像头人体检测...\" && ros2 launch mono2d_body_detection mono2d_body_detection.launch.py kps_model_type:=1 kps_image_width:=1920 kps_image_height:=1080 kps_model_file_name:=config/yolo11x_pose_nashe_640x640_nv12.hbm",
"addpay": false,
"append": "",
"useSpawn": false,
"timer": "120",
"oldrc": false,
"x": 380,
"y": 160,
"wires": [["debug_usb_output"],["debug_usb_error"],[]]
},
{
"id": "inject_fb_start",
"type": "inject",
"z": "tab1",
"name": "本地图片检测",
"props": [{"p":"payload"},{"p":"topic","vt":"str"}],
"repeat": "",
"crontab": "",
"once": false,
"topic": "fb_detection",
"payload": "start",
"payloadType": "str",
"x": 140,
"y": 220,
"wires": [["exec_fb_detection"]]
},
{
"id": "exec_fb_detection",
"type": "exec",
"z": "tab1",
"name": "本地图片检测器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/mono2d_body_detection/config/ . 2>/dev/null || true && cp -r /opt/tros/humble/lib/dnn_node_example/config/ . 2>/dev/null || true && export CAM_TYPE=fb && echo \"启动本地图片人体检测...\" && ros2 launch mono2d_body_detection mono2d_body_detection.launch.py publish_image_source:=config/person_body.jpg publish_image_format:=jpg kps_model_type:=1 kps_image_width:=640 kps_image_height:=640 kps_model_file_name:=config/yolo11x_pose_nashe_640x640_nv12.hbm",
"addpay": false,
"append": "",
"useSpawn": false,
"timer": "60",
"oldrc": false,
"x": 380,
"y": 220,
"wires": [["debug_fb_output"],["debug_fb_error"],[]]
},
{
"id": "inject_browser",
"type": "inject",
"z": "tab1",
"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": 300,
"wires": [["openurl_browser"]]
},
{
"id": "openurl_browser",
"type": "rdk-tools openurl",
"z": "tab1",
"name": "",
"x": 380,
"y": 300,
"wires": []
},
{
"id": "inject_stop",
"type": "inject",
"z": "tab1",
"name": "停止所有服务",
"props": [{"p":"payload"},{"p":"topic","vt":"str"}],
"repeat": "",
"crontab": "",
"once": false,
"topic": "stop",
"payload": "stop",
"payloadType": "str",
"x": 140,
"y": 360,
"wires": [["exec_stop_all"]]
},
{
"id": "exec_stop_all",
"type": "exec",
"z": "tab1",
"name": "停止所有服务",
"command": "sudo pkill -9 -f hobot_usb_cam; sudo pkill -9 -f hobot_dosod; 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": 360,
"wires": [["debug_stop_info"],[],[]]
},
{
"id": "debug_mipi_output",
"type": "debug",
"z": "tab1",
"name": "MIPI检测输出",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 650,
"y": 80,
"wires": []
},
{
"id": "debug_mipi_error",
"type": "debug",
"z": "tab1",
"name": "MIPI错误信息",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 120,
"wires": []
},
{
"id": "debug_usb_output",
"type": "debug",
"z": "tab1",
"name": "USB检测输出",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 650,
"y": 140,
"wires": []
},
{
"id": "debug_usb_error",
"type": "debug",
"z": "tab1",
"name": "USB错误信息",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 180,
"wires": []
},
{
"id": "debug_fb_output",
"type": "debug",
"z": "tab1",
"name": "本地检测输出",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 650,
"y": 200,
"wires": []
},
{
"id": "debug_fb_error",
"type": "debug",
"z": "tab1",
"name": "本地检测错误",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 240,
"wires": []
},
{
"id": "debug_stop_info",
"type": "debug",
"z": "tab1",
"name": "停止服务状态",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 640,
"y": 360,
"wires": []
}
]