SlideShare a Scribd company logo
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
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
1.
Self-introduction
自己紹介です。よろしくお願いします!
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
2.1
About Drone
すでに知っている方も多いですが、念のため。
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
About Drone
✢ 注意すること(日本国内, 機体200g以上)
✢ To fly adrone, If youmust check J apan rule.
7
About Drone
✢ 国土交通省の許可・承認があれば以下のことが可能。
✢ Whenyou got a permission /approval, youcan
do those.
8
2.2
Purpose
すでに知っている方も多いですが、念のため。
Purpose
✢ Iwant tohack aselling drone.
✢ ドローンをハックしたい。
10
1
Purpose
✢ Iwant tomake dronesthat areaseasy
andsafe aschildrencan make.
✢ ドローンを簡単に飛ばせる仕組みを作りたい。
11
2
Purpose
✢ Iam developing aplatformthatelementary and junior
highschoolstudentscancasuallycreate whilestudying
programming and electronic work.Itiseducational and
not afull-blowndrone development.
✢ 小中学生向け、プログラミング&電子工作の勉強のために。
✢ 気軽に作成できるプラットフォームを開発。
✢ 前回の発表では、ブラシレスモーターを回す仕組みに焦点を
当てたが、今回は以下に簡単にモーターを4つ回しプログラム
で動かすかに焦点を当てた。
(別途進めている。)本格的なドローンはArduinoなどのマイコンを併用予定 12
3
3.
What you can do with Drone
ドローンでできること。
What you can do with Drone
✢ 空撮(映画、ドラマ、CMなど)、捜索、配達など
✢ Skypicture &movie (movies, dramas, CMetc.),
search,delivery etc.
14
4.
Description of RaspberryPi
and Google VoiceKit
ラズベリーパイとボイスキットについての説明
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
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
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
Description of RaspberryPi and Google VoiceKit
Voice Kit
つまり、声で動かすことも可能!
19
Description of RaspberryPi and Google VoiceKit
Voice Kit
It can also move the servo!
サーボを動かすことも可能!
20
Description of RaspberryPi and Google VoiceKit
Voice Kit
It can also move the motor!
モーターを動かすことも可能!
21
Description of RaspberryPi and Google VoiceKit
Voice Kit
That is ... It seems to make everything move!
つまり、なんでも動かせそう!
22
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円で売っています。
(日本)
5.
How to made it
それをどうやって組み込むか。
Description of RaspberryPi and Google VoiceKit
Voice Kit & RaspberryPi
connect bySolder
はんだで線をつなげていく。
25
Python code & Impressions
26
Before talk
Python code & Impressions
27
Before talk
6.
Python code & Impressions
Pythonコードとまとめ。
Python code & Impressions
from gpiozero import PWMOutputDevice
from time import sleep
pwm = PWMOutputDevice(4)
pwm = PWMOutputDevice(17)
pwm = PWMOutputDevice(27)
pwm = PWMOutputDevice(22)
29
1
2
3
4
↑
Rotor
Number
GPIO Number
Python code
30
#上昇&前進
#gpiozeroライブラリから PWMOutputDeviceをインポートします。
from gpiozero import PWMOutputDevice
from time import sleep
# モーターは左上を1とし半時計周りに,2,3,4とする。
# 1をGPIO04,2をGPIO17,3をGPIO27,4をGPIO22とする。
pwm = PWMOutputDevice(4)
pwm2 = PWMOutputDevice(17)
pwm3 = PWMOutputDevice(27)
pwm4 = PWMOutputDevice(22)
#pwm.valueを0.3(30%)で反時計周りに回す。その後、全力で上昇その後前進。
while True:
pwm.value = 0.5
sleep(0.3)
pwm2.value = 0.5
sleep(0.3)
pwm3.value = 0.5
sleep(0.3)
pwm4.value = 0.5
sleep(0.5)
pwm.on()
pwm2.on()
pwm3.on()
pwm4.on()
sleep(2.0)
# 前進
pwm.value = 0.7
pwm4.value = 0.7
sleep(3.0)
# 前進ストップ(反力)
pwm.value = 1.0
pwm4.value = 1.0
pwm2.value = 0.8
pwm3.value = 0.8
sleep(1.2)
#ホバリング
pwm.on()
pwm2.on()
pwm3.on()
pwm4.on()
sleep(2.0)
pwm.value = 0.3
pwm2.value = 0.3
pwm3.value = 0.3
pwm4.value = 0.3
sleep(1.0)
pwm.off()
pwm2.off()
pwm3.off()
pwm4.off()
sleep(3.0)
#上昇前進ストップ&下降を繰り返
す。
Lift off & move to forward
Python code
31
#上昇
#gpiozeroライブラリから PWMOutputDeviceをインポートします。
from gpiozero import PWMOutputDevice
from time import sleep
# モーターは左上を1とし半時計周りに,2,3,4とする。
# 1をGPIO04,2をGPIO17,3をGPIO27,4をGPIO22とする。
pwm = PWMOutputDevice(4)
pwm2 = PWMOutputDevice(17)
pwm3 = PWMOutputDevice(27)
pwm4 = PWMOutputDevice(22)
#pwm.valueを0.3(30%)で反時計周りに回す。その後、全力で上昇
while True:
pwm.value = 0.5
sleep(0.3)
pwm2.value = 0.5
sleep(0.3)
pwm3.value = 0.5
sleep(0.3)
pwm4.value = 0.5
sleep(0.5)
pwm.on()
pwm2.on()
pwm3.on()
pwm4.on()
sleep(3.0)
pwm.value = 0.7
pwm2.value = 0.7
pwm3.value = 0.7
pwm4.value = 0.7
sleep(1.0)
pwm.value = 0.3
pwm2.value = 0.3
pwm3.value = 0.3
pwm4.value = 0.3
sleep(1.0)
pwm.off()
pwm2.off()
pwm3.off()
pwm4.off()
sleep(3.0)
#上昇下降を繰り返す。
Lift off & hovering
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()
Python code & Impressions
https://aiyprojects.withgoogle.co
m/voice-v1/#makers-guide-3-
custom-voice-user-interface
VoiceコントロールはGoogle Cloud に
接続する必要がある。(一部有料)
33
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
7.
Flying demonstration
フライトデモンストレーション
Let'sseethedemonstlation.
36
Thanks!
Anyquestions?
Y ou canfind me at “LinaKATAYOSE”
@ selina787b
lina.katayose@ gmail.com
37
http://se-lina.hatenablog.com/

