UNPKG

@droneblocks/node-red-dexi

Version:

You want to make sure you don't lose any of your flow development. Make sure to map the host "flows" directory to the container directory as shown below. This will store the flow on your host machine if/when the container is destroyed.

2,132 lines 112 kB
[ { "id": "d94edfc7200152be", "type": "tab", "label": "PX4 Telemetry", "disabled": true, "info": "", "env": [] }, { "id": "a691db1a9e113a84", "type": "tab", "label": "PX4 Arm, Takeoff, and Land", "disabled": false, "info": "", "env": [] }, { "id": "3f767aee767c6d1c", "type": "tab", "label": "DEXI Offboard Manager", "disabled": true, "info": "", "env": [] }, { "id": "e768c19cc0da9678", "type": "tab", "label": "PX4 Raw Offboard Demo", "disabled": true, "info": "", "env": [] }, { "id": "6fe657fb81fc95dd", "type": "tab", "label": "AVR Mission 1", "disabled": true, "info": "", "env": [] }, { "id": "8c0ec1ac3b0c99c6", "type": "tab", "label": "Laser", "disabled": true, "info": "", "env": [] }, { "id": "2131ca674bcfee95", "type": "tab", "label": "Video iframe", "disabled": true, "info": "", "env": [] }, { "id": "ad6fab15d3c693a6", "type": "tab", "label": "Pi Camera Subscriber", "disabled": true, "info": "", "env": [] }, { "id": "d9d5e5a92e3df57a", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "27129f80a96ce509", "type": "ros2-websocket-server", "url": "ws://192.168.6.182:9090" }, { "id": "5788a4cce510d440", "type": "ui_base", "theme": { "name": "theme-light", "lightTheme": { "default": "#0094CE", "baseColor": "#0094CE", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": true, "reset": false }, "darkTheme": { "default": "#097479", "baseColor": "#097479", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": false }, "customTheme": { "name": "Untitled Theme 1", "default": "#4B7930", "baseColor": "#4B7930", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" }, "themeState": { "base-color": { "default": "#0094CE", "value": "#0094CE", "edited": false }, "page-titlebar-backgroundColor": { "value": "#0094CE", "edited": false }, "page-backgroundColor": { "value": "#fafafa", "edited": false }, "page-sidebar-backgroundColor": { "value": "#ffffff", "edited": false }, "group-textColor": { "value": "#1bbfff", "edited": false }, "group-borderColor": { "value": "#ffffff", "edited": false }, "group-backgroundColor": { "value": "#ffffff", "edited": false }, "widget-textColor": { "value": "#111111", "edited": false }, "widget-backgroundColor": { "value": "#0094ce", "edited": false }, "widget-borderColor": { "value": "#ffffff", "edited": false }, "base-font": { "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" } }, "angularTheme": { "primary": "indigo", "accents": "blue", "warn": "red", "background": "grey", "palette": "light" } }, "site": { "name": "Node-RED Dashboard", "hideToolbar": "false", "allowSwipe": "false", "lockMenu": "false", "allowTempTheme": "true", "dateFormat": "DD/MM/YYYY", "sizes": { "sx": 48, "sy": 48, "gx": 6, "gy": 6, "cx": 6, "cy": 6, "px": 0, "py": 0 } } }, { "id": "2ee38794734c2d27", "type": "ui_tab", "name": "AVR Mission 1", "icon": "dashboard", "order": 2, "disabled": false, "hidden": false }, { "id": "4166ed8cf4b1e7d4", "type": "ui_group", "name": "Main", "tab": "2ee38794734c2d27", "order": 1, "disp": true, "width": 12, "collapse": false, "className": "" }, { "id": "8925e2a4ea9f1164", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 2, "width": 3, "height": 1 }, { "id": "abe39b768890b435", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 4, "width": 3, "height": 1 }, { "id": "e6eba801bf9dd9d2", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 5, "width": 3, "height": 1 }, { "id": "95cc5720a331dc0c", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 6, "width": 3, "height": 1 }, { "id": "ee9a745fa0a0d671", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 7, "width": 3, "height": 1 }, { "id": "76c130a2b7ab488e", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 8, "width": 3, "height": 1 }, { "id": "0acdc4fa5cc98536", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 9, "width": 3, "height": 1 }, { "id": "270b6da83bfd6649", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 10, "width": 3, "height": 1 }, { "id": "95cc3655525f2ec9", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 11, "width": 3, "height": 1 }, { "id": "dfe4e6e5d1cb542b", "type": "ui_spacer", "z": "2131ca674bcfee95", "name": "spacer", "group": "4166ed8cf4b1e7d4", "order": 12, "width": 3, "height": 1 }, { "id": "02a0349dc0753d7c", "type": "ui_tab", "name": "PX4 Raw Offboard", "icon": "Tab 1", "order": 3, "disabled": false, "hidden": false }, { "id": "5e97842196ee06b6", "type": "ui_group", "name": "Main", "tab": "02a0349dc0753d7c", "order": 1, "disp": true, "width": "10", "collapse": false, "className": "" }, { "id": "7d60b4a56db9b8f8", "type": "ui_tab", "name": "PX4 Telemetry", "icon": "dashboard", "order": 1, "disabled": false, "hidden": false }, { "id": "c38375f8835ceadf", "type": "ui_group", "name": "Main", "tab": "7d60b4a56db9b8f8", "order": 1, "disp": true, "width": 6, "collapse": false, "className": "" }, { "id": "20e24e9a9250368a", "type": "ros2-subscribe", "z": "d94edfc7200152be", "server": "27129f80a96ce509", "topicname": "/fmu/out/vehicle_odometry", "messagetype": "", "x": 250, "y": 220, "wires": [ [ "48d2fb203d115b77" ] ] }, { "id": "6c40e4ee73b6af52", "type": "ui_text", "z": "d94edfc7200152be", "group": "c38375f8835ceadf", "order": 2, "width": 0, "height": 0, "name": "", "label": "x position:", "format": "{{msg.payload.position[0]}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 750, "y": 160, "wires": [] }, { "id": "e0ce675c6e15fafb", "type": "debug", "z": "d94edfc7200152be", "name": "print odometry", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 760, "y": 100, "wires": [] }, { "id": "988563c0b019fbe9", "type": "ros2-subscribe", "z": "d94edfc7200152be", "server": "27129f80a96ce509", "topicname": "/fmu/out/sensor_combined", "messagetype": "", "x": 250, "y": 700, "wires": [ [ "df4954c0e0477871" ] ] }, { "id": "2a4377c1ab9d4cb0", "type": "debug", "z": "d94edfc7200152be", "name": "print sensor into", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 760, "y": 700, "wires": [] }, { "id": "48d2fb203d115b77", "type": "delay", "z": "d94edfc7200152be", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 510, "y": 220, "wires": [ [ "e0ce675c6e15fafb", "6c40e4ee73b6af52", "3c4e0ba0bc7de073", "7b7ab675c9581bdb" ] ] }, { "id": "3c4e0ba0bc7de073", "type": "ui_text", "z": "d94edfc7200152be", "group": "c38375f8835ceadf", "order": 3, "width": 0, "height": 0, "name": "", "label": "y position:", "format": "{{msg.payload.position[1]}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 750, "y": 220, "wires": [] }, { "id": "7b7ab675c9581bdb", "type": "ui_text", "z": "d94edfc7200152be", "group": "c38375f8835ceadf", "order": 4, "width": 0, "height": 0, "name": "", "label": "z position:", "format": "{{msg.payload.position[2]}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 750, "y": 280, "wires": [] }, { "id": "df4954c0e0477871", "type": "delay", "z": "d94edfc7200152be", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 510, "y": 700, "wires": [ [ "2a4377c1ab9d4cb0" ] ] }, { "id": "06c9341c5853c3b0", "type": "ros2-subscribe", "z": "d94edfc7200152be", "server": "27129f80a96ce509", "topicname": "/fmu/out/battery_status", "messagetype": "", "x": 240, "y": 380, "wires": [ [ "96cb415e914805b7" ] ] }, { "id": "9df450188c95d188", "type": "debug", "z": "d94edfc7200152be", "name": "print battery into", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 760, "y": 380, "wires": [] }, { "id": "96cb415e914805b7", "type": "delay", "z": "d94edfc7200152be", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 510, "y": 380, "wires": [ [ "9df450188c95d188", "1f97085f5b3ab281" ] ] }, { "id": "1f97085f5b3ab281", "type": "ui_text", "z": "d94edfc7200152be", "group": "c38375f8835ceadf", "order": 1, "width": 0, "height": 0, "name": "", "label": "battery remaining:", "format": "{{msg.payload.remaining}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 770, "y": 440, "wires": [] }, { "id": "c34cfda6f5e986c8", "type": "ros2-subscribe", "z": "d94edfc7200152be", "server": "27129f80a96ce509", "topicname": "/fmu/out/vehicle_status", "messagetype": "", "x": 240, "y": 520, "wires": [ [ "54b642d806f41e64" ] ] }, { "id": "10e7e3d62246b870", "type": "debug", "z": "d94edfc7200152be", "name": "print vehicle status", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 770, "y": 520, "wires": [] }, { "id": "54b642d806f41e64", "type": "delay", "z": "d94edfc7200152be", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 510, "y": 520, "wires": [ [ "10e7e3d62246b870", "a07e291714f0d141" ] ] }, { "id": "a07e291714f0d141", "type": "ui_text", "z": "d94edfc7200152be", "group": "c38375f8835ceadf", "order": 1, "width": 0, "height": 0, "name": "", "label": "flight mode:", "format": "{{msg.payload.nav_state}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 750, "y": 580, "wires": [] }, { "id": "ae776f6d1da02661", "type": "ui_text", "z": "a691db1a9e113a84", "group": "4166ed8cf4b1e7d4", "order": 14, "width": 0, "height": 0, "name": "", "label": "Altitude", "format": "{{msg.payload}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 820, "y": 60, "wires": [] }, { "id": "124ecd64576594fd", "type": "ros2-subscribe", "z": "a691db1a9e113a84", "server": "27129f80a96ce509", "topicname": "/fmu/out/vehicle_global_position", "messagetype": "", "x": 130, "y": 180, "wires": [ [ "dbbf851b16148a77" ] ] }, { "id": "8eeeac07046c07bc", "type": "function", "z": "a691db1a9e113a84", "name": "round altitude", "func": "msg.payload = Math.round((msg.payload.alt) * 100) / 100\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 580, "y": 80, "wires": [ [ "ae776f6d1da02661", "dbb0a6a6836672cb" ] ] }, { "id": "dbb0a6a6836672cb", "type": "change", "z": "a691db1a9e113a84", "name": "", "rules": [ { "t": "set", "p": "drone_altitude", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 860, "y": 120, "wires": [ [] ] }, { "id": "86049deb15395654", "type": "debug", "z": "a691db1a9e113a84", "name": "debug 5", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 460, "y": 460, "wires": [] }, { "id": "ba286d4657da79aa", "type": "ros2-publish", "z": "a691db1a9e113a84", "server": "27129f80a96ce509", "topicname": "/fmu/in/vehicle_command", "messagetype": "px4_msgs/msg/VehicleCommand", "stampheader": false, "x": 510, "y": 380, "wires": [ [] ] }, { "id": "dbbf851b16148a77", "type": "delay", "z": "a691db1a9e113a84", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "allowrate": false, "outputs": 1, "x": 370, "y": 180, "wires": [ [ "8eeeac07046c07bc", "a1e737cb92abf1f5", "c395d188ef1c9d18", "6bd891e55027cd3a" ] ] }, { "id": "386e0bdcda50bed8", "type": "arm", "z": "a691db1a9e113a84", "name": "", "x": 310, "y": 340, "wires": [ [ "ba286d4657da79aa" ] ] }, { "id": "4464420002130254", "type": "inject", "z": "a691db1a9e113a84", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 340, "wires": [ [ "386e0bdcda50bed8" ] ] }, { "id": "a1e737cb92abf1f5", "type": "function", "z": "a691db1a9e113a84", "name": "latitude", "func": "msg.payload = msg.payload.lat\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 560, "y": 180, "wires": [ [ "4b71f66bf533618a", "ba80fdd4b8731061" ] ] }, { "id": "6bd891e55027cd3a", "type": "debug", "z": "a691db1a9e113a84", "name": "print drone location", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 310, "y": 80, "wires": [] }, { "id": "c395d188ef1c9d18", "type": "function", "z": "a691db1a9e113a84", "name": "longitude", "func": "msg.payload = msg.payload.lon\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 560, "y": 280, "wires": [ [ "f6c1daa76322acba", "ecb1849d8cdb5fba" ] ] }, { "id": "4b71f66bf533618a", "type": "ui_text", "z": "a691db1a9e113a84", "group": "4166ed8cf4b1e7d4", "order": 14, "width": 0, "height": 0, "name": "", "label": "Latitude", "format": "{{msg.payload}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 820, "y": 180, "wires": [] }, { "id": "f6c1daa76322acba", "type": "ui_text", "z": "a691db1a9e113a84", "group": "4166ed8cf4b1e7d4", "order": 14, "width": 0, "height": 0, "name": "", "label": "Longitude", "format": "{{msg.payload}}", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 820, "y": 300, "wires": [] }, { "id": "ba80fdd4b8731061", "type": "change", "z": "a691db1a9e113a84", "name": "flow.drone_latitude", "rules": [ { "t": "set", "p": "drone_latitude", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 850, "y": 240, "wires": [ [] ] }, { "id": "ecb1849d8cdb5fba", "type": "change", "z": "a691db1a9e113a84", "name": "flow.drone_latitude", "rules": [ { "t": "set", "p": "drone_longitude", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 850, "y": 360, "wires": [ [] ] }, { "id": "3e0c8785a15f6a18", "type": "inject", "z": "a691db1a9e113a84", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 400, "wires": [ [ "9a5933e0dbdaedcc" ] ] }, { "id": "9a5933e0dbdaedcc", "type": "function", "z": "a691db1a9e113a84", "name": "takeoff", "func": "let json = {\n \"command\": 22, \n \"param1\": -1, \n \"param2\": 0, \n \"param3\": 0, \n \"param4\": 0, \n \"param5\": flow.get(\"drone_latitude\"), \n \"param6\": flow.get(\"drone_longitude\"), \n \"param7\": flow.get(\"drone_altitude\") + 3\n}\nmsg.payload = json\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 310, "y": 400, "wires": [ [ "86049deb15395654", "ba286d4657da79aa" ] ] }, { "id": "a3c175e5e85914c8", "type": "land", "z": "a691db1a9e113a84", "name": "", "x": 310, "y": 460, "wires": [ [ "ba286d4657da79aa" ] ] }, { "id": "c2eeada9357d6016", "type": "inject", "z": "a691db1a9e113a84", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 460, "wires": [ [ "a3c175e5e85914c8" ] ] }, { "id": "1c1de41bb485044a", "type": "ros2-publish", "z": "3f767aee767c6d1c", "server": "27129f80a96ce509", "topicname": "/dexi/offboard_manager", "messagetype": "", "stampheader": false, "x": 850, "y": 240, "wires": [ [] ] }, { "id": "dc4e893b18c42a9a", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 300, "y": 160, "wires": [ [ "28d8858874b2ed8c" ] ] }, { "id": "82d80e96b9655371", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 300, "y": 100, "wires": [ [ "87a2f2cf05c31f87" ] ] }, { "id": "87a2f2cf05c31f87", "type": "arm", "z": "3f767aee767c6d1c", "name": "", "x": 470, "y": 100, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "30912c788cfaadb3", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 300, "y": 340, "wires": [ [ "ffa7c5b61d8bd568" ] ] }, { "id": "ffa7c5b61d8bd568", "type": "land", "z": "3f767aee767c6d1c", "name": "", "x": 470, "y": 340, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "28d8858874b2ed8c", "type": "takeoff", "z": "3f767aee767c6d1c", "name": "", "altitude": "2", "x": 490, "y": 160, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "882cab4293f9e0c0", "type": "forward", "z": "3f767aee767c6d1c", "name": "", "distance": "1", "x": 1290, "y": 60, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "866d2678c8d00a8d", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 60, "wires": [ [ "882cab4293f9e0c0" ] ] }, { "id": "3cdaa5bb28be592a", "type": "offboard", "z": "3f767aee767c6d1c", "action": "stop", "x": 530, "y": 280, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "5053bb6941fd0593", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 300, "y": 280, "wires": [ [ "3cdaa5bb28be592a" ] ] }, { "id": "cf1c03f44806b4bc", "type": "offboard", "z": "3f767aee767c6d1c", "action": "start", "x": 530, "y": 220, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "335e4963eba951b4", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 300, "y": 220, "wires": [ [ "cf1c03f44806b4bc" ] ] }, { "id": "85e5a558b3c3d3b3", "type": "backward", "z": "3f767aee767c6d1c", "name": "", "distance": 1, "x": 1300, "y": 120, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "c0bb30e20f02a00f", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 120, "wires": [ [ "85e5a558b3c3d3b3" ] ] }, { "id": "071b471fc96293c3", "type": "right", "z": "3f767aee767c6d1c", "name": "", "distance": 1, "x": 1280, "y": 180, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "112a8f0e486c38e3", "type": "left", "z": "3f767aee767c6d1c", "name": "", "distance": 1, "x": 1280, "y": 240, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "062188e9ec7c2b4f", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 180, "wires": [ [ "071b471fc96293c3" ] ] }, { "id": "4dbdb3dd00a3fe2d", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 240, "wires": [ [ "112a8f0e486c38e3" ] ] }, { "id": "193c8e27fb0ff0f1", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 300, "wires": [ [ "a00e840f868007b4" ] ] }, { "id": "4cb076ca91be6dde", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 360, "wires": [ [ "436149194175c0e1" ] ] }, { "id": "a00e840f868007b4", "type": "up", "z": "3f767aee767c6d1c", "name": "", "distance": 1, "x": 1280, "y": 300, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "436149194175c0e1", "type": "down", "z": "3f767aee767c6d1c", "name": "", "distance": 1, "x": 1280, "y": 360, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "2dd0241a95457a3b", "type": "yaw_right", "z": "3f767aee767c6d1c", "name": "", "degrees": 90, "x": 1280, "y": 420, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "0ca95155b5909df5", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 420, "wires": [ [ "2dd0241a95457a3b" ] ] }, { "id": "93d521f9dbdd5393", "type": "yaw_left", "z": "3f767aee767c6d1c", "name": "", "degrees": 90, "x": 1280, "y": 480, "wires": [ [ "1c1de41bb485044a" ] ] }, { "id": "414abc3c5802df7d", "type": "inject", "z": "3f767aee767c6d1c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 1100, "y": 480, "wires": [ [ "93d521f9dbdd5393" ] ] }, { "id": "29e53340ef49ce77", "type": "ros2-publish", "z": "e768c19cc0da9678", "server": "27129f80a96ce509", "topicname": "/fmu/in/offboard_control_mode", "messagetype": "px4_msgs/msg/OffboardControlMode", "stampheader": false, "x": 790, "y": 320, "wires": [ [ "1c5fbcfced8f9252", "04b22aa18610eeb5" ] ] }, { "id": "1c5fbcfced8f9252", "type": "delay", "z": "e768c19cc0da9678", "name": "", "pauseType": "delay", "timeout": "100", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 510, "y": 400, "wires": [ [ "e8aa4e2ceaea1f22" ] ] }, { "id": "e8aa4e2ceaea1f22", "type": "function", "z": "e768c19cc0da9678", "name": "offboard heartbeat", "func": "let offboardControlMode = {\n \"position\": true,\n}\n\n// Only send the heartbeat if flight mode is set to offboard\n// if (flow.get(\"current_flight_mode\") == 14) {\n msg.payload = offboardControlMode\n return msg\n// }", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 490, "y": 320, "wires": [ [ "29e53340ef49ce77" ] ] }, { "id": "86ea8d29eb6e3e9c", "type": "ros2-publish", "z": "e768c19cc0da9678", "server": "27129f80a96ce509", "topicname": "/fmu/in/vehicle_command", "messagetype": "px4_msgs/msg/VehicleCommand", "stampheader": false, "x": 590, "y": 680, "wires": [ [] ] }, { "id": "51573c7cbe23531b", "type": "inject", "z": "e768c19cc0da9678", "name": "offboard", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":176,\"param1\":1,\"param2\":6}", "payloadType": "json", "x": 180, "y": 600, "wires": [ [] ] }, { "id": "7ba707f2050653d7", "type": "inject", "z": "e768c19cc0da9678", "name": "hold", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":176,\"param1\":1,\"param2\":4,\"param3\":3}", "payloadType": "json", "x": 190, "y": 640, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "3d6920e4d5733888", "type": "inject", "z": "e768c19cc0da9678", "name": "stabilized", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":176,\"param1\":1,\"param2\":7}", "payloadType": "json", "x": 180, "y": 560, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "41cf150f64cc4078", "type": "comment", "z": "e768c19cc0da9678", "name": "https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/commander/Commander.cpp#L388", "info": "", "x": 400, "y": 460, "wires": [] }, { "id": "a0626b654553fea8", "type": "comment", "z": "e768c19cc0da9678", "name": "https://discuss.px4.io/t/switching-modes-in-px4-using-ros2-and-uxrce-dds/37137/2", "info": "", "x": 350, "y": 500, "wires": [] }, { "id": "e0d61e44670c2ae8", "type": "inject", "z": "e768c19cc0da9678", "name": "arm", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":400,\"param1\":1,\"param2\":0}", "payloadType": "json", "x": 190, "y": 680, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "27cf97d74ed93ddd", "type": "inject", "z": "e768c19cc0da9678", "name": "disarm", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":400,\"param1\":0,\"param2\":0}", "payloadType": "json", "x": 190, "y": 720, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "4a02d7e5afd462ee", "type": "inject", "z": "e768c19cc0da9678", "name": "land", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"command\":21}", "payloadType": "json", "x": 190, "y": 840, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "b5a7ac2a4b0caa1e", "type": "comment", "z": "e768c19cc0da9678", "name": "Start sending the offboard heartbeat message so we can arm in offboard mode", "info": "", "x": 340, "y": 260, "wires": [] }, { "id": "d3a675a7fdec0864", "type": "ui_button", "z": "e768c19cc0da9678", "name": "", "group": "5e97842196ee06b6", "order": 11, "width": 0, "height": 0, "passthru": false, "label": "Arm drone", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "", "payloadType": "date", "topic": "topic", "topicType": "msg", "x": 370, "y": 580, "wires": [ [ "f1b214c36a44691b" ] ] }, { "id": "f3a9816e169032ce", "type": "ui_button", "z": "e768c19cc0da9678", "name": "", "group": "5e97842196ee06b6", "order": 10, "width": 0, "height": 0, "passthru": false, "label": "Offboard flight mode", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "{\"command\":176,\"param1\":1,\"param2\":6}", "payloadType": "json", "topic": "topic", "topicType": "msg", "x": 400, "y": 540, "wires": [ [ "9c7da5306de96025" ] ] }, { "id": "ea35d0e5ae1a6a18", "type": "ui_button", "z": "e768c19cc0da9678", "name": "", "group": "5e97842196ee06b6", "order": 19, "width": 0, "height": 0, "passthru": false, "label": "Land", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "{\"command\":21}", "payloadType": "json", "topic": "topic", "topicType": "msg", "x": 190, "y": 880, "wires": [ [ "86ea8d29eb6e3e9c" ] ] }, { "id": "43d0af16e9fd4786", "type": "ros2-subscribe", "z": "e768c19cc0da9678", "server": "27129f80a96ce509", "topicname": "/fmu/out/vehicle_local_position", "messagetype": "px4_msgs/msg/VehicleLocalPosition", "x": 910, "y": 140, "wires": [ [ "fb76f6ef6ab1088d", "d781f7b43060a939", "15b1e08659d29c42", "32d31555c56c9a05" ] ] }, { "id": "fb76f6ef6ab1088d", "type": "function", "z": "e768c19cc0da9678", "name": "set current heading", "func": "let current_heading = msg.payload.heading\nmsg.payload = Math.round(current_heading * 100) / 100\nflow.set(\"current_heading\", current_heading)\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1190, "y": 240, "wires": [ [ "ac34a5fb077829c6" ] ] }, { "id": "d781f7b43060a939", "type": "function", "z": "e768c19cc0da9678", "name": "set current x", "func": "let x = msg.payload.x\nmsg.payload = Math.round(x * 100) / 100\nflow.set(\"current_x\", x)\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1170, "y": 60, "wires": [ [ "f10eb3165dda1bf0" ] ] }, { "id": "15b1e08659d29c42", "type": "function", "z": "e768c19cc0da9678", "name": "set current y", "func": "let y = msg.payload.y\nmsg.payload = Math.round(y * 100) / 100\nflow.set(\"current_y\", y)\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1170, "y": 120, "wires": [ [ "ab94c08e491c6c7d" ] ] }, { "id": "32d31555c56c9a05", "type": "function", "z": "e768c19cc0da9678", "name": "set current z", "func": "let z = msg.payload.z\nmsg.payload = Math.round(z * 100) / 100\nflow.set(\"current_z\", z)\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1170, "y": 180, "wires": [ [ "34a22118c0caf87f" ] ] }, { "id": "f10eb3165dda1bf0", "type": "ui_text", "z": "e768c19cc0da9678", "group": "5e978421