0% found this document useful (0 votes)
63 views

Robot Operating System (ROS) for Absolute Beginners: Robotics Programming Made Easy Lentin Joseph instant download

The document provides information about the book 'Robot Operating System (ROS) for Absolute Beginners' by Lentin Joseph, which aims to simplify robotics programming for newcomers. It includes details on downloading the book, its contents, and the author's background in robotics. The book covers various topics including Ubuntu Linux, C++, Python, and practical applications of ROS in robotics projects.

Uploaded by

jackoueni
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
0% found this document useful (0 votes)
63 views

Robot Operating System (ROS) for Absolute Beginners: Robotics Programming Made Easy Lentin Joseph instant download

The document provides information about the book 'Robot Operating System (ROS) for Absolute Beginners' by Lentin Joseph, which aims to simplify robotics programming for newcomers. It includes details on downloading the book, its contents, and the author's background in robotics. The book covers various topics including Ubuntu Linux, C++, Python, and practical applications of ROS in robotics projects.

Uploaded by

jackoueni
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/ 42

Robot Operating System (ROS) for Absolute

Beginners: Robotics Programming Made Easy Lentin


Joseph pdf download

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

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

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/

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/

C# Programming For Absolute Beginners Radek Vystavel

https://ebookmeta.com/product/c-programming-for-absolute-
beginners-radek-vystavel/

Futanari Nurse Futagirl Erotica Julie Law

https://ebookmeta.com/product/futanari-nurse-futagirl-erotica-
julie-law/
Power Sharing in a Divided Nation Mediated Communalism
and New Politics in Six Decades of Malaysia s Elections
1st Edition Johan Saravanamuttu

https://ebookmeta.com/product/power-sharing-in-a-divided-nation-
mediated-communalism-and-new-politics-in-six-decades-of-malaysia-
s-elections-1st-edition-johan-saravanamuttu/

Second First Impressions A Novel 10th Edition Thorne


Sally

https://ebookmeta.com/product/second-first-impressions-a-
novel-10th-edition-thorne-sally/

Stepbrother Stalker 1st Edition Emma Bray

https://ebookmeta.com/product/stepbrother-stalker-1st-edition-
emma-bray-3/

The New Documents in Mycenaean Greek: Volume 1,


Introductory Essays John Killen

https://ebookmeta.com/product/the-new-documents-in-mycenaean-
greek-volume-1-introductory-essays-john-killen/

New Perspectives on Dystopian Fiction in Literature and


Other Media 1st Edition Saija Isomaa (Editor)

https://ebookmeta.com/product/new-perspectives-on-dystopian-
fiction-in-literature-and-other-media-1st-edition-saija-isomaa-
editor/
Immersive Technology in Smart Cities: Augmented and
Virtual Reality in IoT Sagaya Aurelia (Editor)

https://ebookmeta.com/product/immersive-technology-in-smart-
cities-augmented-and-virtual-reality-in-iot-sagaya-aurelia-
editor/
Robot Operating
System (ROS) for
Absolute Beginners
Robotics Programming Made Easy

Lentin Joseph
Robot Operating
System (ROS) for
Absolute Beginners
Robotics Programming
Made Easy

Lentin Joseph
Robot Operating System (ROS) for Absolute Beginners: Robotics
Programming Made Easy
Lentin Joseph
Cheerakathil House
Aluva, Kerala, India

ISBN-13 (pbk): 978-1-4842-3404-4 ISBN-13 (electronic): 978-1-4842-3405-1


https://doi.org/10.1007/978-1-4842-3405-1
Library of Congress Control Number: 2018945056
Copyright © Lentin Joseph 2018, corrected publication 2018
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Natalie Pao
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit http://www.apress.
com/rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available
to readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-3404-4.
For more detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
I dedicate this book to my parents, C. G. Joseph
and Jancy Joseph, for giving me strong support in making
this project happen.

The original version of the book FM and Cover was revised. An erratum for the book
FM and the Cover can be found at https://doi.org/10.1007/978-1-4842-3405-1_7
Table of Contents
About the Author���������������������������������������������������������������������������������xi
About the Technical Reviewer�����������������������������������������������������������xiii

Chapter 1: Getting Started with Ubuntu Linux for Robotics������������������1


Getting Started with GNU/Linux����������������������������������������������������������������������������1
What Is Ubuntu?����������������������������������������������������������������������������������������������2
Why Ubuntu for Robotics?�������������������������������������������������������������������������������3
Installing Ubuntu���������������������������������������������������������������������������������������������������3
Recommended PC Requirements��������������������������������������������������������������������4
Downloading Ubuntu���������������������������������������������������������������������������������������4
Installing VirtualBox�����������������������������������������������������������������������������������������5
Creating a VirtualBox Machine������������������������������������������������������������������������6
Installing Ubuntu on VirtualBox���������������������������������������������������������������������18
Installing Ubuntu on a PC������������������������������������������������������������������������������28
Playing with the Ubuntu Graphical User Interface����������������������������������������������29
The Ubuntu File System���������������������������������������������������������������������������������30
Useful Ubuntu Applications����������������������������������������������������������������������������33
Getting Started with Shell Commands����������������������������������������������������������������34
Terminal Commands Cheat Sheet�����������������������������������������������������������������35
Summary������������������������������������������������������������������������������������������������������������54

v
Table of Contents

Chapter 2: Fundamentals of C++ for Robotics Programming������������55


