SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
ROS + Gazebo 機器人模擬器
工作坊
Presenter: 賴柏任
https://www.facebook.com/PoJenLai
08.20.2016
Brought to you by COSCUP 2016
Who am I
• 大學時有幸透過專題接觸 ROS,並陸續發表一
些 ROS 的介紹文章
https://pojenlai.wordpress.com/
• 研究所的論文內容也是用 ROS 來開發
https://github.com/Po-
Jen/transparent_objects/tree/addedfeature
• 工作閒暇之餘希望可以持續學習、也提供更多
資源給大家
http://blog.techbridge.cc/
http://weekly.techbridge.cc/
2
Who am I
• 順便推薦一下 ROS.Taipei 社群
https://www.facebook.com/groups/122728288090359/
3
Outline
• ROS Introduction
• ROS Basic Mechanism
• ROS Tool Overview
• Gazebo Introduction
• Gazebo Usage
• Navigation & SLAM
4
ROS Introduction
5
What is ROS ?
6
http://answers.ros.org/question/12230/what-is-ros-exactly-middleware-framework-operating-system/#18055
• ROS is acronym for Robot OS, but it is not a
traditional OS like Windows, Ubuntu or Mac OS
What is ROS ?
7
• Before we move on, we should clarify something
• Robot software = Distributed computing system
Decision Maker
Object
Recognition
Object GraspingNavigation
What is ROS ?
8
• ROS is a set of tools which enables
– Easy construction of distributed computing systems
(Programs can be individually designed and easily connected at
runtime)
– Code reuse
– Configuring, starting, introspecting, debugging, visualizing, logging,
testing, and stopping distributed computing systems
Why is ROS preferred ?
9
• It encourages users not to reinvent the wheel
Why is ROS preferred ?
10
• Many open-sourced libraries
– SLAM (OpenSLAM)
– Real-time control(OROCOS)
– Path Planning (Openrave)
– Vision (OpenCV, PCL)
– 3D Simulator (Gazebo)
– 3D Visualizer (Rviz)
Why is ROS preferred ?
11
• Package can be written in multiple programming languages
– C++
– Python
– Lisp
• And many more experimental support
– C#, Go, Haskell, Java, Node.js, Lua, R, Ruby
– http://wiki.ros.org/Client%20Libraries
Can ROS be used on different robot?
12
• Of course!
• Check all robots using ROS - http://wiki.ros.org/Robots
https://vimeo.com/146183080
ROS Basic Mechanism & Tool
13
建立ROS workspace
• 建立一個空的環境並編譯
– $ mkdir -p ~/catkin_ws/src
– $ cd ~/catkin_ws/src
– $ catkin_init_workspace
– $ cd ~/catkin_ws
– $ catkin_make
14
File System
• Basic unit - package
– CMakeLists.txt
– package.xml
• ROS package 使用catkin 這工具來進行編譯
– 按照 ROS 規定的格式寫code,就可以用catkin編譯
15
rosbuild v.s. catkin
• rosbuild
– ROS Groovy之前的編譯系統
– 有部分package仍未porting到catkin上,故仍需略懂
– 所有原始碼和編譯後的檔案都在同一資料夾下
• Catkin
– ROS Groovy之後的編譯系統
– 原始碼和編譯後的檔案分離
• 接著直接來寫個node看看怎麼編譯
16
ROS Node
• Basic unit of program
17
Decision Maker
Object
Recognition
Object GraspingNavigation
Node 1
Node 2 Node 3 Node 4
讓我們開始實作
• 你們需要的code應該都在這了
– https://github.com/Po-Jen/coscup2016-ROS-
workshop
18
Create our first package & write a
node
• 步驟先全部列在這,接著讓我們一步步來做
– cd ~/catkin_ws/src
catkin_create_pkg coscup_1_node rospy
cd coscup_1_node
vim src/node.py
chmod +x src/node.py
cd ../..
catkin_make
source devel/setup.bash
roscore
rosrun coscup_1_node node.py
rqt_graph
19
ROS Master
• How do node knows each other? => ROS Master
• Control the graph of nodes
20
rqt_graph
• Visualization of nodes and topics
• Part of rqt (integrates lots of debugging tools)
21
How do ROS node communicate?
• ROS master as a message hub?
– What if there are many nodes?
22
How do ROS node communicate?
• Let nodes communicates with each other directly
– Topic, Service, ActionLib
• If ROS does not exists
– Socket
– Shared memory
– We have to take care of these tedious work.
23
ROS Topic
• Publisher/Subscriber mechanism (topic == bucket)
24
Perception
Object
Recognition
Semantic Map
Camera data
Recognition result
rostopic
• 寫一個publisher (一直丟字串到topic_name這個topic)
– catkin_create_pkg coscup_2_topic rospy std_msgs
cd coscup_2_topic
vim src/publisher.py
chmod +x src/publisher.py
cd ../..
catkin_make
source devel/setup.bash
roscore
rosrun coscup_2_topic publisher.py
rqt_graph
rostopic echo topic_name
rostopic list
rostopic list | grep topic
25
rqt_graph
• Now, it should looks like
26
rostopic
• 寫一個subscriber (從topic_name這個topic取出data)
– cd ~/catkin_ws/src
cd coscup_2_topic
vim src/subscriber.py
chmod +x src/subscriber.py
rosrun coscup_2_node subscriber.py
rqt
27
rqt_graph
• Now, it should looks like
28
rqt
• We can try console
29
Define our own msg for topic
• 創建一個只有一個int的msg
– cd ~/catkin_ws/src
cd coscup_2_topic
mkdir msg
vim msg/Num.msg
vim package.xml
vim CMakeLists.txt
cd ../..
catkin_make
source devel/setup.bash
rosmsg show coscup_2_topic/Num
30
package.xml
• Add build dependency and run dependency
31
CMakeLists.txt (1)
• Add package dependency
• Or you can
– catkin_create_pkg coscup_2_topic rospy std_msgs
message_generation
32
CMakeLists.txt (2)
• Add build dependency
• Add msg file
• We use std_msgs/int64 in our msg file
33
Publish自己寫的msg
• 步驟
– cd ~/catkin_ws/src/coscup_2_topic/
vim src/my_msg_publisher.py
chmod +x src/my_msg_publisher.py
rosrun coscup_2_topic my_msg_publisher.py
rostopic echo my_msg_topic_name
34
One more example
• geometry_msgs/Twist
35
One more example
• geometry_msgs/Vector3
36
How is the abstraction implemented?
37
/cmd_vel
topic
Base
Controller
Motor
Speed
geometry_msgs/Twist
將速度和角速度
轉成馬達命令
ROS Service
• Query/Response Style
38
Object Recognition
Brain
1 query 2 response
ROS Service
• 建立一個自己的srv格式
– cd ~/catkin_ws/src
catkin_create_pkg coscup_3_service rospy std_msgs
cd coscup_3_service
mkdir srv
vim srv/AddTwoInts.srv
vim package.xml
vim CMakeLists.txt
cd ../..
catkin_make
source devel/setup.bash
rossrv show coscup_3_service/AddTwoInts
39
package.xml
• Add build dependency and run dependency
40
CMakeLists.txt
• Add service file
• Add std_msgs dependency
41
ROS Service
• 寫一個server
– cd coscup_3_service
vim src/add_two_ints_server.py
cd ../..
source devel/setup.bash
chmod +x src/add_two_ints_server.py
rosrun coscup_3_service add_two_ints_server.py
42
ROS Service
• 寫一個client,送出request給server
– cd coscup_3_service
vim src/add_two_ints_client.py
chmod +x src/add_two_ints_client.py
run coscup_3_service add_two_ints_client.py 5 6
43
Rviz
• An important tool for data visualization
• 先啟動你們的Rviz
– $ sudo apt-get install ros-indigo-rviz-*
– $ roscore
– $ rviz
• Will be revisited when we use Gazebo
44
Find out more on ROS Cheat Sheet
• https://github.com/ros/cheatsheet 45
Gazebo Introduction
46
What is Gazebo ?
• 3D物理模擬器
–機器人控制
–環境模擬
–物體物理特性模擬
• 用途廣泛
–DARPA Challenge也是用Gazebo來開發
47
看個影片就有概念了
• https://www.youtube.com/watch?v=_8AhNWKzv2k
48
Gazebo Usage
49
Started Gazebo
• 先確保該安裝的東西都有被安裝
– $ sudo apt-get install ros-indigo-gazebo-*
– $ sudo apt-get install ros-indigo-pr2-*
• 啟動Gazebo
– $ gazebo
• 加入一些模型並存成world file
50
Play around with Rviz
51
SLAM & Navigation
52
先來個 SLAM 的 DEMO
• Gazebo 開啟 PR2 進行 SLAM
53
讓我們來實際操作
• Gazebo 開啟 PR2 進行 SLAM
– $ roslaunch pr2_gazebo pr2_empty_world.launch
– $ 加入自己喜歡的模型
– $ roslaunch pr2_build_map.launch
– $ rviz
– $ roslaunch pr2_teleop teleop_keyboard.launch
– $ rosrun map_server map_saver
54
SLAM 演算法簡介
• gmapping package (grid mapping)
http://wiki.ros.org/gmapping
• Grid map
–Map is presented by 2D array
–Each grid
• 0: free
• 1: occupied
55
Map representation
56
Map representation
• Given sensor data zt and the poses of the sensor xt,
estimate the map
• 推導就不細講了
– http://ais.informatik.uni-
freiburg.de/teaching/ws12/mapping/pdf/slam11-gridmaps-4.pdf
57
Resources you can leverage
• ROS wiki
http://wiki.ros.org/
• ROS Answers
http://answers.ros.org/questions/
• Gazebo Answers
http://answers.gazebosim.org/questions/
• ROS Taipei 中文資源整理
https://hackpad.com/-ROS-Blog--lnDeWhHXH4T
58
ROS 2.0
• 欲改進的點
– 多機器人協作 (ROS 1.0是for PR2開發的)
– 嵌入式平台開發 (不必再透過一層額外driver)
– real-time系統 (能有更精準的控制能力)
– 適用於產品開發 (原本偏向學術研究用)
– 設計模式的建立
59
ROS 2.0 學習資源
• Official website
– http://design.ros2.org/
• ROS 2.0 中文翻譯( under construction…)
– http://po-jen.github.io/design/
• Tutorials from Erle-Robotics
– http://erlerobotics.com/docs/Robot_Operating_System/ROS_2/T
utorials/index.html
60
Thanks for joining, you guys rock!
61
Appendix I
如何使用第三方提供的
package
62
Example - ros_caffe
• Github page
– https://github.com/tzutalin/ros_caffe
• Tutorial
– http://www.artificialhumancompanions.com/integrating-ros-caffe-
opencv-on-the-autonomous-deep-learning-robot/
• 使用topic_tools轉換Gazebo的PR2的topic name
– rosrun topic_tools relay /wide_stereo/left/image_raw
/camera/rgb/image_raw
63