More Related Content

Similar to Making a Drone by Python using RaspberryPi and Google VoiceKit

Apilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlabApilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlab
Yutaka Kobayshi
 
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Tetsuyuki Kobayashi
 
Raspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-securityRaspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-security
Yamauchi isamu
 
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
Lina Katayose
 
1.29.user,user,user
1.29.user,user,user1.29.user,user,user
1.29.user,user,user
Tonny Xu
 
Api geocoding
Api geocodingApi geocoding
Api geocodingJun Chiba
 
SIerによるSIerのためのRaspberry Pi 入門
SIerによるSIerのためのRaspberry Pi 入門SIerによるSIerのためのRaspberry Pi 入門
SIerによるSIerのためのRaspberry Pi 入門
catmoney
 

Similar to Making a Drone by Python using RaspberryPi and Google VoiceKit (7)

Apilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlabApilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlab
 
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
 
Raspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-securityRaspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-security
 
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
過去2回の登壇内容からのPython×ドローンの進化アップデート内容と今後について展望
 
1.29.user,user,user
1.29.user,user,user1.29.user,user,user
1.29.user,user,user
 
Api geocoding
Api geocodingApi geocoding
Api geocoding
 
SIerによるSIerのためのRaspberry Pi 入門
SIerによるSIerのためのRaspberry Pi 入門SIerによるSIerのためのRaspberry Pi 入門
SIerによるSIerのためのRaspberry Pi 入門
 

More from Lina Katayose

Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけPythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
Lina Katayose
 
Python×ドローンについて過去のPyConJP登壇から今までの進化。
Python×ドローンについて過去のPyConJP登壇から今までの進化。Python×ドローンについて過去のPyConJP登壇から今までの進化。
Python×ドローンについて過去のPyConJP登壇から今までの進化。
Lina Katayose
 
実際にワーケーションを実践して思ったこと。
実際にワーケーションを実践して思ったこと。実際にワーケーションを実践して思ったこと。
実際にワーケーションを実践して思ったこと。
Lina Katayose
 
Raspberry Piを使ったモーターのコントロールと応用
Raspberry Piを使ったモーターのコントロールと応用Raspberry Piを使ったモーターのコントロールと応用
Raspberry Piを使ったモーターのコントロールと応用
Lina Katayose
 
海外のPyLadiesメンバーと交流して思ったこと
海外のPyLadiesメンバーと交流して思ったこと海外のPyLadiesメンバーと交流して思ったこと
海外のPyLadiesメンバーと交流して思ったこと
Lina Katayose
 