Getting Started with C++������������������������������������������������������������������������������������56
Timeline: The C++ Language������������������������������������������������������������������������56
C/C++ in Ubuntu Linux���������������������������������������������������������������������������������������56
Introduction to GCC and G++ Compilers�������������������������������������������������������57
Installing C/C++ Compiler�����������������������������������������������������������������������������57
Verifying Installation��������������������������������������������������������������������������������������58
Introduction to GNU Project Debugger (GDB)�������������������������������������������������59
Learning OOP Concepts from Examples�������������������������������������������������������������69
The Differences Between Classes and Structs����������������������������������������������69
C++ Classes and Objects������������������������������������������������������������������������������73
Class Access Modifier�����������������������������������������������������������������������������������75
C++ Inheritance��������������������������������������������������������������������������������������������76
C++ Files and Streams���������������������������������������������������������������������������������82
Namespaces in C++��������������������������������������������������������������������������������������84
C++ Exception Handling��������������������������������������������������������������������������������85
C++ Standard Template Libraries�����������������������������������������������������������������88
Building a C++ Project����������������������������������������������������������������������������������������88
Creating a Linux Makefile������������������������������������������������������������������������������88
Creating a CMake File�����������������������������������������������������������������������������������92
Summary������������������������������������������������������������������������������������������������������������94

Chapter 3: Fundamentals of Python for Robotics Programming��������95


Getting Started with Python��������������������������������������������������������������������������������96
Timeline: The Python Language���������������������������������������������������������������������96
Python in Ubuntu Linux���������������������������������������������������������������������������������������97
Introduction to Python Interpreter�����������������������������������������������������������������97
Installing Python on Ubuntu 16.04 LTS����������������������������������������������������������98

vi
Table of Contents

Verifying Python Installation��������������������������������������������������������������������������98


Writing Your First Code����������������������������������������������������������������������������������99
Understanding Python Basics����������������������������������������������������������������������103
Summary����������������������������������������������������������������������������������������������������������126

Chapter 4: Kick-Starting Robot Programming Using ROS����������������127


What Is Robot Programming?���������������������������������������������������������������������������127
Why Robot Programming Is Different����������������������������������������������������������129
Getting Started with ROS����������������������������������������������������������������������������������132
The ROS Equation����������������������������������������������������������������������������������������135
Robot Programming Before and After ROS��������������������������������������������������135
The History of ROS��������������������������������������������������������������������������������������135
Before and After ROS�����������������������������������������������������������������������������������138
Why Use ROS?���������������������������������������������������������������������������������������������138
Installing ROS����������������������������������������������������������������������������������������������139
Robots and Sensors Supporting ROS����������������������������������������������������������146
Popular ROS Computing Platforms��������������������������������������������������������������148
ROS Architecture and Concepts�������������������������������������������������������������������149
The ROS File System�����������������������������������������������������������������������������������152
ROS Computation Concepts�������������������������������������������������������������������������154
The ROS Community������������������������������������������������������������������������������������155
ROS Command Tools�����������������������������������������������������������������������������������155
ROS Demo: Hello World Example�����������������������������������������������������������������160
ROS Demo: turtlesim�����������������������������������������������������������������������������������162
ROS GUI Tools: Rviz and Rqt������������������������������������������������������������������������168
Summary����������������������������������������������������������������������������������������������������������170

vii
Table of Contents

Chapter 5: Programming with ROS���������������������������������������������������171


Programming Using ROS�����������������������������������������������������������������������������������171
Creating a ROS Workspace and Package����������������������������������������������������������172
ROS Build System����������������������������������������������������������������������������������������176
ROS Catkin Workspace��������������������������������������������������������������������������������177
Creating a ROS Package������������������������������������������������������������������������������178
Using ROS Client Libraries��������������������������������������������������������������������������������180
roscpp and rospy�����������������������������������������������������������������������������������������181
The Hello World Example Using ROS�����������������������������������������������������������189
Programming turtlesim Using rospy������������������������������������������������������������204
Programming TurtleBot Simulation Using rospy������������������������������������������221
Programming Embedded Boards Using ROS����������������������������������������������������227
Interfacing Arduino with ROS����������������������������������������������������������������������228
Installing ROS on a Raspberry Pi�����������������������������������������������������������������234
Summary����������������������������������������������������������������������������������������������������������236

Chapter 6: Robotics Project Using ROS��������������������������������������������237


Getting Started with Wheeled Robots���������������������������������������������������������������237
Differential Drive Robot Kinematics������������������������������������������������������������������238
Building Robot Hardware����������������������������������������������������������������������������������242
Buying Robot Components��������������������������������������������������������������������������243
Block Diagram of the Robot�������������������������������������������������������������������������249
Assembling Robot Hardware�����������������������������������������������������������������������251
Creating a 3D ROS Model Using URDF��������������������������������������������������������������252
Programming Robot Firmware��������������������������������������������������������������������������257
Programming Robot Using ROS������������������������������������������������������������������������262
Creating a Bluetooth-ROS Driver for the Robot�������������������������������������������263
The Teleop Node������������������������������������������������������������������������������������������268

viii
Table of Contents

The Twist Message to Motor Velocity Node�������������������������������������������������269


The Odometry Node�������������������������������������������������������������������������������������270
The Dead-Reckoning Node��������������������������������������������������������������������������270
Final Run�����������������������������������������������������������������������������������������������������������272
Summary����������������������������������������������������������������������������������������������������������274

Erratum�����������������������������������������������������������������������������������������������E1

Index�������������������������������������������������������������������������������������������������275

ix
About the Author
Lentin Joseph is an author and a robotics entrepreneur from India. He
runs a robotics software company called Qbotics Labs. He has seven years
of experience in the robotics domain, especially in the Robot Operating
System, OpenCV, and PCL.
He has authored four books in ROS, including Learning Robotics Using
Python (Packt Publishing, 2015), Mastering ROS for Robotics Programming
(first & second edition) (Packt Publishing, 2015), and ROS Robotics Projects
(Packt Publishing, 2015).
He is currently doing research for the Robotics Institute at Carnegie
Mellon University.