Weitere ähnliche Inhalte

Was ist angesagt?

Docker for Development
Docker for DevelopmentDocker for Development
Docker for Developmentallingeek
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internallySeongJae Park
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHiroshi SHIBATA
 
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekJDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekPROIDEA
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mrubyHiroshi SHIBATA
 
Work shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemWork shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemJoão Pedro Harbs
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and futureHiroshi SHIBATA
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applicationsTerry Chen
 
Wonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSWonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSVlatko Kosturjak
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHiroshi SHIBATA
 
Ripping web accessible .git files
Ripping web accessible .git filesRipping web accessible .git files
Ripping web accessible .git filesVlatko Kosturjak
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidVlatko Kosturjak
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Gosuke Miyashita
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldSATOSHI TAGOMORI
 
Gemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyGemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyHiroshi SHIBATA
 
Convert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build ServiceConvert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build ServiceSUSE Labs Taipei
 
Embedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationEmbedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationPaolo Predonzani
 

Was ist angesagt? (20)

Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekJDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
 
Work shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemWork shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystem
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
Wonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSWonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCS
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby Core
 
Ripping web accessible .git files
Ripping web accessible .git filesRipping web accessible .git files
Ripping web accessible .git files
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Gemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyGemification plan of Standard Library on Ruby
Gemification plan of Standard Library on Ruby
 
