PDF ROS Robot Programming Book by Turtlebo3 Developers Yoonseok Pyo download
PDF ROS Robot Programming Book by Turtlebo3 Developers Yoonseok Pyo download
com
https://ebookmeta.com/product/ros-robot-programming-book-by-
turtlebo3-developers-yoonseok-pyo/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-robotics-programming-made-easy-lentin-joseph/
ebookmeta.com
https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-robotics-programming-made-easy-2nd-edition-lentin-joseph/
ebookmeta.com
https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-2nd-edition-lentin-joseph-aleena-johny/
ebookmeta.com
https://ebookmeta.com/product/financial-accounting-robert-libby/
ebookmeta.com
Cambridge IGCSE English Student Book Cambridge
International Examinations 3rd Edition Mike Gould
https://ebookmeta.com/product/cambridge-igcse-english-student-book-
cambridge-international-examinations-3rd-edition-mike-gould/
ebookmeta.com
https://ebookmeta.com/product/organizational-behavior-bridging-
science-and-practice-version-4-0-4th-edition-talya-bauer/
ebookmeta.com
https://ebookmeta.com/product/sport-and-exercise-psychology-2nd-
edition-andrew-michael-lane/
ebookmeta.com
https://ebookmeta.com/product/in-their-hearts-their-captive-
bride-3-1st-edition-julia-sykes/
ebookmeta.com
https://ebookmeta.com/product/the-shortcut-1st-edition-nello-
cristianini/
ebookmeta.com
EU External Relations Law: Text, Cases and Materials 2nd
Edition Ramses A Wessel
https://ebookmeta.com/product/eu-external-relations-law-text-cases-
and-materials-2nd-edition-ramses-a-wessel/
ebookmeta.com
Robot Programming
From the basic concept to practical programming and robot application
Reproduction and modification of this book in any form or by means is strictly prohibited
without the prior consent or the written permission from the publisher.
ROS
Robot Programming
YoonSeok Pyo, HanCheol Cho, RyuWoon Jung, TaeHoon Lim
Preface
This book is a ROS robot programming guide based on the experiences we had
accumulated from ROS projects. We tried to make this a comprehensive guide
that covers all aspects necessary for a beginner in ROS. Topics such as
embedded system, mobile robots, and robot arms programmed with ROS are
included. For those who are new to ROS, there are footnotes throughout the
book providing more information on the web. Through this book, I hope that
more people will be aware of and participate in bringing forward the ever-
accelerating collective knowledge of Robotics Engineering.
Lastly, I would like to thank everybody who helped in publishing this book. I
am also grateful to Morgan, Brian, Tully and all ROS development team,
maintainers and contributors. A sincere gratitude to the ROS experts Jihoon
Lee, Byeongkyu Ahn, Keunman Jung, Changhyun Sung, Seongyong Koo, who
always shine new knowledge on me. I look forward to continue doing more
great things with you all. A special thanks to Changhoon Han, Inho Lee, Will
Son, Jason and Kayla Kim who was pivotal in helping the book be easy to
understand to non-experts. Thanks to the entire ROBOTIS team. This book is
here thanks to the great team, who started this endeavor with the question of
“What is a robot?” I would like to thank members of Open Source Team(OST),
which strives to help more people ponder upon and develop robots. I also
thanks to Jinwook Kim, he is a pillar in the open source ecosystem and
community. Much thanks to the ROS Avengers Hancheol Cho, Ryuwoon Jung,
iv
Preface
and Taehoon Lim, who are all co-authors of this book. A special thanks to my
academic advisor from Kyushu University, Professor Ryo Kurazume and
Professor Tsutomu Hasegawa. You have allowed me to walk the path of a
researcher, and I continue to learn much from you. Thank you for the never-
ending teachings. I would also like to thank Hyungil Park and the entire
administrative team of OROCA who gave me endless support in making this
book. Thank you to all the members from OROCA and to the staff of the
OROCA Open Projects, who is so passionate of the open robotics platform
development. I look forward to more discussions and projects on many topics
regarding robotics. Thanks to the administrators of the Facebook group, the
Korea Open Society for Robotics, and to all my fellow colleagues who deeply
care for and ponder on the robotics. Thanks to the robot game team, RO:BIT,
with whom I have shared my youth. Thanks to the robot research club, ROLAB.
I would also like to thank the CEO, Bill(Byoungsoo) Kim, and CTO, Inyong Ha,
of ROBOTIS whose support my all activity so that I can write this book.
Last but not least, I would like to thank my loving family. To my parents: I love,
admire, and always thank you. I would like to extend my love and gratitude to
my parents-in-law, who always support me by my side. To my loving wife
Keunmi Park, who always takes care of me: I love you, always thank you, and
wish to live in much happiness with you! To my son, Jian, and daughter, Jiwoo,
who I cherish most in this world: I will always try to be a father that makes this
world brighter and happier!
July 2017,
Yoon Seok Pyo
v
Preface
I would like to thank Hyung Joon Pyo, Hyung il Park, and Byung Hoon Park for
our joined efforts in creating OpenCR. I will cherish memories of you helping
me to overcome my shortcomings. I am also grateful to Open Source Team
(OST) members who always make me cheerful and happy. I would like to
thank In wook Kim for giving me generous advice and encouragement during
difficult times since the beginning of my career. I would also like to thank
Byoung Soo Kim, the CEO of ROBOTIS for giving me the opportunity for a new
challenge in my life. When I was young, I read his writings in the Hitel online
society, which allowed me to learn a lot and eventually led me to make robots,
and ultimately I was able to join his company to make robots.
I promise to be a good father to my loving son, Yu Chan, who I have not been
able to play with a lot for the excuse of being busy. I would like to express my
love and gratitude to my wife Kyoung Soon, who always gives me strength
when I am in need and returns my immature behaviors with love and care.
July 2017,
Han Cheol Cho
vi
Preface
Now, make robots as we imagined! There was a time when I used to make
robots using the robot kits enclosed in books. Even when I would succeed in
making simple movements, I was so pleased and content thinking “This is a
robot!” However, in recent years, many concepts of robots have been redefined
through the enhancement of computer performance, decreasing cost of
equipment, and the rapid and convenient prototyping of materials. Hobbyists
began to dive into making robots, growing the mass of information. Even cars,
planes, and submarines can now be called robot platforms as makers began to
automate their own products. As people in various fields started to incorporate
technology that encompasses a wide range of knowledge, robots have finally
begun taking the form of what it has long been dreamed of. At the first glance,
we may say that the robotics society is at a great age, but on the other side of
this progress, there could be those that have dropped out from the fast-paced
progress and trend of the performance and speed of today’s robots. This could
thereby make robots only accessible to those who have knowledge or the
people inside the industry.
ROS can be the solution to this problem. It is easy to learn and use the skills
required in the field without being an expert. You can save the time and money
it would have taken to aquire the skills that used to be necessary. A system is
developing that allows people to ask the producers about an issue and receive
direct feedback, enhancing the development environment. Companies such
as BMW are currently implementing ROS. It is becoming possible to use ROS
in business or for collaboration. The introduction of ROS can be considered as
having a competitive advantage in the corresponding field.
I hope that I will be able to meet the readers of this book again in the world of
ROS. I would like to express my sincere thanks and appreciation to the
members of Open Source Team (OST), especially Dr. Yoon Seok Pyo, who gave
me the opportunity to participate in writing this book. I would also like to
thank Han Cheol Cho and Tae Hoon Lim, who went through this process with
me amidst various ongoing projects. In addition, I would like to thank
Hyunjong Song and Hyun Suk Kim, who gave me generous advice and help in
the robot society, Jinwook Kim, who helped me so that I could continue
learning about robots, Ki Je Sung, who joined me in hosting the autonomous
driving tournament, and the members of the Oroca AuTURBO project, who I
have spent valuable times with. And I would like to express to appreciation to
my parents for their generous support and care. I want them to know that I
only wish to be able to repay their love somehow. I give my deepest gratitude
to my brother whose company has enriched my life and to Ha Kim, who will
always be by me. First and foremost, I give all the glory to my Creator, God.
July 2017,
Ryu Woon Jung
vii
Preface
Today we can find many videos in articles about how our society, economy,
and culture will change in the future based on state-of-the-art robot technology
and artificial intelligence. Although there is optimism that our lives will
improve thanks to the rapidly developing society, a pessimistic outlook that
the labor market will take a toll is making people more insecure. As such,
research and development on robots and artificial intelligence that is currently
taking place around us will have a profound impact on us in the near future.
Therefore, we have to be more interested in robot technology than we are now
and try to understand and be prepared for the future.
I was in charge of the manipulator part of this book and tried to organize the
ROS, Gazebo, and MoveIt! Wiki contents to be easier to understand. I also tried
filling in gaps by including topics that were not explained in the Wiki which
took me some time to understand. I hope to be a person who can share useful
knowledge with others.
I would first like to thank Dr. Yoon Seok Pyo, who has given me many lessons
as my senior in school and as a supervisor at work. You gave me the courage
and opportunity throughout the entire process of writing this book. I would
also like to thank Dr. Chang Hyun Seong for reviewing my writing in spite of
your busy schedule, and for kindly answering all my questions. Special thanks
to my Open Source Team colleagues whom I spend time with from morning to
evening, and to the whole ROBOTIS company members who have always greet
viii
Preface
me with smiles. I personally want to thank Professor Jong ho Lee, who was my
professor at my graduate school. Under his guidance, I was able to develop not
only engineering knowledge and research but also integrity, patience and
responsibility. Thank you once again.
Lastly, I would like to express my love and gratitude to my loving father who is
always by my side with a warm heart, my mother who has such curiosity and
creativity and is always open to learn from everything, and my only brother
with whom I always feel most comfortable. I would like to thank Go Eun Kim,
who has stood by my side for the past seven years with understanding and
enduring love. You make my heart beat each day.
July 2017,
Tae Hoon Lim
ix
About the Authors
YoonSeok Pyo
HanCheol Cho
x
About the Authors
RyuWoon Jung
TaeHoon Lim
xi
Open Source Contents
≆≆ https://github.com/ROBOTIS-GIT/robotis_tools → Chapter 3
≆≆ https://github.com/ROBOTIS-GIT/turtlebot3_deliver → Chapter 12
≆≆ https://github.com/ROBOTIS-GIT/open_manipulator → Chapter 13
xii
Open Source Contents
≆≆ OpenCR (Chapter 9)
• Board: https://github.com/ROBOTIS-GIT/OpenCR-Hardware
• Burger: http://www.robotis.com/service/download.php?no=676
• Waffle: http://www.robotis.com/service/download.php?no=677
• Chain: http://www.robotis.com/service/download.php?no=690
• SCARA: http://www.robotis.com/service/download.php?no=691
• Link: http://www.robotis.com/service/download.php?no=692
xiii
Open Source Contents
➊ Direct Download
To use the “git” command to download directly in Linux, you will need to install git. Open a
terminal window and install git as follows:
You can download the source code of the repository with the following command.
(e.g.: ros_tutorials Package)
xiv
Open Source Contents
In addition, the contents related to the OpenCR controller for building ROS embedded systems
covered in this book and OpenManipulator for learning manipulation are also available.
Information about Dynamixel, which is used as an actuator for TurtleBot3 and OpenManipulator,
and its required software of Dynamixel SDK and Dynamixel Workbench can also be found from
below links.
Lastly, there are materials that can be used as ROS study reference. It contains chapter-by-chapter
summaries as well as case examples that are very useful if used together with this book, for college
courses, group studies and seminars.
xv
Open Source Contents
ROS Discourse is for news and general interest discussions. ROS Answers provides a forum which
can be filtered by tags to make sure the relevant people can find and/or answer the question, and
not overload everyone with hundreds of posts. Robot Source Community is a robotics technology
sharing community for robot developers.
Disclosure
≆≆ The open source code used in this book is governed by the respective designated license, and the
copyright owner or contributor is not responsible nor liable, in its sole discretion, for any direct or
indirect damages, incidental or consequential damages, special or general damages, illegal or negligent
infringements arising out of the use of the software.
≆≆ The open source code used in this book may differ from the actual code depending on the version
used by the reader.
≆≆ Company names and product names appearing in this book are generally registered trademarks of the
respective companies, and related signs such as TM, ©, ® are omitted in the text.
≆≆ If you have any questions regarding the contents of this book, please contact the publisher or use the
community mentioned above.
Contents
xvii
Contents
4.3. Message 60
4.3.1. msg File 62
4.3.2. srv File 62
4.3.3. action File 63
4.4. Name 64
xviii
Contents
xix
Contents
7.3. Creating and Running Service Servers and Client Nodes 162
7.3.1. Creating a Package 162
7.3.2. Modifying the Package Configuration File (package.xml) 163
xx
Contents
7.4. Writing and Running the Action Server and Client Node 172
7.4.1. Creating a Package 173
7.4.2. Modifying the Package Configuration File (package.xml) 173
7.4.3. Modifying the Build Configuration File (CMakeLists.txt) 174
7.4.4. Writing the Action File 175
7.4.5. Writing the Action Server Node 176
7.4.6. Writing the Action Client Node 179
7.4.7. Building a Node 180
7.4.8. Running the Action Server 180
7.4.9. Running the Action Client 182
xxi
Contents
xxii
Contents
xxiii
Contents
xxiv
Contents
xxv
Contents
Chapter 13 Manipulator
index 456
xxvi
Chapter 1
Robot
Software Platform
Within the IT industry Hardware, Operating System, Application, and User are said to be the
four main ecosystem components of a platform as shown in Figure 1-2. When all these
components exist and when there are an unseen division and collaboration of work between
these components, it is said that a platform can successfully become popular and personalized.
The previously mentioned PC and PP did not have all four of these components from the
beginning. At the beginning, they only had an on-board software to operate a specific hardware
device using the hardware dedicated firmware developed by one company and could only use
services provided by the manufacturer. If this concept is hard to understand, let’s use feature
phones as an example. Feature phones were produced by innumerable manufacturers before
the advent of the iPhone from Apple. One can say that the common factor that allowed the
success of these PC or PP is the appearance of operating systems (Windows, Linux, Android,
iOS, etc.). The appearance of operating systems unified hardware and software which led to the
modularity of hardware. Mass production reduced cost, specialized development brought high
performance, and ultimately made it possible for computers and mobile phones to be
personalized.
Among these software platforms, major platforms are Robot Operating System (ROS)1,
Japanese Open Robotics Technology Middleware (OpenRTM)2, European real-time control
centered OROCOS3, Korean OPRoS4, etc. Although their names are different, the fundamental
reason of advent of robot software platforms is because there are too many different kinds of
robot software, and their complications are causing many problems. Therefore robot researchers
from around the world are collaborating to find a solution. The most popular robot software
platform is ROS, a Robot Operating System that will be covered in this book.
For instance, when implementing a function that helps a robot to recognize its surrounding
situation, the diversity of hardware and the fact that it is directly applied in real-life can be a
burden. Some tasks may be considered easy for humans, but researchers in a college laboratory
or company are too difficult to deal with robots to perform a lot of functions such as sensing,
recognition, mapping, and motion planning. However, it would be a different story if
professionals from around the world shared their specialized software to be used by others. For
example, the robotics company Robotbase5, which drew attention in the social funding
KickStarter and CES2015, recently developed the Robotbase Personal Robot and successfully
launched it through a social funding. In the case of Robotbase, they focused on their core
technology which is face recognition and object recognition, and for their mobile robot they
used the mobile robot base from Yujin Robot6 which supports ROS, for the actuator they used
ROBOTIS Dynamixel7, and for the obstacle recognition, navigation, motor drive, etc. they used
the public package of ROS. Another example can be found in the ROS Industrial Consortium
(ROS-I)8. Many of the companies leading the industrial robot field participate in this consortium
and are solving some of the newly emerging and difficult problems from the industrial robot
field one by one, such as in automation, sensing, and collaborative robot. Using a common
platform, especially a software platform, is proved to be promoting collaboration to solve
problems that were previously difficult to tackle and increasing efficiency.
1 http://www.ros.org/
2 http://openrtm.org
3 http://www.orocos.org/
4 http://ropros.org/
5 https://www.kickstarter.com/projects/403524037/personal-robot
6 http://www.yujinrobot.com/
7 http://www.robotis.com
8 http://rosindustrial.org/
399
“Some few nights since,” he wrote, Dec. 20, 1813, “the
weather promised an opportunity for this squadron to get to sea,
and it was said on shore that we intended to make the attempt.
In the course of the evening two blue lights were burned on both
the points at the harbor’s mouth as signals to the enemy; and
there is not a doubt but that they have, by signals and otherwise,
instantaneous information of our movements. Great but
unsuccessful exertions have been made to detect those who
communicated with the enemy by signal.... Notwithstanding
these signals have been repeated, and have been seen by
twenty persons at least in this squadron, there are men in New
London who have the hardihood to affect to disbelieve it, and the
effrontery to avow their disbelief.”
Sunday, May 30, the ship was ready, though the crew was not as
good or as well disciplined as it should have been, and showed
some discontent owing to difficulties about prize-money. On the
morning of June 1 the frigate was lying in President’s Roads, when
between eight and nine o’clock the second lieutenant, George Budd,
reported a sail in sight. Captain Lawrence went up the main rigging,
and having made out the sail to be a large frigate, ordered the crew
to be mustered, and told them he meant to fight. At midday he stood
down the harbor and out to sea. The “Shannon,” outside, stood off
under easy sail, and led the way until five o’clock, when she luffed
and waited till the “Chesapeake” came up. As the wind was westerly,
Lawrence had the choice of position, but he made no attempt to
profit by his advantage, although it might have been decisive.
Bringing the “Chesapeake” with a fresh breeze directly down on the
“Shannon’s” quarter, at half-past five he luffed, at about fifty yards
distance, and ranged up abeam on the “Shannon’s” starboard side.
The “Shannon” opened fire as her guns began to bear, but
discharged only her two sternmost guns when the “Chesapeake”
replied. The two ships ran on about seven minutes, or about the
length of time necessary for two discharges of the first guns fired,
when, some of the “Shannon’s” shot having cut away the
“Chesapeake’s” foretopsail tie and jib-sheet, the ship came up into
the wind and was taken aback. Lying with her larboard quarter
toward the “Shannon’s” side, at some forty or fifty yards distance,
she began to drift toward her enemy. None of the “Chesapeake’s”
guns then bore on the “Shannon,” and the American frigate wholly
ceased firing.
From the moment the “Chesapeake” was taken aback she was a
beaten ship, and the crew felt it. She could be saved only by giving
her headway, or by boarding the “Shannon;” but neither expedient
was possible. The effort to make sail forward was tried, and proved
futile. The idea of boarding was also in Lawrence’s mind, but the
situation made it impracticable. As the “Chesapeake” drifted stern-
foremost toward the “Shannon,” every gun in the British broadside
swept the American deck diagonally from stern to stem, clearing the
quarter-deck and beating in the stern-ports, while the musketry from
the “Shannon’s” tops killed the men at the “Chesapeake’s” wheel,
and picked off every officer, sailor, or marine in the after-part of the
ship. Boarders could not be rallied under a fire which obliged them to
seek cover. The men on the spar-deck left their stations, crowding
forward or going below.
Chesapeake
Shannon