xi
About the Technical Reviewer
Massimo Nardone has more than 22 years
of experiences in security, web/mobile
development, the cloud, and IT architecture.
His true IT passions are security and Android.
He has been programming and teaching
how to program with Android, Perl, PHP, Java,
VB, Python, C/C++, and MySQL for more than
20 years.
He holds a Master of Science degree in
computing science from the University of
Salerno, Italy.
He has worked as a project manager, software engineer, research
engineer, chief security architect, information security manager,
PCI/SCADA auditor, and senior lead IT security/cloud/SCADA architect
for many years.
His technical skills include security, Android, Cloud, Java, MySQL,
Drupal, Cobol, Perl, web and mobile development, MongoDB, D3, Joomla,
Couchbase, C/C++, WebGL, Python, Pro Rails, Django CMS, Jekyll,
Scratch, and more.
He is currently the chief information security officer (CISO) at
Cargotec Oyj.
He worked as a visiting lecturer and supervisor for exercises at the
Networking Laboratory of the Helsinki University of Technology (Aalto
University). He holds four international patents (in the PKI, SIP, SAML, and
Proxy areas).

xiii
CHAPTER 1

Getting Started
with Ubuntu Linux
for Robotics
Let’s start our journey of programming robots by using the Robot
Operating System (ROS). In order to get started with ROS, there are
some prerequisites to be satisfied. The prerequisites are to have a good
understanding of Linux, especially Ubuntu; a good understanding of Linux
shell commands; and Python and C++programming knowledge.
This book discusses all the prerequisite technologies required for
robot programming using ROS. This first chapter introduces the Ubuntu
operating system, installation, important shell commands, and the
important tools for programming robots. If you already work with Ubuntu,
you should still go through this chapter. It will refresh your existing
understanding of Ubuntu Linux.

Getting Started with GNU/Linux


Linux is an operating system like Windows 10 or Mac OS. Similar to
other operating systems, it has capabilities such as communicating and
receiving instructions from users, reading/writing data to the disk drive

© Lentin Joseph 2018 1


L. Joseph, Robot Operating System (ROS) for Absolute Beginners,
https://doi.org/10.1007/978-1-4842-3405-1_1
Chapter 1 Getting Started with Ubuntu Linux for Robotics

and executing software applications. The important part of any operating


system is the kernel. In GNU/Linux system, Linux (www.linux.org) is the
kernel component. The rest of the components are applications developed
by the GNU Project (www.gnu.org/home.en.html).
The Linux based OS are inspired from the Unix operating system. The
Linux kernel is capable of multitasking in multiuser systems. The good thing
is that GNU/Linux is free to use and open source. Users have full control
on the operating system, which makes Linux ideal for computer hackers
and geeks. Linux is vastly used in servers. The popular Android operating
system runs in a Linux kernel. There are many distributions, or flavors, of
Linux, which basically uses the Linux kernel as the core component; there
are differences in the graphical interface. Some of the most popular Linux
distributions are Ubuntu, Debian, and Fedora (see Figure 1-1). The Linux-­
based operating systems are among the most popular in the world.

Figure 1-1. Logos of various popular Linux distributions