Convert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build ServiceConvert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build Service
 
Embedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationEmbedding Groovy in a Java Application
Embedding Groovy in a Java Application
 

Ähnlich wie COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊

ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerJürgen Gutsch
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Railselliando dias
 
Codemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift PrimerCodemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift PrimerEric D. Schabell
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
Women Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopWomen Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopEddie Lau
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2tianyi5212222
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2http403
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2Wyatt Fang
 
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...OpenShift Origin
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tourq3boy
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBMongoDB
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chefLeanDog
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Chris Tankersley
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engverNaoki Sekiguchi
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShiftSteven Pousty
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerEric D. Schabell
 
Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Clark Everetts
 

Ähnlich wie COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊 (20)

ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
Codemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift PrimerCodemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift Primer
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
Women Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopWomen Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API Workshop
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
 
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDB
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
 
Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017
 

Mehr von Po-Jen Lai

漫談台灣機器人 產業&發展
漫談台灣機器人 產業&發展漫談台灣機器人 產業&發展
漫談台灣機器人 產業&發展Po-Jen Lai
 
Large scale object recognition (AMMAI presentation)
Large scale object recognition (AMMAI presentation)Large scale object recognition (AMMAI presentation)
Large scale object recognition (AMMAI presentation)Po-Jen Lai
 
