I will introduce the technique that I used to make a drone using RaspberryPi and Google VoiceKit by Python. The VoiceKit looks like making a smart speaker in combination with a RaspberryPy, but it can move up to 4 motors and servos with a simple Python code, too. And I’ll do a flying demonstration.
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
Making a Drone by Python using RaspberryPi and Google VoiceKit
1. Make a Drone using
RaspberryPi and Google
VoiceKit by Python
@ selina787b
18 Sep 2018 /O ta-ku Sangyo P laza
P IO
#pyconjp #pyconjp_2
2. Talk Description
✢ Self-introduction
✢ About Drone &P urpose
✢ Whatyou cando with Drone
✢ Description of R aspberryP i and G oogle VoiceKit
✢ How to made it
✢ P ython code &Impression
✢ Flying demonstration
Let's start!
2
4. Hello!
IamLinaKATAYO SE (Selina)
I'm longing to fly inthe sky,because of majoring in
aerospace studies. Inthefuture Iwould like to flythesky
with myown aircraft. Imade moegi Inc.
空を飛ぶことに憧れ、航空宇宙学を専攻。
将来は自分の作った航空機で空を飛びたいと思っている。(株)moegi代表
4
@ selina787
b
6. About Drone
✢ 人を乗せずに遠隔操作や自律制御によって飛行する
航空機のこと。
✢ Drones are aircraft that fly by remote control
or autonomous control without having a crew
member on board.
To fly, permission /approval by the Ministryof
Land, Infrastructure and Transportisnecessary.
飛行させるためには国土交通省の許可・承認が必要です。
6
16. RaspberryPi
The R aspberry P i is atinyand
affordable computerthatyou
can usetolearn programming
through fun, practicalprojects.
Description of RaspberryPi and Google VoiceKit
Voice Kit
Board attachedtoR aspberry P i
There areVer1 andVer2, that isnow
Version 2is sold.
16
17. Description of RaspberryPi and Google VoiceKit
Voice Kit
Board attachedto R aspberry P i
"G oogle AIY Voice Kit" which was releasedlastyearfrom the"G oogle
AIY P roject" sothatcutting edgetechnology AI canbe usedeasilyand
familiarlyin "Makers"enjoying making things
It ispossible tomove motors andservos aswell asvoice-only behavior.
17
18. Description of RaspberryPi and Google VoiceKit
Voice Kit
It is also possible to make intelligent smart speakers
like Google Home or Amazon Echo!
Google HomeやAmazon Echoのような
インテリジェントなスマートスピーカーを作ることも可能!
18
22. Description of RaspberryPi and Google VoiceKit
Voice Kit
That is ... It seems to make everything move!
つまり、なんでも動かせそう!
22
23. Description of RaspberryPi and Google VoiceKit
E asy
Somebeginner
feelsthatelectronic
work is difficult,
but It haveallof
Voice Kit.
Python
It useP ython code.
so P ython userwill
feeleasy.
not E xpensive
It isabout $12 in
US, R aspberry P i
is$35. soit isnot
expensive.
23
Why use it?
ボイスキットは必要
なものが揃っていま
す。必要な所をは
んだ付けするくらい。
ラズベリーパイを使
うのでPythonで動
かせます。しかも少
ないコードで。
ボイスキットは約3000
円、ラズベリーパイは約
5000円で売っています。
(日本)
32. Python code
32
Voise Command example
import aiy.audio
import aiy.cloudspeech
import aiy.voicehat
from gpiozero import PWMOutputDevice
def main():
recognizer = aiy.cloudspeech.get_recognizer()
recognizer.expept_phraze('on')
recognizer.exsept_phraze('off')
button = aiy.voicehat.get_button()
aiy.audio.get_recognizer().start()
pwm = PWMOutputDevice(4)
while True:
print('Press the button and speak')
button.wait_for_press()
print('Listening...')
text = recognizer.recognize()
if text is None:
print('Sorry, I did not hear you.')
else:
print('You said "', text, '"')
if 'on' in text:
print('Turning motor on')
pwm.off()
elif 'off' in text:
print('Turning motor off')
pwm.off()
if __name__ == '__main__':
main()
34. Python code & Impressions
✢ 電流が足らない問題。(悩む)
✢ Drones are aircraft that fly by remote control
or autonomous control without having a crew
member on board.
To fly, permission /approval by the Ministryof
Land, Infrastructure and Transportisnecessary.
今回の制作に関して、実験はうまく行っていたが、モーターを同時に回すための電流ゅ
が足らないことが発覚、途中、リレーを使用する回路に切り替えたが、それでも不十
分。現在はその電流問題を何とか解決したいと考えている。
34