What Is Ubuntu?
Ubuntu (www.ubuntu.com) is a popular Linux distribution based on
the Debian architecture (https://en.wikipedia.org/wiki/Debian).
It is freely available for use, and it is open source, so it can be modified
according to your application. Ubuntu comes with more than 1,000
pieces of software, including the Linux kernel, a GNOME/KDE desktop

2
Chapter 1 Getting Started with Ubuntu Linux for Robotics

environment, and standard desktop applications (word processing, a web


browser, spreadsheets, a web server, programming languages, integrated
development environment (IDE), and several PC games). Ubuntu can run
on desktops and servers. It supports architectures such as Intel x86, AMD-­64,
ARMv7, and ARMv8 (ARM64). Ubuntu is backed by Canonical Ltd. (www.
canonical.com), a UK-based company.

Why Ubuntu for Robotics?


The software is the heart of any robot. A robot application can be run on
an operating system that provide functionalities to communicate with
robot actuators and sensors. A Linux-based operating system can provide
great flexibility to interact with low-level hardware and provide provision
to customize the operating system according to the robot application. The
advantages of Ubuntu in this context are its responsiveness, lightweight
nature, and high degree of security. Beyond these factors, Ubuntu has great
community support and there are frequent releases, which makes Ubuntu
an updated operating system. Ubuntu also has long-term support (LTS)
releases, which provides user support for up to five years. These factors
have led the ROS developers to stick to Ubuntu, and it is the only operating
that is fully supported by ROS.
The Ubuntu-ROS combination is an ideal choice for programming
robots.

I nstalling Ubuntu
This section discusses how to install Ubuntu 16.04 LTS. The procedure for
installing any Ubuntu version is almost the same. Like any other operating
system, a PC should have the recommended system requirements to
install Ubuntu. Here are the recommended requirements needed for your
PC. After that you can see the detailed procedure of Ubuntu installation.

3
Chapter 1 Getting Started with Ubuntu Linux for Robotics

Recommended PC Requirements
• 2GHz dual core processor or better

• 2GB system memory

• 25GB of free hard drive space

• a DVD drive or a USB port for the installer media

• Internet access is helpful

D
 ownloading Ubuntu
The first step is to download the DVD/CD ISO image. To download an
Ubuntu image, go to www.ubuntu.com/download/desktop.
You can take a look at all Ubuntu releases at http://releases.ubuntu.com.
The DVD image is less than 1GB. It is named ubuntu-16.04.X-desktop-­
amd64.iso. By default, the ISO image is 64-bit architecture; if your PC RAM
size is less than 4GB, you can use 32-bit architecture.
After downloading the desired Ubuntu image, there are two options for
installing Ubuntu.

• Install on a real PC. This can be done using one of two


methods. You can burn the image to a DVD or to a USB
drive.

• Install in VirtualBox (www.virtualbox.org) or VMWare


Workstation (https://my.vmware.com/web/vmware/
downloads). With this method, you have to first install
VirtualBox software, and then install Ubuntu on top
of it. In this book, we prefer this method because it is
safe to work with VirtualBox. Installing on a real PC
may cause data loss if you don’t do it properly. As a
beginner, you can experiment with Ubuntu inside
VirtualBox.

4
Other documents randomly have
different content
CHAPTER V.
THE DREADNOUGHT BOYS’ FORTUNE.

“You’re wanted aft.”


The word came to Ned the next day as he lay, feeling rather dizzy
and light-headed, in his hammock. There is no sick bay on a
destroyer, and so special leave had been granted him to have his
hammock slung during the daytime.
The Dreadnought Boy had been the only one of the boat’s crew
injured in the onslaught of the mighty wave. Strong arms had pulled
the rest to safety without injury. Ned, however, had been caught in
the wreckage and badly bruised. As the parting of a light line
released him from the tangle of the smashed boat, he had been
flung head first against the Beale’s quarter.
“The commander added,—that is, if you feel well enough to come,”
amended the messenger.
“Ask his indulgence for a few minutes till I get my sea legs, will
you?” laughed Ned. “I feel mighty queer and shaky.”
At this moment Herc, who had been released from his duties on
deck to see how his chum was faring, came below. With the red-
headed lad’s assistance, Ned was soon ready for his visit aft. He
found that the salty blast of fresh air which struck him in the face as
he emerged from the crew’s quarters was as good as a tonic. The
gale had blown itself out. Overhead was stretched a clean-swept,
blue sky, while about them a bright sea, crested with sparkling
whitecaps, raced along. Through it the Beale was plunging her way
south at a good rate of speed, the black smoke pouring from her
funnels and encrusting her after deck with a crunching carpet of
cinders.
“Well, my lad, how are you feeling to-day?” asked Lieutenant
Timmons, as Ned entered the cabin, cap in hand, and, after saluting,
stood respectfully at attention.
Ned assured his superior that he was suffering no ill consequences.
Whereupon Lieutenant Timmons called forward a young officer,
whom Ned had not previously noticed.
“Here, Stark,” he said, “is the man you have to thank for your being
here to-day.”
“And I do most heartily!” exclaimed the middy, stepping forward with
outstretched hand. “I don’t know how to word it, Strong, but I hope
you know how I feel.”
Ned nodded, rather embarrassed.
“That’s all right, sir,” he said. The boy had supposed that this
concluded the interview, but in this he was mistaken. Fingering some
papers which lay on his desk Lieutenant Timmons went on.
“I am especially glad that your officer and you have this bond
between you, Strong, for this reason:—when we reach our
destination,—which you may, or may not know?——”
Ned nodded to show that he was aware of the objective point of the
voyage.
“When we reach Costaveza, I say, I have some special duty outlined,
which I have already explained to Mr. Stark. He will command such
men as he thinks he requires to assist him. I do not think, and he
shares my opinion, that he could make a better choice than you and
your companion, Hercules Taylor.”
“Of course, we’ll do our best, sir,” said Ned simply, though his heart
was beating high at the distinction which his commander was
conferring on the Dreadnought Boys.
“I know you will, Strong,” said his superior crisply, “and that is why I
selected you for the duty. There is no need to explain it in its details,
which will largely be governed by the conditions we may find
existing in the republic. Of course, from reading the papers, you are
familiar with the fact that there is a revolution there, which is
antagonistic in the extreme to American interests.”
“Yes, sir,” rejoined Ned, debating within himself whether he would
tell his commander about the dark-skinned man outside the navy
yard. He finally decided not to, deeming it the wisest course not to
speak on such an indefinite subject.
“Very well, Strong, you may go. You and Seaman Taylor will be
notified when you are wanted.”
Ned clicked his heels together, placed his hand to his bandaged
head, and left the cabin. As he walked forward the last vestige of his
dizziness was gone. He felt capable of tackling a whole ship’s
company single-handed. As soon as he found an opportunity he
related what had passed in the commander’s cabin to his chum.
Herc was as overjoyed as his companion at the opportunity that
appeared to be held out to the Dreadnought Boys for distinguishing
themselves.
“At this rate, we’ll be admirals before long,” chortled Herc.
“You’ll have to get some of those freckles off your face first, then,
and——”
He broke off abruptly, as he suddenly became aware that their
conversation must have been audible to a man who was reposing in
the sun on the other side of the cowl ventilator, in the shelter of
which they had been talking. It was the smoke hour after dinner,
and many men were lolling about the decks, but neither of the boys
had noticed this particular fellow.
“What did you stop so suddenly for?” began Herc, with a blank look,
but Ned cut him short.
“Hush,” he whispered, “don’t say any more. After all, he may be
asleep.”
“Well, what on earth——”
“Come on and take a turn, Herc.”
Ned forcibly raised his chum to his feet and walked forward with
him. Then they turned aft once more. They chose the other side of
the Beale, however, so as to get a good view of the figure that Ned
had spied on the other side of the ventilator. But in the brief interval
they had had their backs turned the man had gone.
“That confirms my suspicions,” said Ned.
“Suspicions of what?”
“That that fellow was there for no good purpose. He was crouching
down to hear what we had to say. He must have come up softly
after we were seated.”
“Well, he didn’t hear anything that was very important.”
“No,” admitted Ned, “unless——”
“Well, unless what? You’re the most suspicious chap I ever saw.”
“I was going to say that I am almost positive that that fellow was
the fireman we noticed eying us so curiously the day we left the
yard.”
“Even so. Aren’t you making a mountain out of a mole hill, or a
battleship out of a dinghy?”
“I’m not so sure of that,” responded Ned slowly, and with an air of
thoughtfulness, “something about that chap roused my suspicions
that he was watching us for no good purpose.”
“Well, there wasn’t much nourishment in what we said, even if he is
what you suspect him to be.”
“Humph! he heard that we are to be Midshipman Stark’s assistants
in secret duty, didn’t he?”
“Well?”
“Well, it may be of the highest importance that no one should know
that but ourselves and our officers. I’d like to kick myself overboard
for not looking round before we started talking.”
At this moment Stanley, the man who had handled the bow oar in
the boat the night before, came up to them. With him were the
other volunteers of that heroic venture. In discussing the details of it
and “fighting the battle o’er again,” the Dreadnought Boys speedily
forgot the incident which had for an instant cast a cloud over Ned’s
good humor.
Three more days of steady steaming brought the Beale within the
tropics. It was delightful to the boys to be once more in Caribbean
waters. The blue sea rippled by. Only a gentle swell made a pleasing
contrast after the terrific “tumblefication” the Beale had been
through on her way down the coast.
Awnings now made their appearance, and meals could be eaten
without, as Herc expressed it, “hanging on with your toe nails.”
White uniforms were the order of the day, and very natty the jackies
and officers looked in their snowy regalia.
One morning, soon after they entered the “gulf-weed belt,” as
sailormen call it, the crew was busy at brass work and in patching up
the numerous small damages sustained by the destroyer in her
rough experience off the American coast. The scene of activity was
abruptly halted soon after five bells by a sudden cry of:
“Wreck ahead!”
The hail thrilled everybody. It meant a break in the monotony, and
possible adventure.
“Where away?” was the hail from the small bridge forward of the
conning tower, on which Ensign Conkling was on duty.
The next minute the officer’s glasses were eagerly scanning the
glistening sea in the direction in which the lookout had indicated the
wreck. A brief consultation followed. Ned, whose duty took him near
the conning tower, heard Lieutenant Timmons remark to Ensign
Conkling:
“She’s a distinct menace to navigation, and would be much better
out of the way.”
“I agree with you, sir,” agreed the ensign. “Shall I change the
course?”
“You had better do so, if you please. We are too far south for any of
the regular derelict destroyers to happen along, so it becomes our
duty to put her out of the way.”
The Beale’s course was changed. She was headed up toward the
derelict, which speedily became visible to the naked eye as a low-
lying hulk, with the stumps of three masts sticking up from her
clean-swept decks. Few objects equal in melancholy suggestion a
derelict met with in mid-ocean. The sight of a craft which once
gallantly bore human beings, with their hopes and aspirations, now
miserably tumbled about by every passing breeze or wave, invariably
affects a sailor depressingly.
As the Beale drew closer there was not much conversation among
the men. Such as there was, was carried on in low tones.
“She’ll have been a barque,” remarked Stanley, who was himself an
old blue-water man, and who stood alongside the boys. “See those
three stumps. An old-timer, too, judging by that deck house right aft
of her foremast.”
The derelict was, indeed, a battered relic of the seas. Green weeds
could be seen clinging thickly to her underhull as she dipped slowly
and lazily on the swell. Ragged, bleached ends of ropes hung over
her side like the rags on a beggar. It was evidently some time since
she had been abandoned. So far as her timbers went, however, she
was, to all seeming, still seaworthy, as her large amount of free-
board showed.
“What are we going to do?” Herc asked curiously, as the Beale
ranged up alongside at a distance of two hundred yards or so.
“I imagine that we are going to blow her up,” rejoined Ned.
“That’s it,” put in Stanley. “She’ll make a fine target, too.”
“As good a one as I did once,” grinned Herc, reminded of the
occasion on which he had almost served as a human mark at target
practice. Both boys laughed at the recollection.
“Come on, you Strong, and you Taylor and Stanley, I want you,” said
a petty officer, coming forward. “The ensign is going to be put
aboard that old craft to see if there’s anything on her of value before
we blow her to Davy Jones.”
This task just suited the boys. The derelict had already excited their
interest. To have a chance of setting foot on her was just what they
desired. The other men watched them with envy, as one of the
remaining boats carried by the Beale was launched, and the ensign
took his place in the stern sheets.
As may be imagined, the oarsmen gave way with a will, and were
soon at the side of the abandoned craft. To board her, however, they
had to row round her stern, which was square and ugly, and bore on
it in faded white letters the name Donna Mercedes.
“A dago, eh?” commented Stanley, in low tone, for he did not wish
the officer to hear him talking, which would have been a breach of
discipline.
“Ease all!” shouted the ensign at the same instant. He had sighted a
place where the breaking away of the mast had smashed a bulwark,
and at which it would be an easy matter to board the derelict.
“You men may come aboard if you want to,” he said, as he sprang
nimbly upward on to the moldering deck. “Leave one of your
number to guard the boat, though.”
“You fellows go,” said Stanley. “I’d rather sit here in the shade and
have a smoke.”
Nothing loath, the Dreadnought Boys quickly followed the ensign,
little dreaming what consequences their visit was to have for them in
the immediate future.
CHAPTER VI.
THE SECRET OF THE DERELICT.

The deck of the derelict presented as dismal a scene as had her


hulk. The seams gaped whitely, and the litter of broken spars and
mildewed canvas showed only too plainly through what an ordeal
she had passed before being abandoned. Ensign Conkling lost no
time in making his way down a companionway leading into what had
been the captain’s quarters astern.
The two Dreadnought Boys, thus left to themselves, walked forward
toward the deck-house. This erection, which had once been painted
white, had been almost torn from the deck by the fury of the storm
which had resulted in the casting away of the Donna Mercedes. Its
doorway hung by one hinge, flapping to and fro in melancholy
rhythm as the ship rolled to the swell.
“It’s a good while since any one made their way in here,” remarked
Ned, as he plunged through the portal into the dark interior of the
place.
The house had apparently been utilized as both a bunk house for the
inferior officers of the Donna Mercedes and likewise as a kind of
galley. Cooking utensils lay higgledy-piggledy about the rusty stove,
and in the forepart of the deck-house were a few rude bunks. The
tumbled state of the bedclothes, still lying in these, showed that the
ship must have been abandoned in a hurry.
Suddenly something white stuffed into a crack near the ceiling of the
place caught Ned’s eye.
“Papers!” he exclaimed. “Let’s have a look at them, Herc.”
“All right,” agreed Herc, bending over Ned’s shoulder as, having
pulled the bundle from its place, the Dreadnought Boy moved
toward the door and the light.
The papers which Ned found proved to be a mass of water-soaked
writing in faded ink, consisting of two or three pages.
“Well, they are doubtless very interesting, but unfortunately for us
we can’t read them,” exclaimed Ned, in a tone of disappointment, as
the bright sunlight fell on the moldy writing.
“Why not?”
“Because it is written in Spanish. Hullo! here’s a signature. Well, we
can make that out, anyway. Let’s see, Maritano de Guzman. And look
here, Herc, here’s the remains of a seal.”
“Well, what are you going to do with them?” asked Herc curiously.
To him the bundle was simply so much old junk. Ned, however, had
a dash of the romantic mingled with his intensely practical qualities,
and he thrust the papers into his blouse.
“I’ll give them to Lieutenant Timmons, I guess,” he said; “he may be
able to understand what all the writing is about. I can’t, and am not
going to try to.”
“Who do you suppose Maritano what-you-may-call-um was?” asked
Herc.
“Haven’t the faintest idea,” laughed Ned lightly. “Some sea cook, I
imagine, for he seemed to have his quarters in the galley.
“Well, come on; we’d better hurry aft. The ensign may want us,”
reminded Ned, and hastily the two boys made their way sternward
along the bleached decks. It was well they had hastened, for just as
they reached the break in the deck marking the rise of the old-
fashioned stern-cabin, they heard a voice hailing them. The tones
floated up from below, through the broken glass panel of the cabin
skylight.
“Herc, Strong and Taylor, come below here.”
“Ay, ay, sir,” cried Ned with alacrity. Followed by Herc, he bounded up
the few steps to the raised deck above the cabin, and dived down
the companionway.
They found the officer standing at the cabin table, which a shaft of
sunlight, falling through the broken skylight, illuminated brightly. He
was examining the contents of a stout wooden box, brass bound and
about a foot square, which had evidently once contained the ship’s
papers. The documents lay littered about the table, opened, as the
officer had been examining them.
The boys waited for Ensign Conkling to speak.
“You had better put those papers back in the box, and I’ll take it
aboard with me,” he said.
“Yes, sir——,” began Ned. He was just about to hand over the
papers he found in the forward deck-house when there came a
sudden sharp hail from outside.
“Aboard the Donna Mercedes!”
“Ay, ay!” shouted the ensign, who had recognized Stanley’s voice,
“what is it?”
“A squall coming up from the southeast, sir!” came the reply.
“Come on, there, look lively, boys,” ordered the officer, and in the
hurry of packing the documents back in the square box Ned, for the
moment, quite forgot all about what he deemed were the
unimportant papers in his blouse.
The light that had flooded the cabin table was suddenly blotted out
before they finished. The officer, having rummaged the cabin
thoroughly without finding anything more of interest, ordered a
quick return to the boat. They gained it just as the tropical squall
swept down on them.
“Shove off, quick!” came the command, as a rolling wall of white
water rushed toward them.
Just in time the brown arms shoved off the ship’s boat. The next
instant she was half buried in a flying smother of white spray, as the
squall, in all its fury, struck them.
“Toot! toot! toot!”
It was the siren of the Beale blowing a recall.
“About time,” muttered Ensign Conkling grimly, as the men rowed
with all their might to keep from being dashed against the hulk. “If
we’d been a few minutes later we’d have lost the boat.”
The wind fairly screamed about the boat, and the rain beat with
furious force in their faces, as they pulled through the squall for the
distant hull of the destroyer. Before they were half way there,
however, the sun was brightly shining again, making their soaked
garments steam as they labored. With such fury and suddenness do
tropic squalls descend and vanish. But as the men raised their eyes
and looked at the sparkling sea, darkened to the northwest, where
the just departed squall was hastening onward, an exclamation of
surprise burst from the lips of every occupant of the boat.
Not a trace of the derelict was to be seen! She had vanished as
utterly as a figure on a slate obliterated by the passing of a wet
sponge. The squall had wiped out the Donna Mercedes and sent the
poor battered wanderer to the bottom of the sea.
Of course, an officer being on board the boat, the men made no
comment at the time, but many were the speculations indulged in
during the noon smoke hour concerning the old derelict. The old
sailors on board were inclined to think that, weakened as she was by
long drifting, her half-opened seams had admitted a great flood of
water when the squall struck, causing her instantly to founder.
Although not officially transmitted, the “wireless telegraphy” which
begins at the commander’s orderly and ends in the forecastle of all
naval ships soon transmitted details of what Ensign Conkling had
discovered on board the Donna Mercedes. She had been a chartered
vessel, owned by a merchant of Costaveza, the very place for which
they were bound. Laden with dye woods and hides, she had set out
for a northern port some months before. A hasty note scribbled on
the captain’s papers, in his own hand apparently, stated that after
battling with a gale for three days the Donna Mercedes had begun to
sink, and had been abandoned in a hurry. The name of Senor de
Guzman appeared as a passenger.
“They must have quit her in a hurry if the captain left his papers,”
was Stanley’s comment. “A skipper would almost rather leave his
head than leave those behind.”
“I wonder what became of those on board her,” said Ned musingly,
his mind busy with thoughts of the fate of that unhappy ship’s
company.
“That’s a question,” rejoined Stanley, expelling a great cloud of blue
smoke. “They may have been picked up, and again they may not.”
“And if not?”
“Well, in that case it ain’t hard to guess that they drifted around till
they died. That’s all that castaways in the tropics can do,” grunted
Stanley.
“Unless they made land,” supplemented Ned.
“As I understand it, the captain wrote down his latitude and
longitude as near as he could figure it out when they abandoned
ship,” said Stanley. “The figures show him to have been blown most
1,000 miles off his course.”
“But how did the ship get back near to the coast again?” inquired
Herc.
“The set of the Gulf Stream, I reckon, or maybe some of those
mysterious currents that nobody knows much about. Derelicts have
a queer habit of bobbing up where no one expects them.”
The morning after this conversation the Beale steamed slowly
between two high headlands of rock, clothed with palms and other
tropical growth, and after proceeding some distance into the basin
formed by the two “horns” of the harbor came to an anchorage.
Immediately the Stars and Stripes went up at her blunt stern, and
men were set to work rigging the starboard gangway.
“Doesn’t look much as if there was a revolution going on ashore
there, does it?” asked Stanley, who had joined the boys as they
stood leaning over the starboard rail forward, gazing at the scene
that unfolded itself before them. It was a gorgeous panorama of
color and light.
In the foreground was the harbor, almost landlocked at its entrance
by two projections of rocky cliff. Across the glassy water, dotted with
small native craft, with here and there a coasting steamer lying at
anchor, was the town—a mere huddle of red roofs and white walls,
as seen from the Beale’s decks. Behind the town came a belt of vivid
greenery, and beyond that shot up like a huge rampart a wall of blue
mountains, with sharply serrated skyline and densely wooded sides,
covered, seemingly, to their summits.
“It’s like a scene in a theater,” said Herc admiringly. And so it was.
Lieutenant Timmons, with sword and cocked hat, and accompanied
by his officers, all in full dress uniforms, shortly emerged from his
cabin. His boat, of which Herc and Ned formed part of the crew, was
called away at once.
“You’ll have a good chance for a run ashore,” whispered Stanley, as
they briskly came alongside the starboard gangway and the officers
stepped on board. Ned and Herc already knew that the Lieutenant’s
destination was the American consulate.
The row ashore occupied but a brief space of time. The eight men
composing the crew had never rowed with greater vigor. Somehow
the sight of land close at hand seems to endow Jack with wonderful
muscles and energy. Soon they were at a landing, on which several
inquisitive townsfolk and barefooted loungers, with yellow cigarettes
between their fingers, were assembled.
“The men can take a run ashore for two hours, Stanley,” said
Lieutenant Timmons, as he left the boat and, followed by his little
escort, made his way up a narrow, dark street. In front of one
balconied building on this thoroughfare the American flag was
floating, denoting that there was the American consulate.
As may be imagined, the jackies lost no time in mooring the boat.
Lots were then quickly drawn to see who should remain on watch in
it. The lot fell to a young sailor named Diamond. With eager looks
about them the others quickly made off, leaving Ned, Herc and
Stanley standing alone. The loungers swarmed about them. Some
were begging, others had small articles of native manufacture to
sell. It took some minutes to shake them off, and then the three
sailormen headed up a tree-bordered street which seemed to lead
toward the outskirts of the town.
Some moments of brisk uphill walking brought them to a pretty red-
tiled house, in front of which, under spreading tropical vegetation,
several small vine-covered booths were scattered about. A sign in
front proclaimed that American soda was for sale there.
“Say, I’m as thirsty as a limekiln!” exclaimed Herc, as his eyes fell on
the sign. “What do you fellows say to sampling some of that?”
He pointed to the sign.
All agreed it would be a good idea, and soon they were seated in a
small booth awaiting the arrival of a waiter.
“Queer they should have soda down here,” commented Herc, gazing
approvingly about at the snug nest of greenery, through which a
pleasant breeze from the blue bay beneath swept refreshingly.
“Oh, I don’t know,” rejoined Stanley, “these dagoes have taken to
soda amazingly since they first tasted it on American steamers.
Besides, you know, the mail boats bring tourists down here in the
winter.”
At this point the conversation of the trio was interrupted by the
arrival of a stout, black-mustached man in a white duck suit, wearing
a big panama hat and carrying a palm-leaf fan.
“How do you do?” he exclaimed in excellent English, though he was
palpably a native.
The boys responded in kind, and then, to their amazement, the
aristocratic newcomer inquired what it would be their pleasure to
drink.
Their astonishment must have reflected itself on their faces, for, with
a light laugh, the white-ducked individual burst forth with
explanations. On account of the revolution his waiters had all left—
been impressed into the army, he explained, so he had to do the
waiting himself. Anyhow, it was the off season, so he did not so
much mind. Where were the revolutionists? Oh, quien sabe? Over in
the mountains somewhere. The mountains acted as a natural barrier
to Boca del Sierras, he was happy to say, and so long as the brave
government troops could keep the insurgents on the other side of
the range all would be well.
Having taken the orders, he hurried away. While he was gone the
boys’ talk reverted to various topics, when suddenly Herc, who had
been gazing at the harbor below them, exclaimed:
“Why, this is the place the Donna Mercedes sailed from.”
“So it is,” responded Ned, “and, by the way, that reminds me,
Stanley, that I promised to show you those papers before I handed
them over to Lieutenant Timmons.”
“Good gracious! haven’t you done that yet?” demanded Herc.
“Haven’t had an opportunity to,” rejoined Ned. “Unfortunately, in the
service you can’t walk up to an officer and say, ‘I’d like a word with
you.’”
“Like our friend in Brooklyn,” grinned Herc, recalling the dark-skinned
man, Senor Charbonde.
“Exactly,” laughed Ned. The lad dived into his blouse for the papers
from the Donna Mercedes. Since that night in the boat, when for a
time it seemed that they were all doomed, the boys had struck up a
great friendship with Stanley, who was an older man than either of
them, and had seen many years of service in the navy. Like many
another man of superior intelligence and character, he had had no
opportunity to rise, either through lack of interest or ill luck, and was
still a boatswain’s mate. Of his former life the boys knew little. But
with the readiness of youth to form warm friendships, they had
struck up one with this man and had already told him of their
discovery on board the Donna Mercedes. Not till that moment,
however, had an opportunity presented itself to consult him about
the papers. As Stanley knew Spanish pretty fluently both boys felt
that he would be an invaluable aid in revealing to them what secret
—if any—the papers held.
Just as Stanley laid his big, brown paw on the bundle of faded
documents the polite waiter pro tem. of the Villa Espenza appeared,
carrying the soda on a silver tray. He set it down with a bow and
flourish, and accepted payment with an indifferent air. His sharp,
dark eyes, however, in the roaming glance they had taken over the
table, had noted the papers which Stanley had just appropriated. An
expression of deep interest, which, however, he succeeded in
masking from the boys, came into his face as he did so. Clearly the
unctuous proprietor of the Villa Espenza was in deep thought as,
with another bow and flourish, he moved away.
CHAPTER VII.
AN INSULT TO THE FLAG.

But of their host’s interest in the papers the little group had no
inkling. They contentedly sipped their sodas—which, to tell the truth,
despite their provider’s recommendation, were rather warm—and
watched Stanley furrowing his weather-beaten brow over the
documents.
“Well,” said Ned at last, “what do you make of them?”
“Hold on a minute,” cried Stanley excitedly. Evidently he had
stumbled across something that made the papers of strange interest
to him.
“Why,” he shouted with a slap of his knees the next minute, “it looks
like we’ve stumbled on somebody’s treasure trove.”
“What?”
“That’s what I said. This paper here, so far as I can make out, is the
last will and testament of this old chap, de Guzman, who signs it. It
wills all his fortune, real and personal, and that seems to be pretty
big, to a Senorita Isabelle de Guzman.”
“Guzman!” exclaimed Ned, “seems to me I’ve heard that name a lot
lately.”
“Why, yes,” put in Herc, “it’s the name of the leader of the
revolutionists. They say he’s the worst enemy Americans down here
have.”
“Hum,” pondered Ned, “maybe this girl is some relation.”
“Maybe; there’s a good catch for you, Ned,” laughed Stanley, “for
this will disposes of an estate worth almost a million, and that’s a lot
of money down here.”
“Or any other place,” grinned Herc, clinking what remained of his
last month’s pay.
“Well, what are we going to do about it?” inquired Ned.
“Just hang on to it for a while,” counseled Stanley, handing back the
paper. “I’d advise you to consult with Lieutenant Timmons or the
American consul, and then we can learn better what to do about it.
After all, the Guzman named here may be down in the Argentine for
all we know. It’s a common enough name in South America.”
“That’s so,” agreed Ned, “but the ship hailed from this port, or so her
papers said.”
“That’s right,” agreed Stanley, “but what was old de Guzman,
supposing he is, or was, worth a million, doing in her galley?”
“That’s a poser,” cried Herc.
“It’s like a scattered Chinese puzzle,” muttered Ned. “I wonder if we
shall ever be able to put it together. Hello!”
He started to his feet suddenly and ran rapidly round the table to the
other side of the arbor.
“What are you doing—chasing yourself round the block for
exercise?” demanded the astonished Herc.
“No, but I’m almost certain that I saw some one dodge behind those
palms yonder as I jumped up. Just before that I heard a rustling in
the creepers behind you.”
“Somebody rubbering?”
“That’s what it looked like. I don’t know what to make of it.”
“I do,” put in Stanley, rubbing his grizzled chin.
“What, then?”
“That was a mighty interesting conversation we were just having.”
“To whom but ourselves?”
“To any one named Guzman, or kin to the Guzmans,” pronounced
Stanley gravely.
“By hookey, you’re right! Who do you think it could have been?”
“I haven’t got any idea. Maybe our friend, the handsome waiter,”
suggested Herc.
“I wonder,” mused Ned, but at that instant, as if to contradict his
thoughts, the proprietor of the Villa Espenza appeared from quite
another direction, balancing his tray gracefully and humming a song.
“Is there any one but ourselves here to-day?” inquired Ned, as he
came up.
“Alas! no,” was the reply, “business is very bad. You are the only
customers we have had for some days. The revolution has put
business—what you Americans call ‘to the bad.’”
After ordering and drinking more sodas the boys and their older
companion rose and, bidding farewell to the bowing proprietor and
promising to call again, started for the ship.
“Say, that fellow reminds me of somebody, and I can’t think who,”
said Ned, as they set off down the hillside.
“Same here,” murmured Herc. “I have it!” he exclaimed suddenly,
“that chap in Brooklyn—the fellow who wanted to know what was
going on on board the Beale.”
“Oh, that dago,” grunted Stanley, who was acquainted with the
incident, which the boys had related to him. “Somehow I’ve got an
idea you’ll hear more of that chap.”
“I hope not,” responded Ned. “I wouldn’t pick him out for a constant
companion.”
On their way through the water-front portion of the town the three
passed a small shop in which post-cards were displayed for sale.
“Let’s go in and get some,” suggested Ned.

You might also like