iCeiRA碩班研究指導
iCeiRA碩班研究指導iCeiRA碩班研究指導
iCeiRA碩班研究指導Po-Jen Lai
 
Seminar報告_20150520
Seminar報告_20150520Seminar報告_20150520
Seminar報告_20150520Po-Jen Lai
 
淺談台灣機器人 產業&發展
淺談台灣機器人 產業&發展淺談台灣機器人 產業&發展
淺談台灣機器人 產業&發展Po-Jen Lai
 
Drove v.english
Drove v.englishDrove v.english
Drove v.englishPo-Jen Lai
 

Mehr von Po-Jen Lai (6)

漫談台灣機器人 產業&發展
漫談台灣機器人 產業&發展漫談台灣機器人 產業&發展
漫談台灣機器人 產業&發展
 
Large scale object recognition (AMMAI presentation)
Large scale object recognition (AMMAI presentation)Large scale object recognition (AMMAI presentation)
Large scale object recognition (AMMAI presentation)
 
iCeiRA碩班研究指導
iCeiRA碩班研究指導iCeiRA碩班研究指導
iCeiRA碩班研究指導
 
Seminar報告_20150520
Seminar報告_20150520Seminar報告_20150520
Seminar報告_20150520
 
淺談台灣機器人 產業&發展
淺談台灣機器人 產業&發展淺談台灣機器人 產業&發展
淺談台灣機器人 產業&發展
 
Drove v.english
Drove v.englishDrove v.english
Drove v.english
 

