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
GR-ROSEとROSを使ってコマンドサーボの現在位置をWebブラウザで表示してみる
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
lutecia16v
July 17, 2021
Programming
1.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GR-ROSEとROSを使ってコマンドサーボの現在位置をWebブラウザで表示してみる
2021/7/17 ROS Japan UG #43 組み込み勉強会 LT資料
lutecia16v
July 17, 2021
More Decks by lutecia16v
See All by lutecia16v
EDF-IDF Programming Guidを読む - JTAG Debugging 編 -
lutecia16v
1
410
GR-ROSEでROS/ROS2
lutecia16v
1
1.9k
Jetson NanoとGR-ROSEで始めるROS2
lutecia16v
0
2.3k
がじぇねるねでもROSしたい!
lutecia16v
1
160
GR-ROSE でroombaをコントロールする
lutecia16v
2
420
Other Decks in Programming
See All in Programming
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
670
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
iOSDC2026登壇資料.pdf
riofujimon
0
150
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
0
260
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
990
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
620
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.8k
アクセシビリティから考える情報設計
high_g_engineer
0
370
FreeBSDでZabbixを動かす.pdf
kenkino
0
190
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Designing Experiences People Love
moore
143
24k
Designing for humans not robots
tammielis
254
26k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Balancing Empowerment & Direction
lara
6
1.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
Transcript
GR-ROSEとROSを使って コマンドサーボの現在位置を Webブラウザで表示してみる るぅて(@lutecia16v) 2021/7/17 ROS Japan UG #43 組み込み勉強会
自己紹介 名前(ハンドル名):るぅて (@lutecia16v) 技術サークル 薔薇の騎士団にてGR-ROSEの同人誌を作成 https://knightsofrose.booth.pm/ https://techbookfest.org/organization/21840045 BOOTH: 技術書典:
本日の発表概要 GR-ROSEでコマンド式サーボの情報を取得し、ROSを使ってWebブラウザで表示する 組込みレベル: 初級 ROSレベル: 初級 必要な機材: GR-ROSE + KXR-A3S(or
KRS330x) + Raspberry Pi 4 + PC 使用するROS: ROS1(Noetic) + rosserial + rosbridge_suite + ROSLIBJS + roswww
コマンド式サーボとは? 主にシリアル通信を使い、決めれられた通信フォーマットのコマンドを送信す ることで、モーターモジュールを制御します。 コントローラ コマンド式サーボ シリアル通信 ・・・ コマンド 応答 •
複数個を数珠繋ぎで接続可能 • 位置制御や速度制御といった機能が豊富 • 現在位置の取得や細かい制御パラメータの設定等が可能
コマンド式サーボとは? 数社から発売されている。 ROBOTIS社 Dynamixel、近藤科学 KRS/B3M、双葉電子工業 RS 最近は中国 HiWonder社 シリアル通信は、TTL半二重やRS485半二重マルチドロップが採用されている。 コマンド方式は各社異なる。
今回は、近藤科学のKRS3301を使用
コマンド式サーボの接続(近藤科学の場合) 1) PC/SBCから コマンド式サーボ Dual USB アダプターHS 2) 組込みボード(arduino/STM32等)から 外部電源(6V)
TTL: コマンド式サーボ RS485USB/ シリアル変換 アダプター 外部電源(6Vとか) RS485: コマンド式サーボ ICS変換基板 外部電源(6Vとか) TTL: コマンド式サーボ RS485USB/ シリアル変換 アダプター 外部電源(6Vとか) RS485: ※R485 I/Fを持っている場合は不要。他 社のRS485 I/F基板でもよい。
コマンド式サーボの接続(近藤科学の場合) GR-ROSEならシンプル! 電源(~18V) →DC/DCを持っているので、これだけでマイコン側にも電源供給される。 TTL/RS485: TTL半二重に対応したシリアルI/FとRS485 I/Fあり 近藤科学 KRS(TTL):〇 B3M(RS485):〇 Dynamixel
XL(TTL): 〇 MX(RS485): 〇 ※RS485の通信速度は1.5Mbpsまで
GR-ROSEからコマンド式サーボの位置取得 #define KRS_FREE 0 #define SERVO_NUM 3 IcsController ICS(Serial1); IcsServo
servo[SERVO_NUM]; void initializeServo(){ ICS.begin(); for(int i = 0; i < SERVO_NUM; i++){ servo[i].attach(ICS, i); servo[i].setPosition(KRS_FREE); delay(1); } }
GR-ROSEからコマンド式サーボの位置取得 uint16_t servo_pos[SERVO_NUM]; void setup() { Serial.begin(9600); initializeServo(); } void
getPositionAll(){ for(int i = 0; i < SERVO_NUM; i++){ servo_pos[i] = servo[i].getPosition(); delay(1); } } void loop() { getPositionAll(); Serial.print("POS:"); Serial.print("\t"); Serial.print(servo_pos[0]); Serial.print("\t"); Serial.print(servo_pos[1]); Serial.print("\t"); Serial.print(servo_pos[2]); Serial.print("\n"); delay(100); }
rosserialを使ってPublish 1) Raspberry Pi にROS環境とrosserial, rosserial_arudinoをインストール 2) Raspberry Pi上でrosserial_arduinoでライブラリを作成 3)
作成したライブラリをGR-ROSEの開発環境であるIDR for GRに取り込み IDR for GR : arudino IDEライクな開発環境 Noeticのrosserial_arduinoのライブラリは、nullptrを使用してい るので、コンパイルオプションに -std=gnu++11を付与
rosserialを使ってPublish /joint_stateのpositionに取得値を入れてPublish。 URDFとか(まだ)ないので、nameは”J1”, “J2”, “J3”とした。 $ rostopic echo /joint_state header:
seq: 27 stamp: secs: 0 nsecs: 0 frame_id: "/base_link" name: - J1 - J2 - J3 position: [7137.0, 8085.0, 5925.0] velocity: [0.0, 0.0, 0.0] effort: [0.0, 0.0, 0.0] --- header: ・・・ ※値はとりあえずそのまま取得したを突っ込んだ → 7500がセンター位置
Webブラウザでの表示 rosbridge_suite + ROSLIBJS + roswwwを使って、トピックをWebブラウザで表示させる GR-ROSE Raspberry Pi rosserial
roswww (webサーバ) USB(Serial) トピック: /joint_state rosbridge_server コンテンツ ROSLIBJS アクセス コンテンツ 取得 WebSocket
技術書典11にて新刊リリースしました