node-red-node-rdk-tools
Version:
配合RDK硬件及TROS使用的Node-RED功能包(Node-RED nodes for using TROS on a RDK hardware and TROS)
656 lines • 15 kB
JSON
[
{
"id": "face_age_v2_tab",
"type": "tab",
"label": "TROS Face_Age Detection (Application)",
"disabled": false,
"info": ""
},
{
"id": "group_control_age",
"type": "group",
"z": "face_age_v2_tab",
"name": "核心控制和运行",
"style": {
"fill": "#e3f3d3",
"fill-opacity": "0.6",
"label": true
},
"nodes": [
"change_config_age",
"node_execute_age",
"exec_init_config_age"
],
"x": 334,
"y": 211.5,
"w": 572,
"h": 97
},
{
"id": "group_viz_age",
"type": "group",
"z": "face_age_v2_tab",
"name": "结果可视化",
"style": {
"fill": "#d1e7f5",
"fill-opacity": "0.6",
"label": true
},
"nodes": [
"delay_preview_age",
"set_ws_url_age",
"video_preview_age"
],
"x": 334,
"y": 359,
"w": 392,
"h": 129.5
},
{
"id": "group_update_age",
"type": "group",
"z": "face_age_v2_tab",
"name": "软件包智能更新",
"style": {
"fill": "#fff9c4",
"fill-opacity": "0.6",
"label": true
},
"nodes": [
"smart_update_age",
"change_update_msg_age",
"audio_notify_age"
],
"x": 334,
"y": 79,
"w": 572,
"h": 82
},
{
"id": "inject_usb_age",
"type": "inject",
"z": "face_age_v2_tab",
"name": "启动 (USB摄像头)",
"props": [
{
"p": "payload"
},
{
"p": "camera",
"v": "usb",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 240,
"wires": [
[
"exec_init_config_age"
]
]
},
{
"id": "inject_mipi_age",
"type": "inject",
"z": "face_age_v2_tab",
"name": "启动 (MIPI摄像头)",
"props": [
{
"p": "payload"
},
{
"p": "camera",
"v": "mipi",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 280,
"wires": [
[
"exec_init_config_age"
]
]
},
{
"id": "exec_init_config_age",
"type": "exec",
"z": "face_age_v2_tab",
"g": "group_control_age",
"command": "cp -r /opt/tros/humble/lib/mono2d_body_detection/config/ . || true",
"addpay": false,
"append": "",
"useSpawn": false,
"timer": "",
"oldrc": false,
"name": "初始化配置 (CP)",
"x": 440,
"y": 260,
"wires": [
[
"change_config_age",
"delay_preview_age"
],
[],
[]
]
},
{
"id": "change_config_age",
"type": "change",
"z": "face_age_v2_tab",
"g": "group_control_age",
"name": "配置运行参数",
"rules": [
{
"t": "set",
"p": "launch",
"pt": "msg",
"to": "face_age_detection body_det_face_age_det.launch.py",
"tot": "str"
},
{
"t": "set",
"p": "insert",
"pt": "msg",
"to": "$join(['export CAM_TYPE=', msg.camera])",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 260,
"wires": [
[
"node_execute_age"
]
]
},
{
"id": "node_execute_age",
"type": "rdk-tools checkexecute",
"z": "face_age_v2_tab",
"g": "group_control_age",
"name": "检查并执行",
"x": 810,
"y": 260,
"wires": [
[
"debug_success_age"
],
[
"debug_error_age"
]
]
},
{
"id": "inject_stop_age",
"type": "inject",
"z": "face_age_v2_tab",
"name": "关闭",
"props": [
{
"p": "kill",
"v": "",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 150,
"y": 320,
"wires": [
[
"node_execute_age"
]
]
},
{
"id": "debug_success_age",
"type": "debug",
"z": "face_age_v2_tab",
"name": "正确执行提示",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1040,
"y": 240,
"wires": []
},
{
"id": "debug_error_age",
"type": "debug",
"z": "face_age_v2_tab",
"name": "错误执行提示",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1040,
"y": 280,
"wires": []
},
{
"id": "inject_browser_age",
"type": "inject",
"z": "face_age_v2_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": 520,
"wires": [
[
"open_browser_age"
]
]
},
{
"id": "open_browser_age",
"type": "rdk-tools openurl",
"z": "face_age_v2_tab",
"name": "",
"x": 320,
"y": 520,
"wires": []
},
{
"id": "inject_update_age",
"type": "inject",
"z": "face_age_v2_tab",
"name": "检查更新",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 120,
"wires": [
[
"smart_update_age"
]
]
},
{
"id": "smart_update_age",
"type": "rdk-tools smartupdate",
"z": "face_age_v2_tab",
"g": "group_update_age",
"name": "",
"x": 420,
"y": 120,
"wires": [
[
"change_update_msg_age"
],
[]
]
},
{
"id": "change_update_msg_age",
"type": "change",
"z": "face_age_v2_tab",
"g": "group_update_age",
"name": "更新提示",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "环境检查完成",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 620,
"y": 120,
"wires": [
[
"audio_notify_age"
]
]
},
{
"id": "audio_notify_age",
"type": "rdk-tools texttoaudio",
"z": "face_age_v2_tab",
"g": "group_update_age",
"name": "",
"x": 810,
"y": 120,
"wires": []
},
{
"id": "delay_preview_age",
"type": "delay",
"z": "face_age_v2_tab",
"g": "group_viz_age",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 420,
"y": 400,
"wires": [
[
"set_ws_url_age"
]
]
},
{
"id": "set_ws_url_age",
"type": "change",
"z": "face_age_v2_tab",
"g": "group_viz_age",
"name": "设定视频流",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "ws://{host}:8000",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 430,
"y": 440,
"wires": [
[
"video_preview_age"
]
]
},
{
"id": "video_preview_age",
"type": "rdk-tools videows",
"z": "face_age_v2_tab",
"g": "group_viz_age",
"name": "视频预览",
"fps": "10",
"width": "480",
"active": true,
"x": 620,
"y": 440,
"wires": [
[
"d5abaef56093f17f",
"567daff124eae24f"
],
[
"873053a0c7496f11"
],
[]
]
},
{
"id": "d5abaef56093f17f",
"type": "debug",
"z": "face_age_v2_tab",
"name": "算法结果输出",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 840,
"y": 400,
"wires": []
},
{
"id": "567daff124eae24f",
"type": "switch",
"z": "face_age_v2_tab",
"name": "过滤出\"年龄\"",
"property": "attributes.attributes[0].value",
"propertyType": "msg",
"rules": [
{
"t": "nnull"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 430,
"y": 580,
"wires": [
[
"375b65ada805c773"
]
]
},
{
"id": "119a27fbd303de97",
"type": "rdk-tools output",
"z": "face_age_v2_tab",
"name": "",
"active": true,
"x": 420,
"y": 700,
"wires": []
},
{
"id": "375b65ada805c773",
"type": "change",
"z": "face_age_v2_tab",
"name": "提取不同年龄",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "attributes.attributes[0].value",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 620,
"wires": [
[
"7e1e7f3ce8de6171"
]
]
},
{
"id": "08d1aafd35ef27d8",
"type": "comment",
"z": "face_age_v2_tab",
"name": "名称:TROS应用 人脸年龄检测",
"info": "",
"x": 170,
"y": 40,
"wires": []
},
{
"id": "8934fbd6897de129",
"type": "inject",
"z": "face_age_v2_tab",
"name": "了解更多",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "https://developer.d-robotics.cc/rdk_doc/Robot_development/boxs/body/mono_face_age_detection",
"payloadType": "str",
"x": 420,
"y": 40,
"wires": [
[
"298a991a875b6e5e"
]
]
},
{
"id": "298a991a875b6e5e",
"type": "rdk-tools openurl",
"z": "face_age_v2_tab",
"name": "",
"x": 580,
"y": 40,
"wires": []
},
{
"id": "8a247db0228e2575",
"type": "comment",
"z": "face_age_v2_tab",
"name": "注意:选择对应的摄像头类型",
"info": "",
"x": 180,
"y": 200,
"wires": []
},
{
"id": "6c810924b18baae2",
"type": "comment",
"z": "face_age_v2_tab",
"name": "注意:使用结束后请主动关闭",
"info": "",
"x": 180,
"y": 360,
"wires": []
},
{
"id": "873053a0c7496f11",
"type": "debug",
"z": "face_age_v2_tab",
"name": "性能信息输出",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 840,
"y": 440,
"wires": []
},
{
"id": "7e1e7f3ce8de6171",
"type": "function",
"z": "face_age_v2_tab",
"name": "保留年龄整数部分",
"func": "msg.payload = parseFloat(msg.payload).toFixed(0);\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 450,
"y": 660,
"wires": [
[
"119a27fbd303de97"
]
]
},
{
"id": "1f053f6e05a86856",
"type": "global-config",
"env": [],
"modules": {
"node-red-node-rdk-tools": "0.0.27"
}
}
]