Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GoPiGo2で遊んでみた
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kazuyuki Mori
May 15, 2016
Programming
53
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GoPiGo2で遊んでみた
Kazuyuki Mori
May 15, 2016
Transcript
38 slides
GoPiGo2で遊んでみた
Who am i 森 和之 @mainyaa 株式会社トップゲート ボドゲ好き猫エンジニア
GoPiGo2
GoPiGo2とは • RaspberryPIを積んだロボットカー • Dexter Industries社製 ◦ LEGOマインドストームのキットを作ってる • Kickstarter発
None
GoPiGo2の良い所 • 20分で作れる • センサーがキットになっていて、カスタマイズ出来る • 電子工作が初めてでも作れるぐらい簡単 • LEGOみたいにセンサーを組み合わせられる
GoPiGo2の良い所2 • ソースコードがオープンソースで公開されている(GPL) • ライブラリが豊富 ◦ C、C#、Java、NodeJS、Python、Scratch • https://github.com/DexterInd/GoPiGo/ •
プログラマブルなロボットカー
購入ガイド • RaspberryPIすでに持っている人 ◦ BaseKit+何かのセンサーで十分 ◦ $99 • これからRaspberryPIを始める人 ◦
StarterKitがおすすめ ◦ $299
None
None
GoPiGo2の良い所3 • Exampleが豊富 ◦ https://github.com/DexterInd/GoPiGo/tree/master/Software/Python/Ex amples • PS3コントローラーで操作できる(要bluetooth) • 超音波センサーで2m先まで物体があるか検知できる
• エンコーダーホイールがあるため、cm単位でモーターを制 御できる
None
エンコーダー ホイール タイヤと同じ軸に取り付ける タイヤがどれだけ回転したのかを パルスで受け取る Photo: ROBOTC http://www.robotc.net/wikiarchive/Tutorials/Arduino_Projects/Mobile_Robotics/BoeBot/What_is_an_Encoder
エンコーダーホイール • エンコーダーの穴は合計64個なので、360 / 64で、5 deg / pulse • ホイールの半径は3.25cm
• DER (Degree Per Ratio)がわかれば、タイヤをn cm進むのに必要なパルス数 が求められる
エンコーダーホイール • 例:90度右を向く def right_deg(degree): pulse= int(degree / 5) #
5 degree/pulse enc_tgt(0, 1, pulse) right()
どこでもRaspberryPI開発したい
どこでもRaspberryPI開発したい • 家に置いてあるRaspberryPIをノマドしつつ開発する ◦ wifiを自動再接続するようにする ◦ SSH Tunnelを使う ◦ wifiは11acを使う
•
どこでもRaspberryPI開発したい • wifiを自動再接続するようにする ◦ $ sudo apt-get install wicd ◦
$ wicd-curses
どこでもRaspberryPI開発したい • SSH Tunnelを使う ◦ MacもRPIも異なるプライベートネットワークで、グローバルIPがない ◦ GCPやAWS上にSSH Tunnel用の中継サーバーを建てちゃう ◦
世界中どこからでもRPIにSSH接続できる
Google Cloud Platform RPI(母艦) Macbook 中継サーバー private network private network
どこでもRaspberryPI開発したい - SSH Tunnelを使う • $ sudo apt-get install autossh
• $ git clone https://github.com/mainyaa/RaspberryPi-Mothership • $ cd ssh-tunnel-example • $ vim usr/bin/ssh_tunnel ◦ [ssh_tunnel]をglobalIPに書き換え
どこでもRaspberryPI開発したい - SSH Tunnelを使う • sudo apt-get install -y autossh
• git clone https://github.com/mainyaa/RaspberryPi-Mothership.git • sudo cp ./RaspberryPi-Mothership/init.d/ssh_tunnel /etc/init.d/ • sudo cp ./RaspberryPi-Mothership/sbin/ssh_tunnel /usr/sbin/ • sudo insserv ssh_tunnel • sudo reboot ◦ これで、RPIが常に中継サーバーにSSH接続している 状態になった
どこでもRaspberryPI開発したい - SSH Tunnelを使う • RPIに接続する ◦ ssh -o 'ProxyCommand
ssh ssh-tunnel nc %h %p' -p 20022 pi@localhost
Google Cloud Platform RPI(母艦) Macbook 中継サーバー private network private network
Port20022 Port22
どこでもRaspberryPI開発したい • RaspberryPiがどんなネットワークにいようと、raspiのIPアドレスを調べることな くssh接続できるようにする ◦ http://qiita.com/mainyaa/items/f10d15a7d2cdddd7dfbf
どこでもRaspberryPI開発したい • wifiは11acを使う ◦ これは間に合いませんでした>< ◦ ドライバのビルドのためにカーネルヘッダーを用意したり、ドライバのソース にパッチを当てたり、大変なのに認識してくれない>< ◦ 成功している人いますか?
GoPiGo2で脳◦メーカー作ってみた
GoPiGo2で脳◦メーカー作ってみた • Cloud Vision APIすごいよ • # LABEL_DETECTION カテゴリの検出 •
# LANDMARK_DETECTION 観光名所などの場所名 • # LOGO_DETECTION ロゴの検出 • # TEXT_DETECTION OCR、文字の検出 • # SAFE_SEARCH_DETECTION 画像が有害な内容を含んでいるかを検出 • # IMAGE_PROPERTIES 画像に関する色データを検出 • # FACE_DETECTION 顔検出 •
GoPiGo2で脳◦メーカー作ってみた • Cloud Vision APIすごいよ ◦ 顔検出ができる ▪ 顔の座標特定 ▪
笑顔、怒り、悲しみ、驚きを判定
GoPiGo2で脳◦メーカー作ってみた • Cloud Vision APIすごいよ ◦ 物体検出ができる ◦ カメラに写っている物体を識別 ▪
gadget, cat, human, room, floor, clothing, book
GoPiGo2で脳◦メーカー作ってみた • Cloud Vision APIすごいよ ◦ 課金はリクエスト1,000回=1unitで換算 ◦ 月1unitまで無料 ◦
以降、月1unitごとに$5 ▪ https://cloud.google.com/vision/docs/pricing
GoPiGo2で脳◦メーカー作ってみた • Cloud Vision APIの凄さを伝えるべくRasPi botとビデオを作った話 ◦ http://qiita.com/kazunori279/items/768c7fdf96cdf45a9d16 • kazunoriさんに作成とOSS化の許可を得て、フルスクラッチでvBot君を
作った • OSSで公開予定
GoPiGo2で脳◦メーカー作ってみた • 僕のvBot君の機能 ◦ 顔を検知できなかったら認識できた物体をしゃべるよ ◦ 笑顔を認識すると寄ってくるよ ◦ 笑顔から笑顔度を判定して◯内メーカー風に画像を出し てくれるよ
None
None
デモ
None
Thanks
More Decks by Kazuyuki Mori
See All by Kazuyuki Mori
ライブ配信サーバー完全に理解した
mainyaa
2
900
BitMech 探索的 トレーディングシステム fin-py study #1
mainyaa
0
65
Electron(旧atom shell)基礎+入門
mainyaa
0
63
Docker基礎+Docker0.9/0.10概要
mainyaa
0
48
Docker基礎+docker0.9, 0.10概要
mainyaa
0
68
Other Decks in Programming
See All in Programming
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
140
[DroidKnights 2026] Workflow AX 적용기 — 자동 정책 정리부터 E2E까지
dayeon
0
120
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
240
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
140
あなたはMCPの機能を、まだ知らない。
4geru
1
740
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
340
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
300
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
360
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
650
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
790
The untapped power of vector embeddings
frankvandijk
2
2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
580
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
Fireside Chat
paigeccino
43
4.1k
Embracing the Ebb and Flow
colly
88
5.2k
How to Ace a Technical Interview
jacobian
280
24k
Everyday Curiosity
cassininazir
0
420