スマホアプリを0から設計してリリースするまでのこと
スマホアプリを0から設計してリリースするまでのことスマホアプリを0から設計してリリースするまでのこと
スマホアプリを0から設計してリリースするまでのこと
Lina Katayose
 
PyLadies and the importance of community participation
PyLadies and the importance of community participationPyLadies and the importance of community participation
PyLadies and the importance of community participation
Lina Katayose
 
Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008
Lina Katayose
 
Raspberry PiとPythonでできること
Raspberry PiとPythonでできることRaspberry PiとPythonでできること
Raspberry PiとPythonでできること
Lina Katayose
 
Preparation for pycon 2018(cleveland)
Preparation for pycon 2018(cleveland)Preparation for pycon 2018(cleveland)
Preparation for pycon 2018(cleveland)
Lina Katayose
 
Python Boot Camp のお話し
Python Boot Camp のお話しPython Boot Camp のお話し
Python Boot Camp のお話し
Lina Katayose
 
すうがく初めの一歩
すうがく初めの一歩すうがく初めの一歩
すうがく初めの一歩
Lina Katayose
 
Lina katayose pyladies3周年LT
Lina katayose pyladies3周年LTLina katayose pyladies3周年LT
Lina katayose pyladies3周年LT
Lina Katayose
 
ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話
Lina Katayose
 
私のPython学習法lt
私のPython学習法lt私のPython学習法lt
私のPython学習法lt
Lina Katayose
 
Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2
Lina Katayose
 
Geek women japanのロゴをhtmlとcssで作る
Geek women japanのロゴをhtmlとcssで作るGeek women japanのロゴをhtmlとcssで作る
Geek women japanのロゴをhtmlとcssで作る
Lina Katayose
 
Raspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれRaspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれ
Lina Katayose
 
Raspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれRaspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれ
Lina Katayose
 

More from Lina Katayose (19)

Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけPythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
Pythonで ハードウェアを動かす楽しさと ハードウェアハック始めたきっかけ
 
Python×ドローンについて過去のPyConJP登壇から今までの進化。
Python×ドローンについて過去のPyConJP登壇から今までの進化。Python×ドローンについて過去のPyConJP登壇から今までの進化。
Python×ドローンについて過去のPyConJP登壇から今までの進化。
 
実際にワーケーションを実践して思ったこと。
実際にワーケーションを実践して思ったこと。実際にワーケーションを実践して思ったこと。
実際にワーケーションを実践して思ったこと。
 
Raspberry Piを使ったモーターのコントロールと応用
Raspberry Piを使ったモーターのコントロールと応用Raspberry Piを使ったモーターのコントロールと応用
Raspberry Piを使ったモーターのコントロールと応用
 
海外のPyLadiesメンバーと交流して思ったこと
海外のPyLadiesメンバーと交流して思ったこと海外のPyLadiesメンバーと交流して思ったこと
海外のPyLadiesメンバーと交流して思ったこと
 
スマホアプリを0から設計してリリースするまでのこと
スマホアプリを0から設計してリリースするまでのことスマホアプリを0から設計してリリースするまでのこと
スマホアプリを0から設計してリリースするまでのこと
 
PyLadies and the importance of community participation
PyLadies and the importance of community participationPyLadies and the importance of community participation
PyLadies and the importance of community participation
 
Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008
 
Raspberry PiとPythonでできること
Raspberry PiとPythonでできることRaspberry PiとPythonでできること
Raspberry PiとPythonでできること
 
Preparation for pycon 2018(cleveland)
Preparation for pycon 2018(cleveland)Preparation for pycon 2018(cleveland)
Preparation for pycon 2018(cleveland)
 
Python Boot Camp のお話し
Python Boot Camp のお話しPython Boot Camp のお話し
Python Boot Camp のお話し
 
すうがく初めの一歩
すうがく初めの一歩すうがく初めの一歩
すうがく初めの一歩
 
Lina katayose pyladies3周年LT
Lina katayose pyladies3周年LTLina katayose pyladies3周年LT
Lina katayose pyladies3周年LT
 
ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話
 
私のPython学習法lt
私のPython学習法lt私のPython学習法lt
私のPython学習法lt
 
Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2
 
Geek women japanのロゴをhtmlとcssで作る
Geek women japanのロゴをhtmlとcssで作るGeek women japanのロゴをhtmlとcssで作る
Geek women japanのロゴをhtmlとcssで作る
 
Raspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれRaspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれ
 
Raspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれRaspberry pi 3を使ってみてあれこれ
Raspberry pi 3を使ってみてあれこれ
 

Recently uploaded

