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
270
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
More Decks by KMiura
See All by KMiura
運用しているアプリケーションのDBのリプレイスをやってみた
miura55
1
1.2k
Amazon Rekognitionを使ったインターホンハック
miura55
0
140
あなたの知らないクラフトビールの世界
miura55
0
480
Storage Browser for Amazon S3を触ってみた + α
miura55
0
340
Cloudflare R2をトリガーにCloudflare Workersを動かしてみた
miura55
0
340
あのボタンでつながるSORACOM
miura55
0
200
Postman Flowsで作るAPI連携LINE Bot
miura55
0
460
Lambdaと共に歩んだAWS
miura55
3
1.1k
Bedrock Knowledge baseを使って今年の上半期のニュースを聞いてみた(リベンジ編)
miura55
0
410
Other Decks in Technology
See All in Technology
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
160
継続的なAIコスト最適化
bgpat
1
250
メルペイ 会計システム概要と歴史
mewuto
0
200
並行性の問題を防げ!実践トランザクション入門
occhi
0
280
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
210
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
4
5k
3つのアプローチで目指す チームを強くするAI駆動開発
thkt
0
140
20260930_Gemma4_Hands-on
tsho
0
240
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
190
SDDの運用にめげずに向き合った話
sansantech
PRO
1
140
2026-10-01_MagicPod_QAハーネスエンジニアリングとQA組織の未来像
ynisqa1988
1
560
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
110
Featured
See All Featured
From π to Pie charts
rasagy
1
390
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
790
The Invisible Side of Design
smashingmag
301
52k
Why Our Code Smells
bkeepers
PRO
340
58k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
350
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
550
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Technical Leadership for Architectural Decision Making
baasie
3
590
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Marketing to machines
jonoalderson
1
5.9k
Transcript
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