node-red-node-rdk-tools
Version:
配合RDK硬件及TROS使用的Node-RED功能包(Node-RED nodes for using TROS on a RDK hardware and TROS)
293 lines (292 loc) • 8.92 kB
JSON
[
{
"id": "hand_landmarks_tab",
"type": "tab",
"label": "人手关键点及手势识别(MediaPipe)",
"info": "S100人手关键点及手势识别(MediaPipe) - 一键启动"
},
{
"id": "inject_mipi_start",
"type": "inject",
"z": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"name": "MIPI检测启动器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/palm_detection_mediapipe/config/ . 2>/dev/null || true && cp -r /opt/tros/humble/lib/hand_landmarks_mediapipe/config/ . 2>/dev/null || true && export CAM_TYPE=mipi && echo \"启动MIPI摄像头人手关键点检测...\" && ros2 launch hand_landmarks_mediapipe hand_landmarks.launch.py",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"name": "USB检测启动器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/palm_detection_mediapipe/config/ . 2>/dev/null || true && cp -r /opt/tros/humble/lib/hand_landmarks_mediapipe/config/ . 2>/dev/null || true && export CAM_TYPE=usb && echo \"启动USB摄像头人手关键点检测...\" && ros2 launch hand_landmarks_mediapipe hand_landmarks.launch.py",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"name": "本地图片检测器",
"command": "cd /tmp && source /opt/tros/humble/setup.bash && cp -r /opt/tros/humble/lib/palm_detection_mediapipe/config/ . 2>/dev/null || true && cp -r /opt/tros/humble/lib/hand_landmarks_mediapipe/config/ . 2>/dev/null || true && export CAM_TYPE=fb && echo \"启动本地图片人手关键点检测...\" && ros2 launch hand_landmarks_mediapipe hand_landmarks.launch.py publish_image_source:=config/example.jpg publish_image_format:=jpg publish_output_image_w:=640 publish_output_image_h:=480",
"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": "hand_landmarks_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": 300,
"wires": [["openurl_browser"]]
},
{
"id": "openurl_browser",
"type": "rdk-tools openurl",
"z": "hand_landmarks_tab",
"name": "",
"x": 380,
"y": 300,
"wires": []
},
{
"id": "inject_stop",
"type": "inject",
"z": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"name": "停止所有服务",
"command": "sudo pkill -9 -f hobot_usb_cam; sudo pkill -9 -f hand_landmarks_mediapipe; sudo pkill -9 -f palm_detection_mediapipe; 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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"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": "hand_landmarks_tab",
"name": "停止服务状态",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 640,
"y": 360,
"wires": []
}
]