100% found this document useful (3 votes)
59 views

PDF ROS Robot Programming Book by Turtlebo3 Developers Yoonseok Pyo download

Programming

Uploaded by

pogibavorfi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
59 views

PDF ROS Robot Programming Book by Turtlebo3 Developers Yoonseok Pyo download

Programming

Uploaded by

pogibavorfi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download Full Version ebook - Visit ebookmeta.

com

ROS Robot Programming Book by Turtlebo3 Developers


Yoonseok Pyo

https://ebookmeta.com/product/ros-robot-programming-book-by-
turtlebo3-developers-yoonseok-pyo/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmeta.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

Robot Operating System (ROS) for Absolute Beginners:


Robotics Programming Made Easy Lentin Joseph

https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-robotics-programming-made-easy-lentin-joseph/

ebookmeta.com

Robot Operating System (ROS) for Absolute Beginners:


Robotics Programming Made Easy 2nd Edition Lentin Joseph

https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-robotics-programming-made-easy-2nd-edition-lentin-joseph/

ebookmeta.com

Robot Operating System (ROS) For Absolute Beginners - 2nd


Edition Lentin Joseph & Aleena Johny

https://ebookmeta.com/product/robot-operating-system-ros-for-absolute-
beginners-2nd-edition-lentin-joseph-aleena-johny/

ebookmeta.com

Financial Accounting Robert Libby

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

Organizational Behavior Bridging Science and Practice


Version 4 0 4th Edition Talya Bauer

https://ebookmeta.com/product/organizational-behavior-bridging-
science-and-practice-version-4-0-4th-edition-talya-bauer/

ebookmeta.com

Sport and Exercise Psychology 2nd Edition Andrew Michael


Lane

https://ebookmeta.com/product/sport-and-exercise-psychology-2nd-
edition-andrew-michael-lane/

ebookmeta.com

In Their Hearts Their Captive Bride 3 1st Edition Julia


Sykes

https://ebookmeta.com/product/in-their-hearts-their-captive-
bride-3-1st-edition-julia-sykes/

ebookmeta.com

The Shortcut 1st Edition Nello Cristianini

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

A Handbook Written by TurtleBot3 Developers


YoonSeok Pyo I HanCheol Cho I RyuWoon Jung I TaeHoon Lim
ROS Robot Programming
Authors YoonSeok Pyo, HanCheol Cho, RyuWoon Jung, TaeHoon Lim

First Edition Dec 22, 2017

Published by ROBOTIS Co.,Ltd.


Address #1505, 145, Gasan Digital 1-ro, GeumCheon-gu, Seoul, Republic of Korea
E-mail [email protected]
Website www.robotis.com
ISBN 979-11-962307-1-5

ALL RIGHTS RESERVED


Copyright © 2017 ROBOTIS Co., Ltd.

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

Robotics Engineering has great expectations laid upon it as an up-and-


coming industry and the next-generation growth power, even though it
currently has no clear business models except for industrial robots. The
problem is that it has been this way for over ten years, and there is still no
clear change since then. Why is this? Although there may be many
explanations, it stands that there are still many limitations on applying
robotics engineering to a business model. Commercialization still remains a
great task for this field. In order to solve this, there must be cooperation on a
global scale. This can be achieved through software platforms supported by
active communities. In the case of ROS, Robot Operating System, there are
academic researchers, industry personnel, and hobbyists all participating in
the development process. Furthermore, the people involved range from
robotics majors to network experts, computer scientists, and computer vision
specialists, bringing together a wide range of expertise not only in the robotics
industry but through cross-disciplinary fields. I expect robotics engineering to
develop towards a different path than the one it has been taking, solving
problems that were out of reach until now through cooperation and exchange
of resources. The time has come that robotics engineering is not a mere
industry of tomorrow, but an industry of today.

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

Robots consist of many functional components and require specialized skills


in various fields. Therefore, there are still many technical limitations that
must be overcome and additional research necessary for robots to be used at a
level of everyday life. In order to do this, not only experts but also companies
in related industries and general users must collaborate in the effort. Beyond
the implementation and utilization of robots, we need a platform for
collaboration and technical progress, and I think that is ROS. ROS has various
elements for spreading and lowering entry barriers to technology. I hope that
the ROS platform will aid in the accumulation of knowledge and technology,
and new robots will be able to join our lives based on this.

Embedded systems control sensors and actuators play an important role in


processing data and configuring robots in real time. Microcontrollers are
generally used for real-time processing, and this book describes methods and
basic examples of using ROS for these embedded systems. I hope that it will be
helpful for users who use ROS to set up an embedded system.

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.

Open source is contributing to the development and popularization of


technology using collective intelligence in response to the rapidly developing
technologies of today. Robotics technology is now able to evolve through the
collaboration of many people based on open source, and complex algorithms
can be easily integrated into personal robots. We can prevent technology from
being monopolized by only a specific group to influence society, and we will
be able to overcome the mystery and fear of robots.

My goal is to touch people’s hearts through the application and change of


technology and to get the public more interested in these technologies. As a
first step, we are trying to allow people to learn various robot technologies
from the open source community and to get people to open up their project
code to foster collaboration among many people. Next, I plan to meet with
people who are in other fields and share each other’s thoughts and knowledge.
Through this, I hope to contribute to the popularization of technology in new
ways and provide various experiences that enable people to easily adapt to the
changing society.

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

The lead author, YoonSeok Pyo, is a researcher at ROBOTIS and is the


manager in charge of the Open Source Team. He is researching and
developing an intelligent system for open source based service robot
platform. His work revolves around the question “what are robots to us?” and
strives to bring robots closer to our daily lives. After graduating from Kwang
Woon University in Korea with a degree in Electrical Engineering, he worked
at the Korea Institute of Science and Technology (KIST). He was a research
fellow of the Japan Society for the Promotion of Science (JSPS) from 2014 to
2016 in Japan. He received his Ph.D. and M.E. degrees in Information Science
and Electrical Engineering from Kyushu University, Japan. He enjoys talking
to people who have a dream in the field of robotics. He is always looking for
new adventures and hopes to meet readers of this book through lectures,
seminars, tutorials, and exhibitions related to robots and ROS.

HanCheol Cho

HanCheol is in charge of the firmware and robot controller development at


ROBOTIS. He was previously an ATM firmware developer at LG CNS and is
interested in programming and robots. His interest in robots started when
he first saw the micro mouse robot contest in middle school and has since
enjoyed studying and sharing information on robotics technology. In
particular, he is interested in the firmware that controls the robot hardware
as well as FPGA, and is working with projects in this field. He believes that
technology is most improved when shared, and dreams of still soldering and
programming in the twilight years of his life.

x
About the Authors

RyuWoon Jung

Leon (RyuWoon) Jung is a researcher at ROBOTIS developing autonomous


driving systems and actuator applications. He believes that the value of
robots lies in filling in the gaps in the areas where humans fail to complement
each other and strives to reflect this in the research and development of
robots. Leon received his bachelor's and master's degrees from the
Department of Electrical Engineering and Bioscience at Waseda University.
He has written for the ROBOCON MAGAZINE and is in charge of AutoRace, a
large-scale autonomous driving robot competition. He is currently involved
in the research and development of autonomous driving robots in the Open
Source Robotics Technology Sharing Community (www.oroca.org).

TaeHoon Lim

Darby (TaeHoon) Lim is a ROBOTIS researcher in the Open Source Team


