Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pythonでルンバをハックしてみた
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
KMiura
January 25, 2025
Technology
220
0
Share
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
120
あなたの知らないクラフトビールの世界
miura55
0
410
Storage Browser for Amazon S3を触ってみた + α
miura55
0
270
Cloudflare R2をトリガーにCloudflare Workersを動かしてみた
miura55
0
280
あのボタンでつながるSORACOM
miura55
0
170
Postman Flowsで作るAPI連携LINE Bot
miura55
0
430
Lambdaと共に歩んだAWS
miura55
3
990
Bedrock Knowledge baseを使って今年の上半期のニュースを聞いてみた(リベンジ編)
miura55
0
340
Other Decks in Technology
See All in Technology
Practical TypeProf: Lessons from Analyzing Optcarrot
mame
0
1.2k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
79k
AgentCore Managed Harness を使ってみよう
yakumo
2
250
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
150
AzureのIaC管理からログ調査まで、随所に役立つSkillsとCustom-Instructions / Boosting IaC and Log Analysis with Skills
aeonpeople
0
280
No Types Needed, Just Callable Method Check
dak2
1
2.2k
AI駆動1on1〜AIに自分を育ててもらう〜
yoshiakiyasuda
0
150
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
0
270
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
410
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
790
Oracle Cloud Infrastructure:2026年4月度サービス・アップデート
oracle4engineer
PRO
0
130
Standards et agents IA : un tour d’horizon de MCP, A2A, ADK et plus encore
glaforge
0
210
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
330
Why Our Code Smells
bkeepers
PRO
340
58k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
380
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
260
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
120
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