生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
Osaka University
 
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
嶋 是一 (Yoshikazu SHIMA)
 
Generating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language ModelsGenerating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language Models
harmonylab
 
Humanoid Virtual Athletics Challenge2024 技術講習会 スライド
Humanoid Virtual Athletics Challenge2024 技術講習会 スライドHumanoid Virtual Athletics Challenge2024 技術講習会 スライド
Humanoid Virtual Athletics Challenge2024 技術講習会 スライド
tazaki1
 
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobodyロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
azuma satoshi
 
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMMハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
osamut
 
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
Toru Tamaki
 

Recently uploaded (7)

生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
生成AIがもたらすコンテンツ経済圏の新時代  The New Era of Content Economy Brought by Generative AI
 
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
「進化するアプリ イマ×ミライ ~生成AIアプリへ続く道と新時代のアプリとは~」Interop24Tokyo APPS JAPAN B1-01講演
 
Generating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language ModelsGenerating Automatic Feedback on UI Mockups with Large Language Models
Generating Automatic Feedback on UI Mockups with Large Language Models
 
Humanoid Virtual Athletics Challenge2024 技術講習会 スライド
Humanoid Virtual Athletics Challenge2024 技術講習会 スライドHumanoid Virtual Athletics Challenge2024 技術講習会 スライド
Humanoid Virtual Athletics Challenge2024 技術講習会 スライド
 
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobodyロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
ロジックから状態を分離する技術/設計ナイト2024 by わいとん @ytnobody
 
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMMハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
ハイブリッドクラウド研究会_Hyper-VとSystem Center Virtual Machine Manager セッションMM
 
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
論文紹介:Deep Learning-Based Human Pose Estimation: A Survey
 

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
  • 7. About Drone ✢ 注意すること(日本国内, 機体200g以上) ✢ To fly adrone, If youmust check J apan rule. 7
  • 10. Purpose ✢ Iwant tohack aselling drone. ✢ ドローンをハックしたい。 10 1
  • 11. Purpose ✢ Iwant tomake dronesthat areaseasy andsafe aschildrencan make. ✢ ドローンを簡単に飛ばせる仕組みを作りたい。 11 2
  • 12. Purpose ✢ Iam developing aplatformthatelementary and junior highschoolstudentscancasuallycreate whilestudying programming and electronic work.Itiseducational and not afull-blowndrone development. ✢ 小中学生向け、プログラミング&電子工作の勉強のために。 ✢ 気軽に作成できるプラットフォームを開発。 ✢ 前回の発表では、ブラシレスモーターを回す仕組みに焦点を 当てたが、今回は以下に簡単にモーターを4つ回しプログラム で動かすかに焦点を当てた。 (別途進めている。)本格的なドローンはArduinoなどのマイコンを併用予定 12 3
  • 13. 3. What you can do with Drone ドローンでできること。
  • 14. What you can do with Drone ✢ 空撮(映画、ドラマ、CMなど)、捜索、配達など ✢ Skypicture &movie (movies, dramas, CMetc.), search,delivery etc. 14
  • 15. 4. Description of RaspberryPi and Google VoiceKit ラズベリーパイとボイスキットについての説明
  • 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
  • 19. Description of RaspberryPi and Google VoiceKit Voice Kit つまり、声で動かすことも可能! 19
  • 20. Description of RaspberryPi and Google VoiceKit Voice Kit It can also move the servo! サーボを動かすことも可能! 20
  • 21. Description of RaspberryPi and Google VoiceKit Voice Kit It can also move the motor! モーターを動かすことも可能! 21
  • 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円で売っています。 (日本)
  • 24. 5. How to made it それをどうやって組み込むか。
  • 25. Description of RaspberryPi and Google VoiceKit Voice Kit & RaspberryPi connect bySolder はんだで線をつなげていく。 25
  • 26. Python code & Impressions 26 Before talk
  • 27. Python code & Impressions 27 Before talk
  • 28. 6. Python code & Impressions Pythonコードとまとめ。
  • 29. Python code & Impressions from gpiozero import PWMOutputDevice from time import sleep pwm = PWMOutputDevice(4) pwm = PWMOutputDevice(17) pwm = PWMOutputDevice(27) pwm = PWMOutputDevice(22) 29 1 2 3 4 ↑ Rotor Number GPIO Number
  • 30. Python code 30 #上昇&前進 #gpiozeroライブラリから PWMOutputDeviceをインポートします。 from gpiozero import PWMOutputDevice from time import sleep # モーターは左上を1とし半時計周りに,2,3,4とする。 # 1をGPIO04,2をGPIO17,3をGPIO27,4をGPIO22とする。 pwm = PWMOutputDevice(4) pwm2 = PWMOutputDevice(17) pwm3 = PWMOutputDevice(27) pwm4 = PWMOutputDevice(22) #pwm.valueを0.3(30%)で反時計周りに回す。その後、全力で上昇その後前進。 while True: pwm.value = 0.5 sleep(0.3) pwm2.value = 0.5 sleep(0.3) pwm3.value = 0.5 sleep(0.3) pwm4.value = 0.5 sleep(0.5) pwm.on() pwm2.on() pwm3.on() pwm4.on() sleep(2.0) # 前進 pwm.value = 0.7 pwm4.value = 0.7 sleep(3.0) # 前進ストップ(反力) pwm.value = 1.0 pwm4.value = 1.0 pwm2.value = 0.8 pwm3.value = 0.8 sleep(1.2) #ホバリング pwm.on() pwm2.on() pwm3.on() pwm4.on() sleep(2.0) pwm.value = 0.3 pwm2.value = 0.3 pwm3.value = 0.3 pwm4.value = 0.3 sleep(1.0) pwm.off() pwm2.off() pwm3.off() pwm4.off() sleep(3.0) #上昇前進ストップ&下降を繰り返 す。 Lift off & move to forward
  • 31. Python code 31 #上昇 #gpiozeroライブラリから PWMOutputDeviceをインポートします。 from gpiozero import PWMOutputDevice from time import sleep # モーターは左上を1とし半時計周りに,2,3,4とする。 # 1をGPIO04,2をGPIO17,3をGPIO27,4をGPIO22とする。 pwm = PWMOutputDevice(4) pwm2 = PWMOutputDevice(17) pwm3 = PWMOutputDevice(27) pwm4 = PWMOutputDevice(22) #pwm.valueを0.3(30%)で反時計周りに回す。その後、全力で上昇 while True: pwm.value = 0.5 sleep(0.3) pwm2.value = 0.5 sleep(0.3) pwm3.value = 0.5 sleep(0.3) pwm4.value = 0.5 sleep(0.5) pwm.on() pwm2.on() pwm3.on() pwm4.on() sleep(3.0) pwm.value = 0.7 pwm2.value = 0.7 pwm3.value = 0.7 pwm4.value = 0.7 sleep(1.0) pwm.value = 0.3 pwm2.value = 0.3 pwm3.value = 0.3 pwm4.value = 0.3 sleep(1.0) pwm.off() pwm2.off() pwm3.off() pwm4.off() sleep(3.0) #上昇下降を繰り返す。 Lift off & hovering
  • 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()
  • 33. Python code & Impressions https://aiyprojects.withgoogle.co m/voice-v1/#makers-guide-3- custom-voice-user-interface VoiceコントロールはGoogle Cloud に 接続する必要がある。(一部有料) 33
  • 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
  • 37. Thanks! Anyquestions? Y ou canfind me at “LinaKATAYOSE” @ selina787b lina.katayose@ gmail.com 37 http://se-lina.hatenablog.com/

