SlideShare uma empresa Scribd logo
1 de 37
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/

Mais conteúdo relacionado

Semelhante a 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 shannonlabYutaka 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-securityYamauchi 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,userTonny 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
 

Semelhante a 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 入門
 

Mais de 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 participationLina Katayose
 
Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008Pyladies Tokyo LT 20181008
Pyladies Tokyo LT 20181008Lina 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周年LTLina Katayose
 
ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話ドローンのフライトコントローラをPythonで制御してみた話
ドローンのフライトコントローラをPythonで制御してみた話Lina Katayose
 
私のPython学習法lt
私のPython学習法lt私のPython学習法lt
私のPython学習法ltLina Katayose
 
Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2Geek women japanのロゴをhtmlとcssで作る2
Geek women japanのロゴをhtmlとcssで作る2Lina 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
 

Mais de 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を使ってみてあれこれ
 

Último

[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 

Último (9)

[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介: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
  • 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/

Notas do Editor

  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機器を作りたい。