who is responsible for the development of the TurtleBot3 and
OpenManipulator, as well as acting as the keeper of good-looks in the office.
Darby believes that creativity comes from diverse experiences and a broad
range of knowledge, and therefore enjoys traveling, reading and speaking
with people with diverse backgrounds. Darby aims to develop robots that
can convey a different experience and leave an impression to many people,
using collaboration with people in fields such as movies, exhibitions, and
media to achieve this. He is hosting the “LookSo in Film” open project in
OROCA since 2016 as a bummer scriptwriter and software engineer.

xi
Open Source Contents

Open Source Software and Hardware


All of the open source software and hardware used in this book are publicly available on the
GitHub and Onshape and are being continuously updated with user feedbacks and improvements.
The following list of the GitHub and Onshape links are related to the open source software and
hardware used in this book.

Open Source Software List

≆≆ https://github.com/ROBOTIS-GIT/robotis_tools → Chapter 3

≆≆ https://github.com/ROBOTIS-GIT/ros_tutorials → Chapter 4, Chapter 7, Chapter 13

≆≆ https://github.com/ROBOTIS-GIT/DynamixelSDK → Chapter 8, Chapter 10

≆≆ https://github.com/ROBOTIS-GIT/dynamixel-workbench → Chapter 8, Chapter 13

≆≆ https://github.com/ROBOTIS-GIT/dynamixel-workbench-msgs → Chapter 8, Chapter 13

≆≆ https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver → Chapter 8, Chapter 10, Chapter 11

≆≆ https://github.com/ROBOTIS-GIT/OpenCR → Chapter 9, Chapter 12

≆≆ https://github.com/ROBOTIS-GIT/turtlebot3 → Chapter 10, Chapter 11

≆≆ https://github.com/ROBOTIS-GIT/turtlebot3_msgs → Chapter 10, Chapter 11

≆≆ https://github.com/ROBOTIS-GIT/turtlebot3_simulations → Chapter 10, Chapter 11

≆≆ https://github.com/ROBOTIS-GIT/turtlebot3_applications → Chapter 10, Chapter 11

≆≆ https://github.com/ROBOTIS-GIT/turtlebot3_deliver → Chapter 12

≆≆ https://github.com/ROBOTIS-GIT/open_manipulator → Chapter 13

xii
Open Source Contents

Open Source Hardware List

≆≆ OpenCR (Chapter 9)

• Board: https://github.com/ROBOTIS-GIT/OpenCR-Hardware

≆≆ TurtleBot3 (Chapter 10, Chapter 11, Chapter 12, Chapter 13)

• Burger: http://www.robotis.com/service/download.php?no=676

• Waffle: http://www.robotis.com/service/download.php?no=677

• Waffle Pi: http://www.robotis.com/service/download.php?no=678

• Friends OpenManipulator Chain: http://www.robotis.com/service/download.php?no=679

• Friends Segway: http://www.robotis.com/service/download.php?no=680

• Friends Conveyor: http://www.robotis.com/service/download.php?no=681

• Friends Monster: http://www.robotis.com/service/download.php?no=682

• Friends Tank: http://www.robotis.com/service/download.php?no=683

• Friends Omni: http://www.robotis.com/service/download.php?no=684

• Friends Mecanum: http://www.robotis.com/service/download.php?no=685

• Friends Bike: http://www.robotis.com/service/download.php?no=686

• Friends Road Train: http://www.robotis.com/service/download.php?no=687

• Friends Real TurtleBot: http://www.robotis.com/service/download.php?no=688

• Friends Carrier: http://www.robotis.com/service/download.php?no=689

≆≆ OpenManipulator (Chapter 10, Chapter 13)

• 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

Open Source Software Download


All source codes covered in this book are downloaded from the GitHub repository. There are two
ways to download the source codes: ➊ Direct download using the Git command, and ➋ Download
as a compressed file via a web browser. Please refer to the following instructions for each
download method.

➊ 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:

$ sudo apt-get install git

You can download the source code of the repository with the following command.
(e.g.: ros_tutorials Package)

$ git clone https://github.com/ROBOTIS-GIT/ros_tutorials.git

➋ Download with a Web Browser

