You are previewing Make: JavaScript Robotics.
O'Reilly logo
Make: JavaScript Robotics

Book Description

JavaScript Robotics is on the rise. Rick Waldron, the lead author of this book and creator of the Johnny-Five platform, is at the forefront of this movement. Johnny-Five is an open source JavaScript Arduino programming framework for robotics. This book brings together fifteen innovative programmers, each creating a unique Johnny-Five robot step-by-step, and offering tips and tricks along the way. Experience with JavaScript is a prerequisite.

Table of Contents

  1. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari<span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="registration">&#174;</span> Books Online Books Online
    4. How to Contact Us
    5. Acknowledgments
      1. Julián Duque
  2. 1. Building Robots with <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="keep-together">Lo-tech Materials</span>
    1. Building the SimpleBot
      1. Bill of Materials
      2. Build Steps
      3. Installing Node.js Packages
      4. Testing the Build with a Basic Program
      5. Troubleshooting
      6. A Simple Driving Program
      7. Troubleshooting
    2. Cutting the Cord
      1. Building a Wireless SimpleBot
      2. Wiring Up
      3. Controlling the SimpleBot
      4. Troubleshooting
    3. What’s Next?
  3. 2. TypeBot
    1. Bill of Materials
      1. Understanding Your Servomotors
    2. Anatomy of a Robot Arm
      1. Arm Layout
      2. Arm Constraints
    3. Building the Hardware
      1. The Base and Shoulder
      2. The Elbow
      3. The Wrist
      4. The Finger
      5. The Brains
    4. Writing the Software
      1. Creating the Project Files
      2. Controlling the Servos
      3. Initialization
      4. Sequencing a Key Press
      5. Running for the First Time
      6. Fine-Tuning the Arm
    5. What’s Next?
  4. 3. Getting Started with NodeBoats
    1. Bill of Materials
      1. Tools
    2. The Submarine Motor Pod
      1. Why Use a Motor Driver?
      2. Motor Pod Components
      3. Modifying the Motor
      4. Testing the Motor
      5. Finishing the Motor
      6. Inserting the Motor
      7. Drilling into the Motor Pod
      8. Closing the Motor Pod
      9. Waterproofing Your Wires
    3. Setting Up Your Spark
      1. Testing the Spark
    4. Your First Spark Program
    5. Soldering the Motor Driver
    6. Wiring Up Your Boat
      1. Powering the Motor Driver
      2. Connecting the Spark and the Motor Driver
      3. Connecting the Motor
    7. Controlling Your Motor: <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="keep-together">The Code</span>
      1. Adding Keypress Events
      2. Storing Keypress State
    8. Floating the Boat
    9. Steering with Servos
      1. Programming Servo Control
      2. Assembling the Rudder
    10. Setting Sail
    11. What’s Next?
  5. 4. piDuino5 Mobile Robot Platform
    1. Bill of Materials
      1. Tools
    2. Setting Up the Boards and Installing Software
      1. Installing Node.js on the <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="keep-together">Raspberry Pi</span>
      2. Downloading the piDuino5 Code and Dependencies
      3. Plug in the Arduino
      4. Test Johnny-Five over WebSockets
      5. Walk Through app.js
      6. Initializing Johnny-Five
      7. Controlling the Hardware
      8. Low-Latency Control with WebSockets
      9. Connect from Anywhere
    3. Assemble the Hardware
    4. Controlling with a Smartphone
      1. Downloading the piDuino5 Web App
      2. Post localtunnel to the Web App
      3. Try the Web App on a Phone
    5. Walk Through app.js and index.html
      1. Storing the localtunnel Address and Frontend
      2. Serving the UI
      3. Touchscreen Joystick
      4. Establishing a Connection
      5. Sending Commands
    6. What’s Next?
  6. 5. Controlling a Hexapod with Johnny-Five
    1. Bill of Materials
    2. Controlling the Robot from the Command Line
    3. An Introduction to phoenix.js
    4. Assembling the Robot
      1. Prepare the Chassis
      2. Mount the Electronics
      3. Prepare the Servos
      4. Installing the coxae
      5. Installing the Femurs
      6. Installing the Tibias
    5. The Coordinate System
    6. Trim the Servos
      1. Trim the coxae
      2. Trim the Femurs
      3. Trim the Tibias
    7. Add Ranges to the Servos
    8. Walking Is Hard!
    9. Meet the Animation Class
      1. An Array of Servos as the Target
      2. A Servo.Array as the Target
      3. An Array of Servo.Arrays as the Target
    10. The First Animation Segment
    11. Walking
      1. The Row Gait
      2. The Walk Gait
      3. The Run Gait
    12. Turning
    13. Command Reference
    14. What’s Next?
  7. 6. Building Voice-Controlled NodeBots
    1. Bill of Materials
      1. BeagleBone Black
    2. Building Our Project
    3. Building a Relay Circuit
      1. Controlling the Relay Circuit from Johnny-Five
    4. Building a Microphone Preamplifier Circuit
      1. Connecting the Microphone to the Relay from Johnny-Five
    5. Building the Commands Server
    6. Simple Voice Control Using the Web Speech API
    7. Integrate the Commands Server with the Relay Circuit
    8. Advanced Voice Control Using an Android Wearable
      1. Android Mobile Application
      2. Android Wear Application
    9. What’s Next?
  8. 7. An Indoor Sundial
    1. Bill of Materials
      1. Foam Core Structural Pieces
    2. Building Our Sundial
    3. Cutting and Assembling the Core Structure
      1. Assemble the Mounting Board
    4. Wiring and Configuring the Servos
      1. Wiring the Servos
      2. Configuring the Servos
    5. Building the Lower Base
    6. Making the Disks
    7. Build the Base Walls and Base Disk Support
      1. Build the Base Walls
      2. Position the Disks
      3. Build the Disk Support
    8. Finish Parts and Construction
      1. Build the Azimuth Arm
      2. Construct the Elevation Arc
      3. Cut a Gnomon
      4. Wire Up the Sun
    9. Code to Make It Go
      1. Understanding sundial.js
      2. Set Up Some Configuration in sundial.js
      3. sundial.js Details
    10. Putting It All Together!
    11. Making It Go!
    12. What’s Next?
  9. 8. Spooky Lights
    1. Bill of Materials
      1. Choosing a Controller Board
    2. Background
      1. What’s an LED Matrix?
    3. Assembling the Lights
      1. Tools Required
      2. Preparing the Matrices
      3. Constructing a Cable Assembly
      4. Decorating the Lights
      5. Troubleshooting
    4. Controlling an LED matrix
      1. Preparing the Arduino
      2. Running a Test Program
      3. Matrix Constructor Options
      4. Drawing to the Matrix
    5. Developing a Web Application
      1. Development Tools
      2. Using the Express Generator
      3. Developing an API
      4. Adding a User Interface
      5. Extending the Application
    6. What’s Next?
  10. 9. CheerfulJ5
    1. Bill of Materials
    2. Wiring the Circuit
    3. The CheerfulJ5 code
      1. Connecting to the Arduino
      2. Controlling an RGB
      3. Using the Node.js Read-Eval-Print Loop
      4. Defining the CheerLights Color Map
      5. Accessing the CheerLights ThingSpeak API
      6. Using the Twitter Streaming API
    4. Going Wireless with the Spark WiFi Development Kit
      1. Adding the Spark to Your Circuit
      2. Using the Spark-io IO Plugin
      3. Switching to Battery Power
    5. Packaging It Up
    6. What’s Next?
  11. 10. Interactive RGB LED Display with BeagleBone Black
    1. Bill of Materials
      1. BeagleBone Black
      2. WiFi USB Adapter (optional)
      3. External 5V Power Supply (Semi-Optional)
      4. RGB LEDs
      5. Sensors
      6. Miscellaneous
    2. Getting Ready: Software
      1. LEDScape
      2. Wiring Your LEDs
    3. Wiring Up Your RGB LEDs
    4. Code Time! Let’s Bring in the JavaScript
      1. Running a Test Script
      2. Adding in Johnny-Five/Beaglebone-io
      3. Adding a Photoresistor
      4. Changing Colors with an Accelerometer
    5. What’s Next?
  12. 11. Physical Security, <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="keep-together">JavaScript, and You</span>
    1. Simple Ultrasonic Sensor Project: Experimental Control Test (SUSPECT)
      1. Implementation
    2. SMS Augmented Ultrasonic Sensor Application: General Experimentation (SAUSAGE)
      1. Implementation
    3. Point-of-Entry Monitoring System (PoEMS)
      1. Implementation
    4. Lasers Impress Both Enemies and Relatives, Thank You (LIBERTY)
      1. Implementation
    5. Status Indicator Necessary, Buttons and Diodes (SINBaD)
      1. Implementation
    6. What’s Next?
  13. 12. Artificial Intelligence: BatBot
    1. Artificial Intelligence: The Basics
      1. Remote-Controlled Robots
      2. Semi-Autonomous Robots
      3. Autonomous Robots
      4. BatBot
    2. Bill of Materials
      1. Some Notes About the Materials
    3. Assembly
    4. Step 1: Remote Control
      1. Moving the Robot
      2. Controlling the Robot
      3. Pointing and Reading from the Sonar
    5. Step 2: Autonomy
      1. Implementing the Algorithm
    6. Troubleshooting
    7. What’s Next?
  14. 13. Delta Robots and Kinematics
    1. Bill of Materials
    2. Delta Anatomy
    3. Building Junky Delta
      1. Making It Move
      2. Predictable Positioning Through Kinematics
    4. More Sophisticated Delta Options
      1. TapsterBot
      2. Robot Army
    5. What’s Next?
  15. 14. Meow Shoes
    1. Bill of Materials
    2. Parts Explained
    3. Making the Sensor Inserts
      1. Solder the Sensors to the Wiring
      2. Install Sensors into the Shoes
      3. Tunnel the Wiring out of the Shoe
    4. Connecting the Shoes
      1. Prepare the Coiled Connector Cord
    5. Connect the Shoes to an Arduino
      1. Prepare Wiring
      2. Arduino Soldering
      3. Attach the Arduino to the Right Shoe
    6. Running the Code with Johnny-Five
      1. Connecting to Johnny-Five
      2. Setting up Sensors
      3. Logging Output of Sensors
      4. Example Behavior
    7. What’s Next?
  16. A. Appendix
    1. Installing Node.js
    2. Installing Johnny-Five
      1. Troubleshooting
      2. More Information
    3. Configuring Your Hardware
      1. Arduino
      2. BeagleBone Black
      3. Raspberry Pi
      4. Spark WiFi Development Kit
    4. Android Development
      1. Installing Android Studio
      2. Creating an Android Project
      3. Installing Volley
  17. Index