Editor's Notes

  1. 日本語と英語交じりで進めます。
  2. 目的:独立したプラットフォームではなく、WindowsパソコンのようにOSに当たる部分を統一化し、部品部品を組み合わせることで一つのドローン、もしくはIoT機器を作りたい。
  3. 目的:独立したプラットフォームではなく、WindowsパソコンのようにOSに当たる部分を統一化し、部品部品を組み合わせることで一つのドローン、もしくはIoT機器を作りたい。
  4. 目的:独立したプラットフォームではなく、WindowsパソコンのようにOSに当たる部分を統一化し、部品部品を組み合わせることで一つのドローン、もしくはIoT機器を作りたい。
  5. ラズベリーパイは、あなたが楽しく実践的なプロジェクトを通してプログラミングを学ぶために使うことができる、小さくて手頃なコンピュータです。 ラズベリーパイに付いたボード。Ver1とVer2があり、バージョン2が販売されています。
  6. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  7. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  8. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  9. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  10. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  11. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  12. 昨年「Google AIY Project」からリリースされた「Google AIY Voice Kit」により、最先端の技術AIを「メーカーズ」で簡単に使い慣れたものにすることができます モーターとサーボ、および音声のみの動作を動かすことができます。
  13. 前進する
  14. 前進する
  15. 前進する
  16. 目的:独立したプラットフォームではなく、WindowsパソコンのようにOSに当たる部分を統一化し、部品部品を組み合わせることで一つのドローン、もしくはIoT機器を作りたい。