Kürzlich hochgeladen

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊

  • 1. ROS + Gazebo 機器人模擬器 工作坊 Presenter: 賴柏任 https://www.facebook.com/PoJenLai 08.20.2016 Brought to you by COSCUP 2016
  • 2. Who am I • 大學時有幸透過專題接觸 ROS,並陸續發表一 些 ROS 的介紹文章 https://pojenlai.wordpress.com/ • 研究所的論文內容也是用 ROS 來開發 https://github.com/Po- Jen/transparent_objects/tree/addedfeature • 工作閒暇之餘希望可以持續學習、也提供更多 資源給大家 http://blog.techbridge.cc/ http://weekly.techbridge.cc/ 2
  • 3. Who am I • 順便推薦一下 ROS.Taipei 社群 https://www.facebook.com/groups/122728288090359/ 3
  • 4. Outline • ROS Introduction • ROS Basic Mechanism • ROS Tool Overview • Gazebo Introduction • Gazebo Usage • Navigation & SLAM 4
  • 6. What is ROS ? 6 http://answers.ros.org/question/12230/what-is-ros-exactly-middleware-framework-operating-system/#18055 • ROS is acronym for Robot OS, but it is not a traditional OS like Windows, Ubuntu or Mac OS
  • 7. What is ROS ? 7 • Before we move on, we should clarify something • Robot software = Distributed computing system Decision Maker Object Recognition Object GraspingNavigation
  • 8. What is ROS ? 8 • ROS is a set of tools which enables – Easy construction of distributed computing systems (Programs can be individually designed and easily connected at runtime) – Code reuse – Configuring, starting, introspecting, debugging, visualizing, logging, testing, and stopping distributed computing systems
  • 9. Why is ROS preferred ? 9 • It encourages users not to reinvent the wheel
  • 10. Why is ROS preferred ? 10 • Many open-sourced libraries – SLAM (OpenSLAM) – Real-time control(OROCOS) – Path Planning (Openrave) – Vision (OpenCV, PCL) – 3D Simulator (Gazebo) – 3D Visualizer (Rviz)
  • 11. Why is ROS preferred ? 11 • Package can be written in multiple programming languages – C++ – Python – Lisp • And many more experimental support – C#, Go, Haskell, Java, Node.js, Lua, R, Ruby – http://wiki.ros.org/Client%20Libraries
  • 12. Can ROS be used on different robot? 12 • Of course! • Check all robots using ROS - http://wiki.ros.org/Robots https://vimeo.com/146183080
  • 13. ROS Basic Mechanism & Tool 13
  • 14. 建立ROS workspace • 建立一個空的環境並編譯 – $ mkdir -p ~/catkin_ws/src – $ cd ~/catkin_ws/src – $ catkin_init_workspace – $ cd ~/catkin_ws – $ catkin_make 14
  • 15. File System • Basic unit - package – CMakeLists.txt – package.xml • ROS package 使用catkin 這工具來進行編譯 – 按照 ROS 規定的格式寫code,就可以用catkin編譯 15
  • 16. rosbuild v.s. catkin • rosbuild – ROS Groovy之前的編譯系統 – 有部分package仍未porting到catkin上,故仍需略懂 – 所有原始碼和編譯後的檔案都在同一資料夾下 • Catkin – ROS Groovy之後的編譯系統 – 原始碼和編譯後的檔案分離 • 接著直接來寫個node看看怎麼編譯 16
  • 17. ROS Node • Basic unit of program 17 Decision Maker Object Recognition Object GraspingNavigation Node 1 Node 2 Node 3 Node 4
  • 19. Create our first package & write a node • 步驟先全部列在這,接著讓我們一步步來做 – cd ~/catkin_ws/src catkin_create_pkg coscup_1_node rospy cd coscup_1_node vim src/node.py chmod +x src/node.py cd ../.. catkin_make source devel/setup.bash roscore rosrun coscup_1_node node.py rqt_graph 19
  • 20. ROS Master • How do node knows each other? => ROS Master • Control the graph of nodes 20
  • 21. rqt_graph • Visualization of nodes and topics • Part of rqt (integrates lots of debugging tools) 21
  • 22. How do ROS node communicate? • ROS master as a message hub? – What if there are many nodes? 22
  • 23. How do ROS node communicate? • Let nodes communicates with each other directly – Topic, Service, ActionLib • If ROS does not exists – Socket – Shared memory – We have to take care of these tedious work. 23
  • 24. ROS Topic • Publisher/Subscriber mechanism (topic == bucket) 24 Perception Object Recognition Semantic Map Camera data Recognition result
  • 25. rostopic • 寫一個publisher (一直丟字串到topic_name這個topic) – catkin_create_pkg coscup_2_topic rospy std_msgs cd coscup_2_topic vim src/publisher.py chmod +x src/publisher.py cd ../.. catkin_make source devel/setup.bash roscore rosrun coscup_2_topic publisher.py rqt_graph rostopic echo topic_name rostopic list rostopic list | grep topic 25
  • 26. rqt_graph • Now, it should looks like 26
  • 27. rostopic • 寫一個subscriber (從topic_name這個topic取出data) – cd ~/catkin_ws/src cd coscup_2_topic vim src/subscriber.py chmod +x src/subscriber.py rosrun coscup_2_node subscriber.py rqt 27
  • 28. rqt_graph • Now, it should looks like 28
  • 29. rqt • We can try console 29
  • 30. Define our own msg for topic • 創建一個只有一個int的msg – cd ~/catkin_ws/src cd coscup_2_topic mkdir msg vim msg/Num.msg vim package.xml vim CMakeLists.txt cd ../.. catkin_make source devel/setup.bash rosmsg show coscup_2_topic/Num 30
  • 31. package.xml • Add build dependency and run dependency 31
  • 32. CMakeLists.txt (1) • Add package dependency • Or you can – catkin_create_pkg coscup_2_topic rospy std_msgs message_generation 32
  • 33. CMakeLists.txt (2) • Add build dependency • Add msg file • We use std_msgs/int64 in our msg file 33
  • 34. Publish自己寫的msg • 步驟 – cd ~/catkin_ws/src/coscup_2_topic/ vim src/my_msg_publisher.py chmod +x src/my_msg_publisher.py rosrun coscup_2_topic my_msg_publisher.py rostopic echo my_msg_topic_name 34
  • 35. One more example • geometry_msgs/Twist 35
  • 36. One more example • geometry_msgs/Vector3 36
  • 37. How is the abstraction implemented? 37 /cmd_vel topic Base Controller Motor Speed geometry_msgs/Twist 將速度和角速度 轉成馬達命令
  • 38. ROS Service • Query/Response Style 38 Object Recognition Brain 1 query 2 response
  • 39. ROS Service • 建立一個自己的srv格式 – cd ~/catkin_ws/src catkin_create_pkg coscup_3_service rospy std_msgs cd coscup_3_service mkdir srv vim srv/AddTwoInts.srv vim package.xml vim CMakeLists.txt cd ../.. catkin_make source devel/setup.bash rossrv show coscup_3_service/AddTwoInts 39
  • 40. package.xml • Add build dependency and run dependency 40
  • 41. CMakeLists.txt • Add service file • Add std_msgs dependency 41
  • 42. ROS Service • 寫一個server – cd coscup_3_service vim src/add_two_ints_server.py cd ../.. source devel/setup.bash chmod +x src/add_two_ints_server.py rosrun coscup_3_service add_two_ints_server.py 42
  • 43. ROS Service • 寫一個client,送出request給server – cd coscup_3_service vim src/add_two_ints_client.py chmod +x src/add_two_ints_client.py run coscup_3_service add_two_ints_client.py 5 6 43
  • 44. Rviz • An important tool for data visualization • 先啟動你們的Rviz – $ sudo apt-get install ros-indigo-rviz-* – $ roscore – $ rviz • Will be revisited when we use Gazebo 44
  • 45. Find out more on ROS Cheat Sheet • https://github.com/ros/cheatsheet 45
  • 47. What is Gazebo ? • 3D物理模擬器 –機器人控制 –環境模擬 –物體物理特性模擬 • 用途廣泛 –DARPA Challenge也是用Gazebo來開發 47
  • 50. Started Gazebo • 先確保該安裝的東西都有被安裝 – $ sudo apt-get install ros-indigo-gazebo-* – $ sudo apt-get install ros-indigo-pr2-* • 啟動Gazebo – $ gazebo • 加入一些模型並存成world file 50
  • 51. Play around with Rviz 51
  • 53. 先來個 SLAM 的 DEMO • Gazebo 開啟 PR2 進行 SLAM 53
  • 54. 讓我們來實際操作 • Gazebo 開啟 PR2 進行 SLAM – $ roslaunch pr2_gazebo pr2_empty_world.launch – $ 加入自己喜歡的模型 – $ roslaunch pr2_build_map.launch – $ rviz – $ roslaunch pr2_teleop teleop_keyboard.launch – $ rosrun map_server map_saver 54
  • 55. SLAM 演算法簡介 • gmapping package (grid mapping) http://wiki.ros.org/gmapping • Grid map –Map is presented by 2D array –Each grid • 0: free • 1: occupied 55
  • 57. Map representation • Given sensor data zt and the poses of the sensor xt, estimate the map • 推導就不細講了 – http://ais.informatik.uni- freiburg.de/teaching/ws12/mapping/pdf/slam11-gridmaps-4.pdf 57
  • 58. Resources you can leverage • ROS wiki http://wiki.ros.org/ • ROS Answers http://answers.ros.org/questions/ • Gazebo Answers http://answers.gazebosim.org/questions/ • ROS Taipei 中文資源整理 https://hackpad.com/-ROS-Blog--lnDeWhHXH4T 58
  • 59. ROS 2.0 • 欲改進的點 – 多機器人協作 (ROS 1.0是for PR2開發的) – 嵌入式平台開發 (不必再透過一層額外driver) – real-time系統 (能有更精準的控制能力) – 適用於產品開發 (原本偏向學術研究用) – 設計模式的建立 59
  • 60. ROS 2.0 學習資源 • Official website – http://design.ros2.org/ • ROS 2.0 中文翻譯( under construction…) – http://po-jen.github.io/design/ • Tutorials from Erle-Robotics – http://erlerobotics.com/docs/Robot_Operating_System/ROS_2/T utorials/index.html 60
  • 61. Thanks for joining, you guys rock! 61
  • 63. Example - ros_caffe • Github page – https://github.com/tzutalin/ros_caffe • Tutorial – http://www.artificialhumancompanions.com/integrating-ros-caffe- opencv-on-the-autonomous-deep-learning-robot/ • 使用topic_tools轉換Gazebo的PR2的topic name – rosrun topic_tools relay /wide_stereo/left/image_raw /camera/rgb/image_raw 63