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
Pythonでルンバをハックしてみた
Search
KMiura
January 25, 2025
Technology
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pythonでルンバをハックしてみた
しゃち.py みーてぃんぐ 7th. 新年LT大会
https://shachi-py.connpass.com/event/340010/
KMiura
January 25, 2025
Transcript
32 slides
Pythonでルンバをハックしてみた Koki Miura(@k_miura_io)
自己紹介 • 三浦 耕生(こうき) • バックエンドエンジニア • 鯱.py 運営 •
JAWS UG名古屋&神戸 運営 • Cloudflare Meetup 名古屋 運営 @k_miura_io koki.miura05
Discordの参加お待ちしております! https://discord.gg/AJ99S4mp9T
今から3年ぐらい前、ハドフで発見
しかし、ずっと使ってなかった • ルンバ自体は持ってたけどそもそも使ってなかった • リビングに犬がいて何かいたずらされないか心配 だった
一人暮らしを始める ※画像はイメージです
自宅のルンバが大活躍 • 長年放置しててバッテリーが死んでたが、Amazonの 互換バッテリーに交換してあっさり動いた • 自分のデスク意外はものが散らかってなくて割と広々し ているのでかなりのびのびと動いてくれてリビングの掃 除をする手間が省けた
こいつの出番だ!
やってみた
Roomba Open Interface(ROI) • iRobotが定義したルンバを制御するためのソフト ウェアインターフェース • 移動だけじゃなくて、センサーデータの取得やコマ ンドを呼び出すなど一連の制御ができる •
Mini-DINポートを使ってPCやマイコンとシリアル通 信を行う https://edu.irobot.com/learning- library/create-2-oi-spec
iRobotの教育向けプロダクト • 昔からiRobotはルンバをベースにした教育用ロ ボットとしてCreateというロボットを製造していた • 掃除機能が無い代わりに空いたスペースに ArduinoをRaspberry Piを突っ込む想定 • 過去のロボットにまつわる論文を見ているとCreate
を使用した事例をよく見かけるぐらい研究用途でも 使われている
None
このケーブルが何者なのかはわからずw
出るのはだいたいこれ
気を取り直して…
ハードウェア • iRobot Model # 4822(USBシリアルケーブル) • Roomba 760 •
Raspberry Pi 3 Model A+
PyRoombaAdapter • ROIをPythonで扱いやすいよ うに抽象化したライブラリ • 内部ではPySerialを使ってい るのでその感覚でポート指定 すれば簡単に動かせそう https://github.com/AtsushiSakai/PyRoombaAdapter
とりあえず動かす
動かしてみた
何か音楽を流す • send_song_cmdで自由にメロディを流すことができる • MIDIに対応しており、音階はMIDIのノートナンバーを 指定する • ノートナンバーとその音の長さをリスト形式でやるス タイル
None
ミュージックホーン を再現してみる
鳴らしてみる
ルンバのボタン操作をする • send_buttons_cmdメソッドを使うことでROI経 由でボタンを押すような操作を実行できる • 引数で押したいボタンを指定することでそ の操作を実行できる • ボタンは1/6秒押した時と同じ挙動を再現 するらしい
ミュージックホーン を鳴らしてホーム ベースに戻る
動かしてみる
今回のブログ https://bit.ly/4jqrQ5r
やたらスターをつけてもらえたw
読者数が急に 増えたw
公式でピックアップ してもらったw
まとめ • ジャンクで見つけたケーブルが見事に機能してルンバをハックできた • iRobotのインターフェースが良くできていてプログラムで自由にルンバ を操作できる仕組みが整っていた • PyRoombaAdapter結構便利
END
More Decks by KMiura
See All by KMiura
運用しているアプリケーションのDBのリプレイスをやってみた
miura55
1
1.2k
Amazon Rekognitionを使ったインターホンハック
miura55
0
140
あなたの知らないクラフトビールの世界
miura55
0
500
Storage Browser for Amazon S3を触ってみた + α
miura55
0
380
Cloudflare R2をトリガーにCloudflare Workersを動かしてみた
miura55
0
370
あのボタンでつながるSORACOM
miura55
0
210
Postman Flowsで作るAPI連携LINE Bot
miura55
0
470
Lambdaと共に歩んだAWS
miura55
3
1.1k
Bedrock Knowledge baseを使って今年の上半期のニュースを聞いてみた(リベンジ編)
miura55
0
430
Other Decks in Technology
See All in Technology
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
1
660
NutanixへのSSHアクセスの今後について
shadowhat
0
170
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
180
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
290
人の努力に頼らないセキュリティをエンジニアリングする在り方 / An approach to engineering security that does not rely on human effort
carta_engineering
0
240
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
260
Go でトランザクション、どう書いてますか?
knwoop
1
570
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
260
パスワードのない鍵で、 データを手元に置く
ginjihayashi
0
400
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
150
個人ASを取得して、自宅Kubernetes上のVMをグローバルIPで公開した話
munenick
0
230
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
580
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
The Invisible Side of Design
smashingmag
301
52k
Test your architecture with Archunit
thirion
2
2.5k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
Balancing Empowerment & Direction
lara
6
1.4k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.3k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
Making the Leap to Tech Lead
cromwellryan
135
10k