Build Your Own Teams of Robots with LEGO® Mindstorms® NXT and Bluetooth®
()
About this ebook
PLAN, DESIGN, ASSEMBLE, AND PROGRAM ROBOT SQUADS THAT COMMUNICATE and cooperate with each other to accomplish together what they can’t do individually. Build Your Own Teams of Robots with LEGO MINDSTORMS NXT and Bluetooth shows you how to construct a team capability matrix (TCM) and use the Bluetooth Robotic-Oriented Network (BRON) so your robot teams can share sensors, actuators, end effectors, motor power, and programs.
Find out how the Bluetooth communications protocol works and how to program Bluetooth in NXT-G, NXC, LabVIEW, and Java. Learn how to send and receive Bluetooth messages, data, and commands among robots, between a robot and a computer, and between an Android smart phone and a robot. Through teamwork, your robots will be able to accomplish amazing feats!
THE STEP-BY-STEP ROBOT TEAM PROJECTS IN THE BOOK INCLUDE:
* Crime Scene Investigation Robot Team * Robot Convoy * Rubik's Cube Solver
LEARN HOW TO:
- Coordinate multiple robots to work together as a team to perform tasks
- Combine two or more microcontrollers to make a single, multicontroller/multi-agent robot
- Take advantage of sensor and actuator capabilities in a team environment
- Establish goals and teamwork strategies for your robots
- Control your robot teams with NXT-G Bluetooth bricks and LabVIEW for NXT Bluetooth VI
- Activate your team using a smart phone
- Give your team of robots Java power with leJOS
- Use Java on the Linux and Darwin operating systems
Watch video demonstrations of the projects and download code and examples in multiple languages (NXT-G, Java, LabVIEW, and NXC) from the book's companion website at www.robotteams.org.
Downloads are also available at mhprofessional.com/robotteams.
Related to Build Your Own Teams of Robots with LEGO® Mindstorms® NXT and Bluetooth®
Related ebooks
The Internet of Things: Do-It-Yourself at Home Projects for Arduino, Raspberry Pi and BeagleBone Black Rating: 0 out of 5 stars0 ratingsHome Automation with Raspberry Pi: Projects Using Google Home, Amazon Echo, and Other Intelligent Personal Assistants Rating: 0 out of 5 stars0 ratings30 Arduino Projects for the Evil Genius, Second Edition Rating: 5 out of 5 stars5/5Microsoft .NET Gadgeteer: Electronics Projects for Hobbyists and Inventors Rating: 0 out of 5 stars0 ratingsWeb Development Essentials: A Beginner's Guide to HTML, CSS, JavaScript, and SEO: HTML 101 : Beginner to pro Rating: 0 out of 5 stars0 ratingsLearning NHibernate 4 Rating: 0 out of 5 stars0 ratingsArduino and Scilab based Projects Rating: 0 out of 5 stars0 ratingsArduino Made Simple: With Interactive Projects Rating: 0 out of 5 stars0 ratingsFundamentals of IoT: Get familiar with the building blocks of IoT (English Edition) Rating: 0 out of 5 stars0 ratingsArduino: A Beginner's Guide to Arduino Programming Rating: 3 out of 5 stars3/5Mastering BeagleBone Robotics Rating: 5 out of 5 stars5/5Make Your Own PCBs with EAGLE: From Schematic Designs to Finished Boards Rating: 5 out of 5 stars5/5Arduino BLINK Blueprints Rating: 0 out of 5 stars0 ratingsVB .NET in 60 Minutes a Day Rating: 0 out of 5 stars0 ratingsPractical Django 2 and Channels 2: Building Projects and Applications with Real-Time Capabilities Rating: 0 out of 5 stars0 ratingsArduino Essentials Rating: 5 out of 5 stars5/5Foundation Course for Advanced Computer Studies Rating: 0 out of 5 stars0 ratingsSimultaneous multithreading A Complete Guide Rating: 0 out of 5 stars0 ratingsRobot Builder's Sourcebook: Over 2,500 Sources for Robot Parts Rating: 0 out of 5 stars0 ratingsC Programming for the Pc the Mac and the Arduino Microcontroller System Rating: 0 out of 5 stars0 ratingsArduino Electronics Blueprints Rating: 4 out of 5 stars4/5Raspberry Pi Home Automation with Arduino - Second Edition Rating: 0 out of 5 stars0 ratingsArduino: Complete Guide to Electronics for Beginners Rating: 0 out of 5 stars0 ratingsAutoCAD Electrical 2024 Black Book Rating: 0 out of 5 stars0 ratingsPlayStation 3 Architecture: Architecture of Consoles: A Practical Analysis, #19 Rating: 0 out of 5 stars0 ratingsWhat-is-robot?-book-on-robot-illustrated Rating: 0 out of 5 stars0 ratingsAdvanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes Rating: 0 out of 5 stars0 ratingsInternet of Things with Arduino Blueprints Rating: 0 out of 5 stars0 ratingsArduino A Complete Guide Rating: 0 out of 5 stars0 ratings
Telecommunications For You
12 Ways Your Phone Is Changing You Rating: 4 out of 5 stars4/5The Great U.S.-China Tech War Rating: 4 out of 5 stars4/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsThe Deal of the Century: The Breakup of AT&T Rating: 4 out of 5 stars4/5Wireless and Mobile Hacking and Sniffing Techniques Rating: 0 out of 5 stars0 ratings15 Dangerously Mad Projects for the Evil Genius Rating: 4 out of 5 stars4/5Make Your Smartphone 007 Smart Rating: 4 out of 5 stars4/5Android App Development For Dummies Rating: 0 out of 5 stars0 ratingsTor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5Codes and Ciphers - A History of Cryptography Rating: 4 out of 5 stars4/5Radio and Radar Astronomy Projects for Beginners Rating: 0 out of 5 stars0 ratingsAlexa For Dummies Rating: 0 out of 5 stars0 ratingsA Beginner's Guide to Ham Radio Rating: 0 out of 5 stars0 ratingsMedical Terminology Demystified Rating: 4 out of 5 stars4/5Medical Charting Demystified Rating: 2 out of 5 stars2/5Cell Phone Photo Tips: How to Take Better Photos with Your Smart Phone Rating: 3 out of 5 stars3/5The Hello Girls: America’s First Women Soldiers Rating: 4 out of 5 stars4/5MORE Electronic Gadgets for the Evil Genius: 40 NEW Build-it-Yourself Projects Rating: 4 out of 5 stars4/5Nurse Management Demystified Rating: 0 out of 5 stars0 ratings22 Radio and Receiver Projects for the Evil Genius Rating: 0 out of 5 stars0 ratingsCodes and Ciphers Rating: 5 out of 5 stars5/5Pharmacology Demystified Rating: 4 out of 5 stars4/5Steampunk Gear, Gadgets, and Gizmos: A Maker's Guide to Creating Modern Artifacts Rating: 4 out of 5 stars4/5Programming Amateur Radios with CHIRP: Amateur Radio for Beginners, #6 Rating: 0 out of 5 stars0 ratingsDemons of the Deep Rating: 0 out of 5 stars0 ratings101 Spy Gadgets for the Evil Genius 2/E Rating: 4 out of 5 stars4/5iPhone X Hacks, Tips and Tricks: Discover 101 Awesome Tips and Tricks for iPhone XS, XS Max and iPhone X Rating: 3 out of 5 stars3/5iPhone 12 Mini Instruction Manual: Revolutionize Your iPhone 12 Mini with these Easy-Peasy Tips and Hidden Strategies Rating: 0 out of 5 stars0 ratingsMaking Things Move DIY Mechanisms for Inventors, Hobbyists, and Artists Rating: 0 out of 5 stars0 ratingsOverview of Some Voice Over IP Calls and SMS Verifications Services Providers Rating: 0 out of 5 stars0 ratings
Reviews for Build Your Own Teams of Robots with LEGO® Mindstorms® NXT and Bluetooth®
0 ratings0 reviews
Book preview
Build Your Own Teams of Robots with LEGO® Mindstorms® NXT and Bluetooth® - Cameron Hughes
Copyright © 2013 by McGraw-Hill Education, LLC. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-179857-0
MHID: 0-07-179857-9
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-179856-3, MHID: 0-07-179856-0.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please e-mail us at bulksales@mcgraw-hill.com.
McGraw-Hill Education, the McGraw-Hill Education logo, TAB, and related trade dress are trademarks or registered trademarks of McGraw-Hill Education, LLC and/or its affiliates in the United States and other countries and may not be used without written permission. All other trademarks are the property of their respective owners. McGraw-Hill Education is not associated with any product or vendor mentioned in this book.
Information contained in this work has been obtained by McGraw-Hill Education, LLC from sources believed to be reliable. However, neither McGraw-Hill Education nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw-Hill Education nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw-Hill Education and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education, LLC and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Education’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS.
McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
The authors would like to dedicate this book to those who helped us, showed patience, and gave us inspiration:
To Barbara, who gave Bob his first LEGO set in 1974, and to Betsy, who graciously gave Bob the precious time and space to work on the material and to build that amazing cube solver.
To Lael, who loaned us Trevor and his expertise for far too many long hours.
To Takeo, whose 60th birthday celebration made the robot spark our priority.
To Mary Beulah, who during the project would always pronounce the word robots ro-buts, we will miss you.
To Vera Mae, who was the first to ignite Tracey’s passion for philosophy and science, you are missed.
About the Authors
Cameron Hughes is a professional software developer with more than 15 years of experience. He is a staff programmer/analyst at Youngstown State University and a software epistemologist for Ctest Laboratories. Tracey Hughes is a senior software and graphics programmer at Ctest Laboratories, where she develops information and epistemic visualization software. Both Cameron and Tracey are long-time robot enthusiasts with a collection of more than 100 robots. They have sponsored and participated in local robot competitions and robot programming workshops for the LEGO NXT and RS Media platforms through their local ACM chapter. Cameron and Tracey are the authors of seven books on software development, multithreaded programming, and parallel programming in C++.
Trevor Watkins is a network communications and system integrations specialist. He is currently the Technology Manager at the Wadsworth Public Library, where he designs, integrates, and administers all aspects of the library’s network and information systems. Trevor is also an adjunct professor in the Computer Science and Information Systems Department at Youngstown State University, where he teaches high-level programming languages and computer networks. He has been a robot hobbyist for over 20 years, with the past five years dedicated to MINDSTORMS NXT, Vex, and Arduino-based robot kits, and he consults with local high school robotics teams.
Bob Kramer is a full-time computer science professor at Youngstown State University. His research interests include using LEGO robotics as a tool to teach computer science concepts, as well as the development and extension of programming tools for LEGO robots. Bob has helped extend the nxtOSEK environment to enable C++ programs to execute on the NXT platform, and has developed an interface for a third-party sensor in the leJOS environment.
Contents
Introduction
Acknowledgments
CHAPTER 1 It Takes Two to Tango
When the Robot We Have Is Not the Robot We Need
Special-Purpose Robots Can Be Flexible
General-Purpose Robots: Fact or Fiction?
Reprogrammable Robots
Flexible Special-Purpose Robots and Reprogrammable Multipurpose Robots
Two Microcontrollers Are Sometimes Better Than One
Possible Teams, Possible Players
Do Networked Robots Equal Robot Teamwork?
Coordinating Robots Based on Time or Chronology
Event-Based Robot Coordination
Message-Based Coordination
The Basic BRON Approach
The World of Bluetooth Devices
BRON’S Believe It or Not
CHAPTER 2 Bluetooth for MINDSTORMS NXT: A Closer Look
So Exactly What Is Bluetooth?
The Myth of NXT’s Bluetooth Problem
What Does Bluetooth Mean for NXT-Based Robots?
Is NXT-Bluetooth Capability Software or Hardware?
A Pause for Some Bluetooth-NXT Brick Preliminaries
What’s in a Name?
A Little Security (or at Least Privacy), Please!
Visibility vs. Invisibility
Who Is the Initiator (Team Leader)?
Physical Architecture vs. Logical Architectures
After the Connection Is Made
Bluetooth Functions Don’t Wait
Talk to Initiators on Line 0
Introducing the Scout Bots
Setting Up the Initial Bluetooth Connection
Waiting for and Sending a Bluetooth Response
Teamwork: A Simple Bluetooth LabVIEW Application
The Team Leader Program (D1R2)
The Team Member Program (D1R1)
Team Mode and Bluetooth in LabVIEW
CHAPTER 3 One for All and All for One
What Are Sensors?
Sensors: The Input Transducers
Sensor Types
Classifying MINDSTORMS NXT Sensors
Sensors in the NXT World
Some Are Strong, Some Are Mobile, Some Are Smart
What the Sensors Can Do and Cannot Do
Special Sensors Give That Extra Something
Third-Party Sensors Used in Our CSI BRON
leJOS (Java) Support for Third-Party Sensors
LabVIEW Support for Third-Party Sensors
NXT-G Support for Third-Party Sensors
CHAPTER 4 Creating a Team of Movers and Shakers
Motors: The Output Transducer
Indoor and Outdoor Robots
Direct-Current Motors vs. Servo Motors
Controlling Speed and Torque
Here Come the Regulators: Encoders In and Out
Using Torque and Speed to Determine Selection of Team Members
Summarizing DC and Servos Motors
Controlling the Motors: Tetrix Controller and NXT Brick
Using the Motors
NXT-G PID Block
Robotic Arms and End Effectors
Robot Arms of Different Types
End Effectors of Different Types
Software Support of the Robot Arm
BRON’S Believe It or Not
CHAPTER 5 Bluetooth programming in NXT-G and LabVIEW
A Little Background Block by Block
Establishing a Connection with the BRON
Connecting a PC to NXT Bricks from NXT-G and LabVIEW
Connecting to the BRON
NXT-G Connection Block
LabVIEW On/Off and Connection Bluetooth Blocks
Establishing a Connection to the BRON Using LabVIEW
Communicating a Message to the BRON
Sending/Receiving Messages in NXT-G
Dynamically Setting Values for the Send Message Block
Writing/Reading a Message Using LabVIEW
CHAPTER 6 robot environments, Teamwork Strategies, and Goals
The Robot’s World
The Robot READ Set
Robot Application Architecture
A Simple Team-Based RAA Example
The Multipurpose Capability Matrix
A Basic READ Set for D1R1, D1R2, and D3C1
Teamwork Strategies and Goals
Simple Rule-Based Autonomy and READ Set + Robot Program Autonomy
Environment, READ Sets, and the Team Challenge
Let’s Not Fool Ourselves, It’s Slow!
A Closer Look at a Level 2 Autonomous MINDSTORMS/Tetrix-Based Team
How Do We Know When the Task Is Done?
BRON’S Believe It or Not
CHAPTER 7 Give Your Team of robots Java power with leJOS
Brief History of Java Virtual Machine for MINDSTORMS
The Power of leJOS Java for MINDSTORMS NXT
A Closer Look at the leJOS Utilities
Power of Java for Building Teams
Bluetooth Communications
The Java Classes
The Robot Class
CHAPTER 8 Got Linux and Darwin on Your Team of Robots?
The Operating System as the Gatekeeper
Operating System as Silent Partner
Computer-Aided Design (CAD) Software for Your Robot Designs Using Digital Designer
Development Languages for Programming Your Robots
The Simple NXC (Almost C) Tool Chains
Using Eclipse in the Linux/Darwin Environments
What About My Files? (Where Do They Go?)
Linux and Darwin as Runtime Environments
Runtime Capability When the Computer Is the Team Leader
The BlueZ Protocol Can Handle NXT Bricks
CHAPTER 9 Advanced Teamwork: One for All!
If It Works for Me, It’ll Work for You
From Team to Collective and Back
The Collective
Dividing Up the Labor
Communicating with Flippy and Twisty
Solving a Rubik’s Cube
Remember the Cube: Parts of the Cube
Solving the Cube
Cube Solver Design
Design Issues
Cube Solver Hardware: The Frame
Flipper: Flip It Well and Good!
Cube Solver Software
Setting Up Programming
Running the Robot
What to Do Next Time
BRON’S Believe It or Not
CHAPTER 10 Together We Stand: The Robot Convoy
Sometimes It Does Take a Team
Using the Bluetooth Robotic-Oriented Network (BRON) for the Robot Convoy
Challenges in Robot Convoys
Planning for the Convoy
Limitations of Robot Vehicles
Understanding Bluetooth Limitations
The Robot Convoy NXT-G Program
Improvement of the Robot Convoy
BRON’S Believe It or Not
CHAPTER 11 The CSI project
Overview of the CSI Project
The Tasks and Problems Encountered in Warehouse X
The Capability Matrix of the CSI Project
The READ Set of Warehouse X
An Approach to Solving the CSI Warehouse X
Summary of the CSI Project
BRON’S Believe It or Not
APPENDIX A Standard Java Classes for leJOS Bluetooth
Standard Java Classes
Class DeviceClass
Class DiscoveryAgent
Class LocalDevice
Class RemoteDevice
leJOS Bluetooth API
Class NXTCommDevice
Class Bluetooth
Class NXTConnection
Class BTConnection
APPENDIX B Bluetooth Robotic-Oriented Network (BRON) Team Members
BRON Cube Solver Team
BRON Convoy Team
BRON Crime Scene Investigation (CSI) Team
Index
Introduction
Even though we may be able to get a robot to do many different things and perform different tasks, we will never be able to build a single robot that can perform every task or do everything imaginable. Even a general-purpose robot is limited by the number or types of sensors it has or by the types of end effectors it possesses. We may only have access to a stationary robot where a mobile robot is needed. It might be determined that a four-wheeled tractor has the required type of mobility, and as it turns out, the robot we have is bipedal or has been designed with only two wheels. But we can’t go too far in the other direction either. It’s not practical or possible to build a different robot for every task or for every scenario we require. First, building a robot requires time, and the parts are costly. Sensors can be expensive. We wouldn’t want to build one robot to turn off the lights and a separate robot to turn on the lights. There would be a lot of unnecessary duplication. However, we could dismantle the robot we have to build the robot we need. We really don’t like this option, though. After we have put in the time and effort to build a robot and test it, and it does what we want it to do, we’re usually happy, and we keep it.
So what is the solution? We don’t want to build a new robot for every task that pops up, and we don’t want to dismantle a perfectly good working robot that already serves one purpose in order to do some new task. Sometimes we’re lucky and we have a third alternative. We might have a robot that seeks and reports the positions of red things, and we might have another robot that retrieves tennis balls. What if we needed a robot that could retrieve apples from the backyard that had fallen from the tree? We could reprogram our tennis ball retrieval robot to look for apples instead of tennis balls. But we still need our tennis ball retrieval robot, so that option is no good. We could reprogram it to retrieve tennis balls and apples, but that would slow it down because now it has to determine whether it is sensing an apple or a tennis ball, and it works just fine at the speed it has. So that’s no good. Likewise, we could reprogram our robot that reports red things, but the problem is that robot works just fine the way it is as well.
In this book we present a third alternative: robot teamwork. Let’s get the robot that finds red things to work together with the robot that retrieves tennis balls to create a robot application that retrieves apples (red ones, of course) from the backyard. This approach does require multiple robots to be involved in the solution, but it has the advantage of not having to totally reprogram or dismantle a working robot.
In this book we introduce the Bluetooth Robotic-Oriented Network (BRON). BRON is a communication technique that allows teamwork between two or more robots. BRON allows robots to share sensors, actuators, end effectors, motor power, and programming in order to accomplish as a team what they could not do individually. Rather than having to totally repurpose a robot or build a completely new robot from scratch, BRON allows you to use existing robots to work in teams to perform tasks that they were not originally designed to perform as individuals. With BRON, we use each robot to do what it is designed to do, and by adding communications between the robots, we can get the team of robots to do new things.
Who This Book Is For
The ideas and concepts presented in this book are for the most part applicable to all the major robot kits available today. Any robot kit that supports Bluetooth and Java, NXC, LabVIEW, or NXTG can be used to build the projects that we present in this book. We chose MINDSTORMS NXT and Tetrix to implement the projects in this book because MINDSTORMS NXT is one of the most widely used and well-known robot kits available. Its relative low cost and the wide availability of add-on sensors make it an easy choice for this book. Because we present the concepts and techniques in this book from beginning design to final detailed implementation, users of other robot kits such as Vex or Arduino can follow along with the projects in this book. But in order to take full advantage of all the examples, readers should be familiar with and have access to a couple of MINDSTORMS NXT/Tetrix robot kits.
The Programming Languages We Use
We present the examples in this book in several languages. National Instruments’ LabVIEW and LEGO’s NXT-G are used as alternative graphical environments. NXC and Java are used as the nongraphical languages. Although the book does not present every example in each language, the website supporting this book (www.robotteams.org) does have most of the major examples in at least two languages. Downloads for this book are also available at mhprofessional.com/robotteams.
This book is not an introduction to programming in any of the languages. We include several of the most popular languages for programming robots because it is assumed that readers are familiar with at least one of the languages. If you are completely new to programming, then you will need an introductory book that teaches you one of these languages so that you can follow along in this book.
Robot Skill Level Needed
Since most of the robots implemented in this book are simple designs, readers do not have to be advanced robot engineers. But readers are assumed to have some experience in building and programming robots, with a particular emphasis on MINDSTORMS NXT-based robots. This book is not an introduction to robot building. Robot enthusiasts, hobbyists, robotics majors, computer science majors, and those involved in robotics competitions will find the concepts and techniques presented in this book indispensable. Anyone who needs to build a robotic application that requires communication and cooperation between two or more robots will find this book a valuable resource.
The robot teams you will learn how to build and program include
• A crime scene analysis bot
• A robot convoy
• A Rubik’s Cube solver
Bluetooth Communications, Programming, and Protocol
You will learn how the Bluetooth communications protocol works and how it is programmed in NXT-G, NXC, LabVIEW, and Java. You will learn how to send and receive Bluetooth messages, data, and commands between robots, between a robot and a computer, and between an Android smart phone and a robot.
Sensors
In addition to learning to build specific robot teams and employ Bluetooth communications, readers will learn how to use light, touch, ultrasonic, compass, color, barometric, and chemical analysis sensors such as a pH sensor.
Unified Modeling Language and Flowcharts
Readers will learn how to use the Unified Modeling Language (UML) and flowcharts to plan communications between robots and how to capture the initial and final designs of robot capabilities.
BRON’s Believe it or Not
Most chapters will conclude with a brief section entitled BRON’s Believe It or Not.
These sections contain supplementary material that provides interesting, sometimes fun, but little-known facts about robots or robotics. These briefs are not essential in learning how to connect your robots with Bluetooth and can be skipped. In most cases, though, they do provide insight into or a deeper understanding about some area related to robots, robot building, or robot programming.
The Robot Teams Website
This book has a supporting website—www.robotteams.org—that will host complete examples from the book. The examples will be available as NXT-G, Java, LabVIEW, and NXC programs. Because there simply was not room to put the complete build instructions for all the robots we present in this book, and because some of the robots have common builds, we include the complete build instructions along with the parts lists on the website. Also, demonstration videos on each project in action will be available on the website. In addition to complete programming examples, build instructions, and robot demonstration videos, readers will find the latest blogs from the authors and technical articles exploring and discussing the notions, advantages, and disadvantages of building teams of robots. In addition to these, readers will find forums where other robot enthusiasts meet and discuss all things related to robotic teams.
MINDSTORMS and software Versions
The robot projects presented in this book were built with
• NXT 1.0 and NXT 2.0
• Tetrix for MINDSTORMS
They were programmed in the following environments:
• Mac OSX Lion
• SusE Linux 11.0
• Windows 7
The build instructions were produced using
• Digital Designer 4.2
• ML-CAD 3.30
• LPub 2.4.8.0
• L3P 1.4 Beta 20080930
• POV-Ray for Windows 3.6
The robot teams were programmed using
• LabVIEW 2011 and NXT-G 2.0 for the Macintosh
• Eclipse Helios
• leJOS 0.9.0
The Android smart phone was programmed using
• Ubuntu Linux 12.04
• Eclipse Indigo
• Android SDK, set to version 2.3.3 (API 10)
Robot Building, Testing, and Code Reliability
Although all the robots, examples, and applications in this book were tested to ensure correctness, we make no warranties that the robots, examples, and applications are free of defects or error, are consistent with any particular standard of merchantability, or will meet your requirement for any particular application. These robots and the examples that use them are meant for exposition only. They should not be relied on for solving a problem whose incorrect solution could result in injury to a person or loss of property, time, or ideas. The authors and publisher disclaim all liability for direct or consequential damages resulting from your use of the robots, examples, or applications presented in this book or contained on the supporting website for this book.
Acknowledgments
We could not have successfully pulled this project off without the help, suggestions, constructive criticisms, and resources of many of our friends and colleagues. We would like to thank the students and colleagues who reviewed and gave suggestions regarding the earlier versions of this material; the technical support at Vernier Software and Technology for the equation to convert the pH sensor’s raw voltage to the pH measurement; the technical support at LEGO Education, who give us valuable information; and the technical support at Pitsco, who gave us specifications on their DC motors. We are also indebted to the leJOS forums that provided so many nitty gritty ins and outs on Java and MINDSTORMS. Special thanks to Roger Stewart and Patricia Wallenburg, who showed much patience, and Ctest Labs for the use of their Pantheon and robot facilities.
Chapter 1
It Takes Two to Tango
The Lost Scrolls of Robotics: #1
No disassemble!
—Johnny 5, Short Circuit
There are no one-size-fits-all robots. No matter how hard we try, we cannot come up with a practical robot design that can be used to build a single robot that can perform any and all tasks. No one robot will ever be able to do everything. This is an important fact. There are many reasons this is true. But here are a few:
• Robots have or have access to a limited number of sensors.
• Robots have a limited number of end-effectors and actuators.
• Power requirements limit robot size, weight, strength, speed, and mobility.
The microcontrollers and microprocessors that robots use have designated purposes, communication limits, and calculation limits:
• Sensors have limitations and precision variations and capabilities.
• Different tasks require different types and numbers of actuators.
We may have a task that requires a heat sensor, and our robot is equipped with only a sound sensor. We may have a task that requires that our robot have ultrasonic sensory capability, and our robot is equipped only with color and temperature sensors. The task may require a robot that is capable of navigating vertical surfaces, and our robot has been designed to navigate only horizontal surfaces. Sometimes the requirement is not for a different capability but for a different degree of capability. For instance, we might have a robotic application that calls for three color sensors only to realize that our robot can be equipped with only one color sensor. Or we might have a situation where the robot application needs to be able to push or pull 25 pounds, and we find that our single robot’s actuator is capable of moving only 5 pounds.
When the Robot We Have Is Not the Robot We Need
What do we do when the robot we have is not the robot we need? A cloud of depression starts to loom at the mere suggestion of dismantling one of our prize robots. Each robot that we design and build is special, and generally, it has taken a long time to get it exactly where we want it to be, to get the looks cool, the functionality straight, and the programming instructions right. There is usually no interest in any proposition that includes dismantling one of our robots. It’s also difficult to find any fans in our group who are interested in reprogramming our robots. Once we’ve got them programmed, that’s it! If it ain’t broke, don’t fix it! However, there is another option. We could just build another robot in this case. In this way, we don’t have to worry about dismantling one of our works of art. This works out in some cases—if we have extra parts, microprocessors, and microcontrollers. But building another robot is not always practical. There may not be enough time, enough money, or other necessary resources for the robot build cycle. It simply is not practical to build a new robot every time a new task needs to be performed. So what do we do? In robotics, we have several approaches to this problem:
• Build highly configurable, modular special-purpose robots.
• Build general-purpose robots.
• Build reprogrammable robots.
Special-Purpose Robots Can Be Flexible
Figure 1-1 shows a basic puma robotic arm with several different end effectors. End effectors are devices at the end
of a robotic arm, designed to allow the robot to interact with its environment. Depending on the task the robot has to perform, the end effector can be changed without having to completely dismantle the robot and without having to build a completely new robot from scratch. The robot in the figure is an example of a configurable robot. End effectors can be expensive and can have very special purposes. The ability to switch off end effectors gives us a much more flexible robot design. Special-purpose robots, although often configurable, are used to perform very specific tasks, and those tasks are typically dedicated to some specific industry, for example, educational, janitorial, bomb disposal, automotive, space exploration, and so on. These kind of robots typically perform one or two types of tasks and offer