If you enter the address (https://github.com/ROBOTIS-GIT/ros_tutorials) on a web browser, you


will be connected to the GitHub repository. You can download the compressed file by clicking on
'Clone or download', then click on the 'Download ZIP' button in the upper right corner.

xiv
Open Source Contents

Open Source Contents


The latest information about TurtleBot3, which is the official robot platform of ROS, used as course
material in this book can be found in the following public resources. You can build up your ROS
robot programming skills by exercising with these continuously updated open source software and
various examples of TurtleBot3.

≆≆ TurtleBot Homepage http://www.turtlebot.com

≆≆ TurtleBot3 Wiki Page http://turtlebot3.robotis.com

≆≆ TurtleBot3 Video https://www.youtube.com/c/ROBOTISOpenSourceTeam

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.

≆≆ OpenCR [http://emanual.robotis.com/] > [PARTS] > [Controller] > [OpenCR]

≆≆ OpenManipulator [http://emanual.robotis.com/] > [PLATFORM] > [OpenManipulator]

≆≆ Dynamixel SDK http://wiki.ros.org/dynamixel_sdk

[http://emanual.robotis.com/] > [SOFTWARE] > [DYNAMIXEL] > [Dynamixel SDK]

≆≆ Dynamixel Workbench http://wiki.ros.org/dynamixel_workbench

[http://emanual.robotis.com/] > [SOFTWARE] > [DYNAMIXEL] > [Dynamixel Workbench]

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.

≆≆ Lecture Material https://github.com/ROBOTIS-GIT/ros_seminar

≆≆ Reference Material https://github.com/ROBOTIS-GIT/ros_book

≆≆ Source Code for Tutorials https://github.com/ROBOTIS-GIT/ros_tutorials

xv
Open Source Contents

Related Communities and Questions


If you have any questions about ROS, feel free to post them on ROS Answers (http://answers.
ros.org) following our support guidelines: ‘http://wiki.ros.org/Support’. You will be able to get
assistance from the authors as well as anybody with experiences in the forum. If you have direct
questions about this book, feel free to post them on Issue Tracker: ‘https://github.com/ROBOTIS-
GIT/ros_book/issues’.

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.

≆≆ Robot Source Community http://www.robotsource.org/

≆≆ ROS Discourse https://discourse.ros.org/

≆≆ ROS Answers http://answers.ros.org/

≆≆ ROS Wiki http://wiki.ros.org/

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

Chapter 1 Robot Software Platform

1.1. Platform Components 2

1.2. Robot Software Platform 3

1.3. Need for Robot Software Platform 5

1.4. The Future That Robot Software Platform Will Bring 7

Chapter 2 Robot Operating System ROS

2.1. Introduction to ROS 10

2.2. Meta-Operating System 10

2.3. Objectives of ROS 12

2.4. Components of ROS 13

2.5. ROS Ecosystem 14

2.6. History of ROS 15

2.7. ROS Versions 16


2.7.1. Version Rules 18
2.7.2. Version Release Period 19
2.7.3. Selecting a Version 20

Chapter 3 Configuring the ROS Development Environment

3.1. Installing ROS 24


3.1.1. General Installation 24
3.1.2. Quick Installation 29

3.2. ROS Development Environment 29


3.2.1. ROS Settings 29
3.2.2. Integrated Development Environment (IDE) 33

3.3. ROS Operation Test 36

xvii
Contents

Chapter 4 Important Concepts of ROS

4.1. ROS Terminology 41

4.2. Message Communication 49


4.2.1. Topic 50
4.2.2. Service 51
4.2.3. Action 52
4.2.4. Parameter 54
4.2.5. Message Communication Flow 54

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

4.5. Coordinate Transformation (TF) 66

4.6. Client Library 68

4.7. Communication between Heterogenous Devices 68

4.8. File System 69


4.8.1. File Configuration 69
4.8.2. Installation Folder 70
4.8.3. Workspace Folder 71

4.9. Build System 74


4.9.1. Creating a Package 74
4.9.2. Modifying the Package Configuration File (package.xml) 75
4.9.3. Modifying the Build Configuration File (CMakeLists.txt) 78
4.9.4. Writing Source Code 87
4.9.5. Building the Package 88
4.9.6. Running the Node 89

xviii
Contents

Chapter 5 ROS Commands

5.1. ROS Command List 91

5.2. ROS Shell Commands 93


5.2.1. roscd: ROS Change Directory 94
5.2.2. rosls: ROS File List 95
5.2.3. rosed: ROS Edit Command 95

5.3. ROS Execution Commands 95


5.3.1. roscore: Run roscore 96
5.3.2. rosrun: Run ROS Node 97
5.3.3. roslaunch: Launch Multiple Nodes 98
5.3.4. rosclean: Examine and Delete ROS Logs 99

5.4. ROS Information Commands 99


5.4.1. Run Node 100
5.4.2. rosnode: ROS Node 101
5.4.3. rostopic: ROS Topic 103
5.4.4. rosservice: ROS Service 107
5.4.5. rosparam: ROS Parameter 110
5.4.6. rosmsg: ROS Message Information 113
5.4.7. rossrv: ROS Service Information 115
5.4.8. rosbag: ROS Log Information 117

5.5. ROS Catkin Commands 121

5.6. ROS Package Commands 124

Chapter 6 ROS Tools

6.1. 3D Visualization Tool (RViz) 129


6.1.1. Installing and Running RViz 132
6.1.2. RViz Screen Components 133
6.1.3. RViz Displays 135

xix
Contents

6.2. ROS GUI Development Tool (rqt) 137

6.2.1. Installing and Running rqt 137


6.2.2. rqt Plugins 138
6.2.3. rqt_image_view 141
6.2.4. rqt_graph 143
6.2.5. rqt_plot 144
6.2.6. rqt_bag 146

Chapter 7 Basic ROS Programming

7.1. Things to Know Before Programming ROS 149

7.1.1. Standard Unit 149


7.1.2. Coordinate Representation 150
7.1.3. Programming Rules 150

7.2. Creating and Running Publisher and Subscriber Nodes 151

7.2.1. Creating a Package 152


7.2.2. Modifying the Package Configuration File (package.xml) 152
7.2.3. Modifying the Build Configuration File (CMakeLists.txt) 153
7.2.4. Writing the Message File 154
7.2.5. Writing the Publisher Node 155
7.2.6. Writing the Subscriber Node 157
7.2.7. Building a Node 158
7.2.8. Running the Publisher 159
7.2.9. Running the Subscriber 160
7.2.10. Checking the Communication Status of the Running Nodes 161

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.3.3. Modifying the Build Configuration File (CMakeLists.txt) 164


7.3.4. Writing the Service File 165
7.3.5. Writing the Service Server Node 166
7.3.6. Writing the Service Client Node 167
7.3.7. Building Nodes 169
7.3.8. Running the Service Server 169
7.3.9. Running the Service Client 170
7.3.10. Using the rosservice call Command 170
7.3.11. Using the GUI Tool, Service Caller 171

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

7.5. Using Parameters 184


7.5.1. Writing the Node using Parameters 184
7.5.2. Setting Parameters 186
7.5.3. Reading Parameters 187
7.5.4. Building and Running Nodes 187
7.5.5. Displaying Parameter Lists 187
7.5.6. Example of Using Parameters 187

7.6. Using roslaunch 189


7.6.1. Using the roslaunch 189
7.6.2. Launch Tag 192

xxi
Contents

Chapter 8 Robot. Sensor. Motor.

8.1. Robot Packages 195

8.2. Sensor Packages 197


8.2.1. Type of Sensors 198
8.2.2. Classification of Sensor Packages 199

8.3. Camera 199


8.3.1. Packages Related to USB Camera 200
8.3.2. USB Camera Test 201
8.3.3. Visualization of Image Information 203
8.3.4. Remote Transfer Images 205
8.3.5. Camera Calibration 207

8.4. Depth Camera 212


8.4.1. Types of Depth Camera 212
8.4.2. Depth Camera Test 215
8.4.3. Visualization of Point Cloud Data 215
8.4.4. Point Cloud Related Library 216

8.5. Laser Distance Sensor 217


8.5.1. Principle of LDS Sensor's Distance Measurement 218
8.5.2. LDS Test 219
8.5.3. Visualization of LDS Distance Values 221
8.5.4. Utilizing LDS 222

8.6. Motor Packages 223


8.6.1. Dynamixel 223

8.7. How to Use Public Packages 224


8.7.1. Searching Packages 225
8.7.2. Installing the Dependency Package 228
8.7.3. Installing the Package 229
8.7.4. Execute Package 230

xxii
Contents

Chapter 9 Embedded System

9.1. OpenCR 235


9.1.1. Characteristics 236
9.1.2. Board Specification 238
9.1.3. Establish Development Environment 241
9.1.4. OpenCR Examples 250

9.2. rosserial 255


9.2.1. rosserial server 256
9.2.2. rosserial client 256
9.2.3. rosserial Protocol 257
9.2.4. Constraints of rosserial 259
9.2.5. Installing rosserial 260
9.2.6. Examples of rosserial 262

9.3. TurtleBot3 Firmware 273


9.3.1. TurtleBot3 Burger Firmware 273
9.3.2. TurtleBot3 Waffle and Waffle Pi Firmware 274
9.3.3. TurtleBot3 Setup Firmware 275

Chapter 10 Mobile Robots

10.1. Robot Supported by ROS 279

10.2. TurtleBot3 Series 279

10.3. TurtleBot3 Hardware 280

10.4. TurtleBot3 Software 283

10.5. TurtleBot3 Development Environment 284

10.6. TurtleBot3 Remote Control 287


10.6.1. Controlling TurtleBot3 287
10.6.2. Visualization of TurtleBot3 289

xxiii
Contents

10.7. TurtleBot3 Topic 290


10.7.1. Subscribed Topic 292
10.7.2. Controlling a Robot using Subscribe Topic 292
10.7.3. Published Topic 293
10.7.4. Verify Robot Status using Published Topics 294

10.8. TurtleBot3 Simulation using RViz 297


10.8.1. Simulation 297
10.8.2. Launch Virtual Robot 298
10.8.3. Odometry and TF 299

10.9. TurtleBot3 Simulation using Gazebo 303


10.9.1. Gazebo Simulator 303
10.9.2. Launch Virtual Robot 305
10.9.3. Virtual SLAM and Navigation 308

Chapter 11 SLAM and Navigation

11.1. Navigation and Components 313


11.1.1. Navigation of Mobile Robot 313
11.1.2. Map 314
11.1.3. Pose of Robot 314
11.1.4. Sensing 317
11.1.5. Path Calculation and Driving 317

11.2. SLAM Practice 317


11.2.1. Robot Hardware Constraints for SLAM 317
11.2.2. Measured Target Environment of SLAM 319
11.2.3. ROS Package for SLAM 320
11.2.4. Execute SLAM 320
11.2.5. SLAM with Saved Bag File 323

xxiv
Contents

11.3. SLAM Application 324


11.3.1. Map 324
11.3.2. Information Required in SLAM 326
11.3.3. SLAM Process 327
11.3.4. Coordinate Transformation (TF) 328
11.3.5. turtlebot3_slam Package 329

11.4. SLAM Theory 332


11.4.1. SLAM 332
11.4.2. Various Localization Methodologies 333

11.5. Navigation Practice 336


11.5.1. ROS Package for Navigation 337
11.5.2. Execute Navigation 337

11.6. Navigation Application 339


11.6.1. Navigation 340
11.6.2. Information Required for Navigation 341
11.6.3. Node and Topic State of turtlebot3_navigation 342
11.6.4. Settings for turtlebot3_navigation 343
11.6.5. Detailed Parameter Setting for turtlebot3_navigation 348

11.7. Navigation Theory 355


11.7.1. Costmap 355
11.7.2. AMCL 357
11.7.3. Dynamic Window Approach (DWA) 359

xxv
Contents

Chapter 12 Service Robot

12.1. Delivery Service Robot 362

12.2. Configuration of a Delivery Service Robot 362


12.2.1. System Configuration 362
12.2.2. System Design 363
12.2.3. Service Core Node 367
12.2.4. Service Master Node 377
12.2.5. Service Slave Node 385

12.3. Android Tablet PC Programming with ROS Java 390

Chapter 13 Manipulator

13.1. Manipulator Introduction 399


13.1.1. Manipulator Structure and Control 399
13.1.2. Manipulator and ROS 402

13.2. OpenManipulator Modeling and Simulation 403


13.2.1. OpenManipulator 403
13.2.2. Manipulator Modeling 404
13.2.3. Gazebo Setting 421

13.3. MoveIt! 429


13.3.1. move_group 429
13.3.2. MoveIt! Setup Assistant 430
13.3.3. Gazebo Simulation 445

13.4. Applying to the Actual Platform 449


13.4.1. Preparing and Controlling OpenManipulator 449
13.4.2. OpenManipulator with TurtleBot3 Waffle and Waffle Pi 454

index 456

xxvi
Chapter 1

Robot
Software Platform

Chapter 1 _ Robot Software Platform 1


1.1. Platform Components

Figure 1-1 PC and Smartphone

“What do these two product groups have in common?”

PC (Personal Computer) and PP (Personal Phone) can be classified as IT products. As their


names suggest, these are personal products that almost everyone possesses. As shown in Figure
1-2, if we break down the commonalities of these products, we can see that they consist of a
hardware module that allows integration with various hardware and operating system that
manages this hardware. The hardware abstraction-based software development environment
provided by the operating system has applications that provide various services and numerous
users who use these product groups.

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.

2 ROS Robot Programming


Figure 1-2 F
 our main components of the ecosystems and the repetition of history that can be seen for PC,
PP, and PR

Furthermore, engineers are capable of developing application programs in the development


environment provided by the operating system even without a thorough understanding of
hardware, and a new job group called App Developers that did not exist even 10 years ago was
introduced in the smartphone field. The modularity of hardware has been progressing around
operating systems in this way, and application programs based on hardware abstraction
provided by the operating system have been separated. Therefore, services that users wished to
get were created and had become the popularized product, or platform. As for PR (Personal
Robot) that is gaining attention along with PC and PP, how far along has the representative
service robot platform progressed? As history is said to repeat itself, will PR come into our lives
as the flow of PC and PP have done before? We will look into this in the next section.

1.2. Robot Software Platform


Recently within the robotics field, platforms have been gaining attention. A platform is divided
into software platform and hardware platform. A robot software platform includes tools that are
used to develop robot application programs such as hardware abstraction, low-level device
control, sensing, recognition, SLAM(Simultaneous Localization And Mapping), navigation,
manipulation and package management, libraries, debugging and development tools. Robot
hardware platforms not only research platforms such as mobile robots, drones and humanoids,
but also commercial products such as SoftBank’s Pepper, MIT Media Lab’s Jibo are spurring the
launch.

Chapter 1 _ Robot Software Platform 3


What is noteworthy is that this hardware abstraction is occurring in conjunction with the
aforementioned software platforms, making it possible to develop application programs using a
software platform even without having expertise in hardware. This is the same with how we can
develop mobile apps without knowing the hardware composition or specifications of the latest
smartphone. Also, as opposed to the previous work process of how robot developers were doing
everything from hardware design to software design, more non-robot field software engineers
can now participate in the development of robot application programs. In other words, software
platforms have allowed many people to contribute to robot development, and robot hardware is
being designed according to the interface provided by software platforms.

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/

4 ROS Robot Programming


Discovering Diverse Content Through
Random Scribd Documents
(Larger)
MAP
OF THE
BATTLE
OF
CRANEY ISLAND
FROM MAPS IN
OFFICE CHIEF OF ENGINEERS
At daylight on the morning of June 22 Beckwith, with about eight
hundred men, landed on the main shore outside of Craney Island,
and pushed forward to take the island in the rear. Soon afterward
Captain Pechell, with about seven hundred men in fifteen boats,
approached the island from the northwest along the shore, far out of
the reach of the gunboats. Toward eleven o’clock the British boats
came within range of the American battery on the island. Contrary to
the opinions of several officers, Captain Pechell insisted on making
the attack independently of Beckwith’s approach, and pushed on.
Two or three hundred yards from land the leading boats grounded in
shoal water. Apparently the men might have waded ashore; but “one
of the seamen, having plunged his boat-hook over the side, found
393
three or four feet of slimy mud at the bottom;” the leading officer’s
boat being aground was soon struck by a six-pound shot, the boat
sunk, and himself and his crew, with those of two other launches,
were left in the water. The other boats took a part of them in, and
then quickly retired.
The affair was not improved by the fortunes of Sir Sydney
Beckwith, who advanced to the rear of Craney Island, where he was
stopped by creeks which he reported too deep to ford, and
accordingly re-embarked his troops without further effort; but the true
causes of the failure seemed not to be understood. Napier thought it
due to the division of command between three heads, Warren,
394
Cockburn, and Beckwith; but incompetence was as obvious as
the division of command. Admiral Warren’s official report seemed to
395
admit that he was also overmatched: —

“Upon approaching the island, from the extreme shoalness


of the water on the seaside and the difficulty of getting across
from the land, as well as the island itself being fortified with a
number of guns and men from the frigate [‘Constellation’] and
the militia, and flanked by fifteen gunboats, I considered, in
consequence of the representation of the officer commanding
the troops of the difficulty of their passing over from the land,
that the persevering in the attempt would cost more men than
the number with us would permit, as the other forts must have
been stormed before the frigate and dock-yard could be
destroyed. I therefore directed the troops to be re-embarked.”

On neither side were the losses serious. The American battery


inflicted less injury than was to be expected. Fifteen British boats
containing at least eight hundred men, all told, remained some two
hours under the fire of two twenty-four-pound and four six-pound
guns, at a range differently estimated from one hundred to three
hundred yards, but certainly beyond musketry fire, for the American
troops had to wade out before firing. Three boats were sunk; three
396
men were killed, and sixteen were wounded. Sixty-two men were
reported missing, twenty-two of whom came ashore from the boats,
397
while forty deserted from Beckwith’s land force. The Americans
suffered no loss.
To compensate his men for their check at Craney Island, Admiral
Warren immediately afterward devised another movement, which
proved, what the Craney Island affair suggested, that the large
British force in the Chesapeake was either ill constructed or ill led.
Opposite Craney Island, ten miles away on the north shore of James
River, stood the village of Hampton, a place of no importance either
military or commercial. Four or five hundred Virginia militia were
camped there, covering a heavy battery on the water’s edge. The
battery and its defenders invited attack, but Admiral Warren could
have no military object to gain by attacking them. His official
398
report said “that the enemy having a post at Hampton defended
by a considerable corps commanding the communication between
the upper part of the country and Norfolk, I considered it advisable,
and with a view to cut off their resources, to direct it to be attacked.”
Hampton could not fairly be said to “command” communication with
Norfolk, a place which lay beyond ten miles of water wholly
commanded by the British fleet; but Warren was not obliged to
excuse himself for attacking wherever he pleased, and Hampton
served his object best.
At dawn of June 25, Beckwith’s troops were set ashore about
two miles above the village, and moved forward to the road, taking
Hampton in the rear, while Cockburn’s launches made a feint from
the front. The militia, after resistance costing Beckwith a total loss of
nearly fifty men, escaped, and the British troops entered the town,
where they were allowed to do what they pleased with property and
persons. Lieutenant-Colonel Napier of the One Hundred-and-second
regiment, who commanded Beckwith’s advance, wrote in his diary
that Sir Sydney Beckwith “ought to have hanged several villains at
Little Hampton; had he so done, the Americans would not have
complained; but every horror was perpetrated with impunity,—rape,
murder, pillage,—and not a man was punished.” The British officers
in general shared Napier’s disgust, but alleged that the English
troops took no part in the outrages, which were wholly the work of
the French chasseurs.
Warren made no attempt to hold the town; the troops returned
two days afterward to their ships, and the Virginia militia resumed
their station; but when the details of the Hampton affair became
known, the story roused natural exasperation throughout the country,
and gave in its turn incitement to more violence in Canada. Admiral
Warren and Sir Sydney Beckwith did not deny the wrong; they
dismissed their Frenchmen from the service, and the United States
had no further reason to complain of that corps; but the double
mortification seemed to lower the British officers even in their own
eyes to the level of marauders.
After the failure to destroy the “Constellation,” Admiral Warren
could still indulge a hope of destroying the twenty-eight-gun frigate
“Adams,” and the navy-yard at Washington; for the defence of the
Potomac had been totally neglected, and only one indifferent fort,
about twelve miles below the Federal city, needed to be captured.
July 1 the British squadron entered the Potomac; but beyond rousing
a panic at Washington it accomplished nothing, except to gain some
knowledge of the shoals and windings that impeded the ascent of
the river. Leaving the Potomac, Warren turned up Chesapeake Bay
toward Annapolis and Baltimore, but made no attempt on either
place. During the rest of the year he cruised about the bay, meeting
little resistance, and keeping the States of Virginia and Maryland in
constant alarm.
Cockburn was more active. In the month of July he was
detached with a squadron carrying Napier’s One Hundred-and-
second regiment, and arrived, July 12, off Ocracoke Inlet, where he
captured two fine privateers,—the “Atlas” and “Anaconda.” Thence
he sailed southward, and established himself for the winter on
Cumberland Island, near the Florida boundary, where he vexed the
Georgians. Besides the property consumed or wasted, he gave
refuge to many fugitive slaves, whom he assisted to the West Indies
or Florida. “Strong is my dislike,” wrote Napier, “to what is perhaps a
necessary part of our job: namely, plundering and ruining the
peasantry. We drive all their cattle, and of course ruin them. My
hands are clean; but it is hateful to see the poor Yankees robbed,
and to be the robber.”
Compared with the widespread destruction which war brought on
these regions half a century afterward, the injury inflicted by the
British navy in 1813 was trifling, but it served to annoy the Southern
people, who could offer no resistance, and were harassed by
incessant militia-calls. To some extent the same system of vexation
was pursued on the Northern coast. The Delaware River was
blockaded and its shores much annoyed. New York was also
blockaded, and Nantucket with the adjacent Sounds became a
British naval station. There Sir Thomas Hardy, Nelson’s favorite,
officer, commanded, in his flag-ship the “Ramillies.” Hardy did not
encourage marauding such as Cockburn practised, but his blockade
was still stringent, and its efficiency was proved by the failure of
Decatur’s efforts to evade it.
Decatur commanded a squadron composed of the “United
States,” its prize frigate the “Macedonian,” and the sloop-of-war
“Hornet,” which lay in the harbor of New York, waiting for a chance to
slip out. Impatient at the steady watch kept by the British fleet off
Sandy Hook, Decatur brought his three ships through the East River
into Long Island Sound. He reached Montauk Point, May 29, only to
find Hardy’s squadron waiting for him. June 1 he made an attempt to
run out, but was chased back, and took refuge in the harbor of New
London. A large British squadron immediately closed upon the
harbor, and Decatur not only lost hope of getting to sea but became
anxious for the safety of his ships. He withdrew them as far as he
could into the river, five miles above the town, and took every
precaution to repel attack. The British officers were said to have
declared that they would get the “Macedonian” back “even if they
followed her into a cornfield.” They did not make the attempt, but
their vigilance never relaxed, and Decatur was obliged to remain all
summer idle in port. He clung to the hope that when winter
approached he might still escape; but in the month of December the
country was scandalized by the publication of an official letter from
Decatur to the Secretary of the Navy, charging the people of New
London with the responsibility for his failure.

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.”

Decatur’s charge roused much ill feeling, and remained a subject


of extreme delicacy with the people of New London. Perhaps
Decatur would have done better not to make such an assertion until
he could prove its truth. That blue lights, as well as other lights, were
often seen, no one denied; but whether they came from British or
from American hands, or were burned on sea or on shore, were
points much disputed. The town of New London was three miles
from the river’s mouth, and Decatur’s squadron then lay at the town.
At that distance the precise position of a light in line with the British
fleet might be mistaken. Decatur’s report, if it proved anything,
proved that the signals were concerted, and were burnt from “both
the points at the river’s mouth.” If the British admiral wanted
information, he could have found little difficulty in obtaining it; but he
would hardly have arranged a system of signals as visible to Decatur
as to himself. Even had he done so, he might have employed men in
his own service as well as Americans for the purpose. Decatur’s
letter admitted that he had made great exertions to detect the
culprits, but without success.
The rigor of the British blockade extended no farther north than
the Vineyard and Nantucket. Captain Broke in the “Shannon,” with a
companion frigate, cruised off Boston harbor rather to watch for
ships-of-war than to interfere with neutral commerce. Along the coast
of Maine an illicit trade with the British provinces was so actively
pursued that one of the few American sloops-of-war, the
“Enterprise,” cruised there, holding smugglers, privateers, and petty
marauders in check. On no other portion of the coast would an
armed national vessel have been allowed to show itself, but the
“Enterprise,” protected by the bays and inlets of Maine, and favored
by the absence of a blockade, performed a useful service as a
revenue cutter. She was not a first-rate vessel. Originally a schooner,
carrying twelve guns and sixty men, she had taken part in the war
with Tripoli. She was afterward altered into a brig, and crowded with
sixteen guns and a hundred men. In 1813 she was commanded by
Lieutenant William Burrows, a Pennsylvanian, who entered the navy
in 1799, and, like all the naval heroes, was young,—not yet twenty-
eight years old.
On the morning of September 5, as the “Enterprise” was cruising
eastward, Burrows discovered in a bay near Portland a strange brig,
and gave chase. The stranger hoisted three English ensigns, fired
several guns, and stood for the “Enterprise.” Perhaps escape would
have been impossible; but the British captain might, without
disgrace, have declined to fight, for he was no match for the
American. The “Enterprise” measured about ninety-seven feet in
length; the “Boxer,” as the British brig was named, measured about
eighty-four. The “Enterprise” was nearly twenty-four feet in extreme
width; the “Boxer” slightly exceeded twenty-two feet. The
“Enterprise” carried fourteen eighteen-pound carronades and two
long-nines; the “Boxer” carried twelve eighteen-pound carronades
and two long-sixes. The “Enterprise” had a crew of one hundred and
two men; the “Boxer” had only sixty-six men on board. With such
odds against him, the British captain might have entertained some
desperate hope of success, but could not have expected it.
The behavior of Captain Blyth of the “Boxer” showed
consciousness of his position, for he nailed his colors to the mast,
and told his men that they were not to be struck while he lived. The
day was calm, and the two brigs manœuvred for a time before
coming together; but at quarter-past three in the afternoon they
exchanged their first broadside within a stone’s throw of one another.
The effect on both vessels was destructive. Captain Blyth fell dead,
struck full in the body by an eighteen-pound shot. Lieutenant
Burrows fell, mortally wounded, struck by a canister shot. After
another broadside, at half-past three the “Enterprise” ranged ahead,
crossed the “Boxer’s” bow, and fired one or two more broadsides,
until the “Boxer” hailed and surrendered, her colors still nailed to the
mast.
Considering the disparity of force, the two brigs suffered nearly in
equal proportion. The “Boxer” lost seven men killed or mortally
wounded; the “Enterprise” lost four. The “Boxer” had thirteen
wounded, not fatally; the “Enterprise” had eight. The “Boxer’s”
injuries were not so severe as to prevent her captors from bringing
her as a prize to Portland; and no incident in this quasi-civil war
touched the sensibilities of the people more deeply than the common
funeral of the two commanders,—both well known and favorites in
the service, buried, with the same honors and mourners, in the
graveyard at Portland overlooking the scene of their battle.
Neither the battle between the “Enterprise” and “Boxer,” nor any
measures that could be taken by sea or land, prevented a constant
traffic between Halifax and the New England ports not blockaded.
The United States government seemed afraid to interfere with it. The
newspapers asserted that hundreds of Americans were actually in
Halifax carrying on a direct trade, and that thousands of barrels of
flour were constantly arriving there from the United States in vessels
carrying the Swedish or other neutral flag. In truth the government
could do little to enforce its non-intercourse, and even that little might
prove mischievous. Nothing could be worse than the spirit of the
people on the frontier. Engaged in a profitable illicit commerce, they
could only be controlled by force, and any force not overwhelming
merely provoked violence or treason. The Navy Department had no
vessels to send there, and could not have prevented their capture if
vessels in any number had been sent. The Secretary of War had
abandoned to the State governments the defence of the coast.
When Armstrong allotted garrisons to the various military districts, he
stationed one regiment, numbering three hundred and fifty-two
effectives, besides two hundred and sixty-three artillerists, in Military
District No. 1, which included the whole coast north of Cape Cod,
with the towns of Boston, Marblehead, Salem, Gloucester,
Portsmouth, Portland, and Eastport. Such a provision was hardly
sufficient for garrisoning the fort at Boston. The government
doubtless could spare no more of its small army, but for any military
or revenue purpose might almost as well have maintained in New
England no force whatever.
CHAPTER XII.
During the month of April, 1813, four American frigates lay in
Boston Harbor fitting for sea. The “President” and “Congress”
returned to that port Dec. 31, 1812. The “Constitution,” after her
battle with the “Java,” arrived at Boston February 27, 1813. The
“Chesapeake” entered in safety April 9, after an unprofitable cruise
of four months. The presence of these four frigates at Boston offered
a chance for great distinction to the British officer stationed off the
port, and one of the best captains in the service was there to seize it.
In order to tempt the American frigates to come out boldly, only two
British frigates, the “Shannon” and “Tenedos,” remained off the
harbor. They were commanded by Captain P. B. V. Broke of the
“Shannon.” Broke expected Rodgers with his ships, the “President”
and “Congress,” to seize the opportunity for a battle with two ships of
no greater force than the “Shannon” and “Tenedos;” but either
Rodgers did not understand the challenge or did not trust it, or took a
different view of his duties, for he went to sea on the night of April
30, leaving Broke greatly chagrined and inclined to be somewhat
400
indignant with him for escaping.
After May 1, Broke on the watch outside, as he ran in toward
Nahant, could see the masts of only the “Constitution” and
“Chesapeake” at the Charlestown navy-yard, and his anxiety
became the greater as he noticed that the “Chesapeake” was
401
apparently ready for sea. May 25 Broke sent away his consort,
the “Tenedos,” to cruise from Cape Sable southward, ostensibly
because the two frigates cruising separately would have a better
chance of intercepting the “Chesapeake” than if they kept
402
together. His stronger reason was to leave a fair field for the
“Chesapeake” and “Shannon,” as he had before kept all force at a
distance except the “Shannon” and “Tenedos” in order to tempt
403
Rodgers to fight. That there might be no second
misunderstanding, he sent several messages to Captain Lawrence
commanding the “Chesapeake,” inviting a combat.
Nothing showed so clearly that at least one object of the war had
been gained by the Americans as the habit adopted by both navies
in 1813 of challenging ship-duels. War took an unusual character
when officers like Hardy and Broke countenanced such a practice,
discussing and arranging duels between matched ships, on terms
which implied that England admitted half-a-dozen American frigates
to be equal in value to the whole British navy. The loss of a British
frigate mattered little to a government which had more than a
hundred such frigates actually at sea, not to speak of heavier ships;
but the loss of the “Chesapeake” was equivalent to destroying nearly
one fourth of the disposable American navy. Already the
“Constellation” was imprisoned at Norfolk; the “United States” and
“Macedonian” were blockaded for the war; the “Congress” though at
sea was unseaworthy and never cruised again; the “Adams” was
shut in the Potomac; the “Essex” was in the Pacific. The United
States Navy consisted, for active service on the Atlantic, of only the
“President,” 44, at sea; the “Constitution,” 44, replacing her masts at
the Charlestown navy-yard; the “Chesapeake,” 38, ready for sea;
and a few sloops-of-war. Under such circumstances, British officers
who like Broke considered every American frigate bound to offer
them equal terms in a duel, seemed to admit that the American
service had acquired the credit it claimed.
The first duty of a British officer was to take risks; the first duty of
an American officer was to avoid them, and to fight only at his own
time, on his own terms. Rodgers properly declined to seek a battle
with Broke’s ships. Captain James Lawrence of the “Chesapeake”
was less cautious, for his experience in the war led him to think
worse of the British navy than it deserved. Lawrence commanded
the “Hornet” in Bainbridge’s squadron at the time of the “Java’s”
capture. Bainbridge and Lawrence blockaded the “Bonne
Citoyenne,” a twenty-gun sloop-of-war at San Salvador in Brazil.
Lawrence sent a message to the captain of the “Bonne Citoyenne”
inviting him to come out and meet the “Hornet.” The British captain
declined, doubtless for proper reasons; but the reason he gave
seemed to Lawrence insufficient, for it was merely that Commodore
404
Bainbridge, in spite of his pledged word, might interfere.
Bainbridge sailed about Christmas, and was absent till January 3,
capturing the “Java” in the interval. January 6 he sailed for Boston,
leaving Lawrence in the “Hornet” still blockading the “Bonne
Citoyenne,” which showed no more disposition to fight the “Hornet”
in Bainbridge’s absence than before, although the British captain’s
letter had said that “nothing could give me greater satisfaction than
complying with the wishes of Captain Lawrence” if the single alleged
objection were removed.
The conduct of the “Bonne Citoyenne”—a vessel at least the
405
equal of the “Hornet” —gave Lawrence a low opinion of the British
service, and his respect was not increased by his next experience. A
British seventy-four arrived at San Salvador, January 24, and obliged
the “Hornet” to abandon the “Bonne Citoyenne.” During the next
month the little vessel cruised northward along the Brazil coast,
making a few prizes, until February 24 off the mouth of Demerara
River, at half-past three o’clock in the afternoon, Captain Lawrence
discovered a sail approaching him. Within the bar at the mouth of the
river, seven or eight miles distant, he saw another vessel at anchor.
Both were British sloops-of-war. The one at anchor was the
“Espiègle,” carrying eighteen thirty-two-pound carronades. The other,
approaching on the “Hornet’s” weather-quarter, was the “Peacock,”
carrying eighteen twenty-four-pound carronades, two long-sixes, and
one or two lighter pieces.
406
The “Peacock,” according to British report, had long been “the
admiration of her numerous visitors,” and was remarkable for the
elegance of her fittings; but in size she was inferior to the “Hornet.”
Lawrence reported his ship to be four feet the longer, but the British
believed the “Hornet” to measure one hundred and twelve feet in
407
length, while the “Peacock” measured one hundred. Their breadth
was the same. The “Hornet” carried eighteen thirty-two-pounders,
while the British captain, thinking his sloop too light for thirty-twos,
had exchanged them for twenty-fours, and carried only sixteen. The
American crew numbered one hundred and thirty-five men fit for
duty; the British numbered one hundred and twenty-two men and
boys.
At ten minutes past five, Lawrence tacked and stood for the brig.
Fifteen minutes afterward the two vessels, sailing in opposite
directions, passed each other and exchanged broadsides within a
stone’s-throw. The British fire, even at point-blank range of forty or
fifty feet, did no harm, while the “Hornet’s” broadside must have
decided the battle; for although both vessels instantly wore, and
Lawrence at thirty-five minutes past five ran his enemy close aboard,
the “Peacock” almost immediately struck at thirty-nine minutes past
five in a sinking condition, and actually went down immediately
afterward, carrying with her nine of the “Peacock’s” wounded and
three of the “Hornet’s” crew.
The ease of this victory was beyond proportion to the odds. The
British captain and four men were killed outright, thirty-three officers
and men were wounded, and the brig was sunk in an action of less
than fifteen minutes; while the “Hornet” lost one man killed and two
wounded, all aloft, and not a shot penetrated her hull. If the facility of
this triumph satisfied Lawrence of his easy superiority in battle, the
conduct of the “Espiègle” convinced him that the British service was
worse than incompetent. Lawrence, expecting every moment to see
the “Espiègle” get under weigh, made great exertions to put his ship
in readiness for a new battle, but to his astonishment the British brig
408
took no notice of the action. Subsequent investigation showed
that the “Espiègle” knew nothing of the battle until the next day; but
Lawrence, assuming that the British captain must have seen or
heard, or at least ought to have suspected what was happening,
conceived that cowardice was a trait of the British navy.
When Lawrence reached New York he became famous for his
victory, and received at once promotion. The “Hornet,” given to
Captain Biddle, was attached to Decatur’s squadron and blockaded
at New London, while Lawrence received command of the
“Chesapeake.” Lawrence was then thirty-two years old; he was born
in New Jersey in 1781, entered the navy in 1798, and served in the
war with Tripoli. He was first lieutenant on the “Constitution,” and
passed to the grade of commander in 1810, commanding
successively the “Vixen,” the “Wasp,” the “Argus,” and the “Hornet.”
His appointment to the “Chesapeake” was an accident, owing to the
ill health of Captain Evans, who commanded her on her recent
cruise. The “Chesapeake’s” reputation for ill luck clung to her so
persistently that neither officers nor men cared greatly to sail in her,
409
and Lawrence would have preferred to remain in the “Hornet;” but
his instructions were positive, and he took command of the
“Chesapeake” about the middle of May. Most of the officers and crew
were new. The old crew on reaching port, April 9, had been
discharged, and left the ship, dissatisfied with their share of prize-
money, and preferring to try the privateer service. The new crew was
unequal in quality and required training; they neither knew their
officers nor each other.
Lawrence’s opponent, Captain Broke of the “Shannon,” was an
officer whose courage could as little be questioned as his energy or
skill. Among all the commanders in the British service Broke had
profited most by the lessons of the war. More than seven years’
experience of his ship and crew gave him every advantage of
discipline and system. Nearly every day the officers at the
Charlestown navy-yard could see the “Shannon” outside, practising
her guns at floating targets as she sailed about the bay. Broke’s
most anxious wish was to fight the “Chesapeake,” which he
410
considered to be of the same size with the “Shannon.” The two
frigates were the same length within a few inches,—between one
hundred and fifty, and one hundred and fifty-one feet. Their breadth
was forty feet within a few inches. The “Chesapeake” carried
eighteen thirty-two-pound carronades on the spar-deck; the
“Shannon” carried sixteen. Each carried twenty-eight long eighteen-
pounders on the gun-deck. The “Chesapeake” carried also two long
twelve-pounders and a long eighteen-pounder, besides a twelve-
pound carronade. The “Shannon” carried four long nine-pounders, a
long six-pounder, and three twelve-pound carronades. The
“Chesapeake’s” only decided advantage was in the number of her
crew, which consisted of three hundred and seventy-nine men, while
the “Shannon” carried three hundred and thirty all told.
Broke sent the “Tenedos” away May 25, but Lawrence was not
aware of it, and wrote, May 27, to Captain Biddle of the “Hornet” a
letter, showing that till the last moment he hoped not to sail in the
411
“Chesapeake:” —

“In hopes of being relieved by Captain Stewart, I neglected


writing to you according to promise; but as I have given over all
hopes of seeing him, and the ‘Chesapeake’ is almost ready, I
shall sail on Sunday, provided I have a chance of getting out
clear of the ‘Shannon’ and ‘Tenedos,’ who are on the look-out.”

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

Nevertheless, Lawrence ordered up his boarders,—he could do


nothing else; but the affair hurried with such rapidity to its close that
almost at the same instant the “Chesapeake’s” quarter touched the
“Shannon” amidships. From the moment when the “Chesapeake”
was taken aback until the moment when she fell foul, only four
minutes were given for Lawrence to act. Before these four minutes
were at an end, he was struck and mortally wounded by a musket-
ball from the “Shannon.” His first lieutenant, Ludlow, had already
been carried below, wounded. His second lieutenant, Budd, was
stationed below. His third lieutenant, Cox, improperly assisted
Lawrence to reach the gun-deck. Not an officer remained on the
spar-deck, and neither an officer nor a living man was on the
quarter-deck when the “Chesapeake’s” quarter came against the
“Shannon’s” gangway, as though inviting the British captain to take
possession.
As the ships fouled, Broke ran forward and called for boarders.
With about twenty men he stepped on the “Chesapeake’s” quarter-
deck, and was followed by thirty more before the ships parted. The
error should have cost him his life and the lives of all who were with
him, for the Americans might easily have killed every man of the
boarding-party in spite of the fire from the “Shannon.” For several
moments Broke was in the utmost peril, not only from the American
crew but from his own. His first lieutenant, Watt, hastening to haul
down the American ensign, was killed by the discharge of a cannon
from the “Shannon;” and when Broke, leaving the “Chesapeake’s”
quarter-deck, went forward to clear the forecastle, enough of the
American crew were there to make a sharp resistance. Broke himself
was obliged to take part in the scuffle. According to his report, he
“received a severe sabre-wound at the first onset, whilst charging a
part of the enemy who had rallied on their forecastle.” According to
another British account he was first knocked down with the butt-end
of a musket, and then was cut by a broadsword. Of his fifty boarders,
412
not less than thirty-seven were killed or wounded.
Had the American crew been in a proper state of discipline, the
struggle would have taken an extraordinary character, and the two
ships might have renewed the combat, without officers, and in a
more or less unmanageable condition. Fortunately for Broke, his fifty
men outnumbered the Americans on the spar-deck, while the men
below, for the most part, would not come up. About a score of sailors
and marines were on the forecastle, and about a dozen more rushed
up from below, led by the second lieutenant, George Budd, as soon
as he, at his station on the main-deck, learned what was happening
above; but so rapidly did the whole affair pass, that in two minutes
the scuffle was over, the Americans were killed or thrown down the
hatchway, and the ship was helpless, with its spar-deck in the hands
of Broke’s boarders. The guns ceased firing, and the crew below
surrendered after some musket-shots up and down the hatchways.
The disgrace to the Americans did not consist so much in the
loss of a ship to one of equal force, as in the shame of suffering
capture by a boarding-party of fifty men. As Lawrence lay wounded
in the cockpit, he saw the rush of his men from the spar-deck down
the after-ladders, and cried out repeatedly and loudly, “Don’t give up
the ship! blow her up!” He was said to have added afterward: “I could
have stood the wreck if it had not been for the boarding.”
Doubtless the “Shannon” was the better ship, and deserved to
win. Her crew could under no circumstances have behaved like the
crew of the “Chesapeake.” In discipline she was admittedly superior;
but the question of superiority in other respects was not decided.
The accident that cut the “Chesapeake’s” jib-sheet and brought her
into the wind was the only decisive part of the battle, and was mere
ill luck, such as pursued the “Chesapeake” from the beginning. As
far as could be seen, in the favorite American work of gunnery the
“Shannon” showed no superiority.
On that point the reports agreed. The action began at half-past
five o’clock in the afternoon at close range. In seven minutes the
“Chesapeake” forged ahead, came into the wind and ceased firing,
as none of her guns could be made to bear. Seven minutes allowed
time at the utmost for two discharges of some of her guns. No more
guns were fired from the “Chesapeake” till she drifted close to the
“Shannon.” Then her two sternmost guns, the thirteenth and
fourteenth on the main deck, again bore on the enemy, and were
depressed and fired by Lieutenant Cox while the boarders were
413
fighting on the spar-deck. Thus the number of discharges from
the “Chesapeake’s” guns could be known within reasonable
certainty. She carried in her broadside nine thirty-two-pounders and
fourteen or fifteen eighteen-pounders, besides one twelve-pounder,
—twenty-five guns. Assuming them to have been all discharged
twice, although the forward guns could scarcely have been
discharged more than once, the “Chesapeake” could have fired only
fifty-two shot, including the two eighteen-pounders fired by
Lieutenant Cox at the close.
According to the official report nearly every shot must have taken
effect. The “Shannon” was struck by thirteen thirty-two-pound shot;
the “Chesapeake” fired only eighteen, if she discharged every gun
twice. The “Shannon” was struck by twelve eighteen-pound shot,
fourteen bar-shot, and one hundred and nineteen grape-shot; the
“Chesapeake’s” fifteen eighteen-pounders could hardly have done
more in the space of seven minutes. In truth, every shot that was
fired probably took effect.
The casualties showed equal efficiency of fire, and when
compared with other battles were severe. When the “Guerriere”
struck to the “Constitution” in the previous year, she had lost in half
an hour of close action twenty-three killed or mortally wounded and
fifty-six more or less injured. The “Shannon” seems to have lost in
eleven minutes, before boarding, twenty-seven men killed or mortally
414
wounded and nineteen more or less injured.
The relative efficiency of the “Shannon’s” gunnery was not so
clear, because the “Shannon’s” battery continued to fire after the
“Chesapeake” ceased. As the “Chesapeake” drifted down on the
“Shannon” she was exposed to the broadside of the British frigate,
while herself unable to fire a gun.

“The shot from the ‘Shannon’s’ aftermost guns now had a


fair range along the ‘Chesapeake’s’ decks,” said the British
415
account, “beating in the stern-ports and sweeping the men
from their quarters. The shots from the foremost guns at the
same time entering the ports from the mainmast aft did
considerable execution.”
416
Broke’s biographer said that the “Chesapeake” fired but one
broadside, and then coming into the wind drifted down, “exposed
while making this crippled and helpless movement to the ‘Shannon’s’
second and most deliberate broadside.” The “Chesapeake” was very
near, almost touching the British frigate during the four or five
minutes of this fire, and every shot must have taken effect. Broke
ordered the firing to cease when he boarded, but one gun was
afterward discharged, and killed the British first lieutenant as he was
lowering the American flag on the “Chesapeake’s” quarter-deck.
The “Shannon’s” fire lasted eleven or twelve minutes. She
417
carried twenty-five guns in broadside. Eight of these were thirty-
two-pound carronades, and the official report showed that the
“Chesapeake” was struck by twenty-five thirty-two-pound shot,
showing that three full broadsides were fired from the “Shannon,”
and at least one gun was discharged four times. The “Shannon’s”
broadside also carried fourteen eighteen-pounders, which threw
twenty-nine shot into the “Chesapeake,” besides much canister and
grape. Considering that at least half the “Shannon’s” shot were fired
at so close a range that they could not fail to take effect, nothing
proved that her guns were better served than those of the
“Chesapeake.” The “Shannon,” according to the British account, fired
twice as many shot under twice as favorable conditions, but the
injury she inflicted was not twice the injury inflicted in return. Setting
aside the grape-shot, the “Chesapeake” struck the “Shannon” thirty-
nine times; the “Shannon” struck the “Chesapeake” fifty-seven times.
Including the grape-shot, which Broke used freely, the “Shannon”
probably did better, but even with a liberal allowance for grape and
canister, nothing proved her superiority at the guns.
The loss in men corresponded with the injury to the ships. The
“Shannon” lost eighty-three killed and wounded; the “Chesapeake”
lost one hundred and forty-six. Thirty-three of the “Shannon’s” men
were killed or died of their wounds; sixty-one of the “Chesapeake’s”
number were killed or mortally wounded.
The injuries suffered by the “Chesapeake” told the same story,
for they were chiefly in the stern, and were inflicted by the

You might also like