A Node in Node-Red To Control Parrot Drones: Instructables
A Node in Node-Red To Control Parrot Drones: Instructables
by alronz
Parrot has many interesting drones such as Bebop, main nodes to control and monitor the data of the
Swing, AR and the Jumping mini drones that can be drone. Currently this node supports only Parrot
controlled and monitored easily using their Android, Jumping mini drones, but the future goal is to support
IOS apps . Parrot provides also an open source SDK all other drones. In this instructable, I will show how
that can be used to write custom applications to to create a simple application using my node to
control them. In this instructable, I will show you how control Parrot Jumping race drone and to monitor its
to use Node-Red which is an open-source graphical data using a nice UI dashboard as shown in the
tool that allows users to wire together hardware screen shot. The video below shows what will be
devices, APIs and applications in an easy drag-and- produced at the end of this instructable:
drop way. Node-Red uses a set of what is called
"Nodes" that are written in javascript and can be
//www.youtube.com/embed/uxqxCBsrc5A
installed using npm. The nodes can be connected
together to produce an application. To use Node-Red
Now let's start with the steps:
to control Parrot drones, I have created a Node called
"node-red-contrib-parrot-drones" that contains two
Install the node I created which will be used to control the Parrot drone (as of now only Jumping Drones are
supported). Use the below command:
npm i node-red-contrib-parrot-drones
Alternatively you can use "Manage palette" option in Node-Red UI and search for the node name.
Alternatively you can use "Manage palette" option in Node-Red UI and search for the node name.
Status","group":"Data","order":1,"format":" Status","group":"Data","order":1,"format":"
{{msg.payload.posture}}","x":747,"y":238,"wires":[]}, {{msg.payload.batteryStatus}}","x":740.5,"y":185,"wire
{"id":"63758a61.c32d54","type":"ui_text","z":"c560f4ff. s":[]},
b48658","tab":"aec1e0f8.c48b4","name":"Drone {"id":"df9a2af4.9817d8","type":"switch","z":"c560f4ff.b
Status","group":"Data","order":1,"format":" 48658","name":"","property":"topic","propertyType":"m
{{msg.payload.status}}","x":734.5,"y":289,"wires":[]}, sg","rules":[{"t":"eq","v":"batteryPercentage","vt":"str"},
{"id":"e8dc38cc.64e188","type":"ui_text","z":"c560f4ff. {"t":"eq","v":"batteryStatus","vt":"str"},
b48658","tab":"aec1e0f8.c48b4","name":"Jump Load {"t":"eq","v":"posture","vt":"str"},
Status","group":"Data","order":1,"format":" {"t":"eq","v":"status","vt":"str"},
{{msg.payload.jumpLoad}}","x":759.5,"y":343,"wires": {"t":"eq","v":"jumpLoad","vt":"str"},
[]}, {"t":"eq","v":"jumpMotor","vt":"str"},
{"id":"9310d160.4c77d","type":"ui_text","z":"c560f4ff.b {"t":"eq","v":"message","vt":"str"}],"checkall":"true","ou
48658","tab":"aec1e0f8.c48b4","name":"Jump Motor tputs":7,"x":344,"y":255,"wires":[["8209fbee.1afdb8"],
Status","group":"Data","order":1,"format":" ["3742a1ee.5b2ebe"],["d48ed1a5.b6436"],
{{msg.payload.jumpMotor}}","x":752.5,"y":402,"wires": ["63758a61.c32d54"],["e8dc38cc.64e188"],
[]}, ["9310d160.4c77d"],
{"id":"d5ee8c50.8f28b","type":"ui_text","z":"c560f4ff.b ["d5ee8c50.8f28b","eb5f127c.3ed38","1ba3b1fb.5c0b
48658","tab":"aec1e0f8.c48b4","name":"Messages"," ce"]]},
group":"Data","order":1,"format":" {"id":"eb5f127c.3ed38","type":"switch","z":"c560f4ff.b4
{{msg.payload.message}}","x":730.5,"y":458,"wires": 8658","name":"","property":"payload.buf","propertyTy
[]}, pe":"msg","rules":
{"id":"3742a1ee.5b2ebe","type":"ui_text","z":"c560f4ff. [{"t":"nnull"}],"checkall":"true","outputs":1,"x":368,"y":5
b48658","tab":"aec1e0f8.c48b4","name":"Battery 13,"wires":[["7e79f4c2.bfd0ec"]]},
{"id":"c8897980.48bd18","type":"debug","z":"c560f4ff.
b48658","name":"","active":true,"console":"false","co
mplete":"true","x":719.5,"y":660,"wires":[]},
{"id":"7e79f4c2.bfd0ec","type":"function","z":"c560f4ff.
b48658","name":"","func":"var originalBuf =
msg.payload.buf;\nvar buf = new
Buffer(originalBuf);\nmsg.payload =
buf;\nmsg.payload.image = true;\nreturn
msg;\n","outputs":1,"noerr":0,"x":515,"y":521,"wires": Percentage","group":"Data","order":1,"format":"
[["da8b21cb.331d2","c8897980.48bd18"]]}, {{msg.payload.batteryPercentage}}","x":742.5,"y":126,
{"id":"b7c91a07.d30a18","type":"ui_template","z":"c56 "wires":[]},{"id":"c1e2cbff.a51ca8","type":"drone-
0f4ff.b48658","tab":"aec1e0f8.c48b4","name":"","grou config","z":"","ip":"192.168.2.1","droneType":"Jumping
p":"Image","order":1,"format":"","storeOutMessages":t
rue,"fwdInMessages":true,"x":1002,"y":616,"wires":
[[]]},
{"id":"da8b21cb.331d2","type":"switch","z":"c560f4ff.b
Start the Node-Red flow be clicking the "deploy" red button in the right top corner.
You can now control the drone easily and access its data including video frames "images" from the dashboard that
can be accessed using "http://127.0.0.1:1880/ui" as shown in the screen shot.
There are many great IBM Watson services that have nodes in Node-Red and can be integrated with my node to
produce cool ideas. Examples are below:
Use Speech-to-Text, Text-to-Speech nodes to control and interact with your drone.
Use Visual Recognition node to identify objects, faces, and images returned by the drone and
control the drone accordingly.
Ofcourse, you can control your drone from the internet using IBM IoT platform using this node.
Control the drone based on user mood and behavior using Personality Insights, or Tone Analyzer
nodes.
Sky is the limit, please see the other possible nodes.
Thanks Ahmed :)
Viel Erfolg
Thanks Basma :)
Thanks Swansong :)