This book will show you the difference between making a robot move and making a robot __think__. Using Mindstorms EV3 and LeJOS—an open source project for Java Mindstorms projects—you’ll learn how to create Artificial Intelligence for your bot. Your robot will learn how to problem solve, how to plan, how to learn, and how to communicate. Along the way, you’ll learn about classical AI algorithms for teaching hardware how to think, algorithms that you can then apply to your own robotic inspirations.If you’ve ever wanted to learn about robotic intelligence in a practical, playful way, __Beginning Robotics Programming in Java with LEGO Mindstorms__ is for you.**What you’ll learn:** * Build your first LEGO EV3 robot step-by-step * Install LeJOS and its firmware on Lego EV3 * Create and upload your first Java Program into Lego EV3 * LeJOS API Functions * Java Programming for Motors * Robotics Behavior Programming with Sensors * Common AI Algorithms like DFS, BFS, and Dijkstra’s Algorithm * Java Multithreading Programming with Lego EV3 **Who this book is for:**Students, teachers, and makers with basic Java programming experience who want to learn how to apply Artificial Intelligence to a practical robotic system. Contents at a Glance 5 Contents 6 About the Author 10 Acknowledgments 11 Introduction 12 Chapter 1: Introduction to Lego Mindstorms and leJOS 13 Introduction to Lego Mindstorms 13 Introduction to leJOS 15 Lego Mindstorms EV3 15 Lego Mindstorms NXT 16 Lego Mindstorms RCX 16 JDK Installation 17 Testing the JDK Installation 20 Installation of leJOS and Its Firmware on Lego EV3 22 Eclipse IDE and Eclipse Plug-In for LeJOS EV3 28 Summary 37 Chapter 2: Introduction to Motor Sensors 38 Basic Concepts of Java Programming 38 Introducing Motors 39 Introducing the Motor Class 40 Controlling Basic Movement Using Motors 40 Using a Tachometer for Inertia Testing 42 Controlling the Accurate Rotation of Motors 44 Interrupting Rotation 45 Regulating the Motor Speed 47 Tracing a Straight Line 50 Other Motor Methods 52 Summary 52 Chapter 3: Controlling Wheeled Vehicles 53 Introduction to Navigation API 53 Basic Movement Using Pilot Classes 55 Tracing Out a Square 58 Tracing Out an Equilateral Triangle 63 Tracing Out a Regular Hexagon 68 Summary 73 Chapter 4: Coordinators and Navigator API 74 Cartesian Coordinate System Basics 74 Navigator API Functions 75 Controlling the EV3 Brick Hardware 78 Programming Practice with the LCD Display 82 Programming Practice with Key Presses 83 Programming Practice with Navigator API 85 Summary 90 Chapter 5: Depth-First Search Algorithm and Its Implementation with Lego EV3 91 Overview of DFS Algorithm 91 leJOS EV3-Based DFS Algorithm 99 Summary 108 Chapter 6: Breadth-First Search and Its Implementation with Lego Mindstorms 109 Overview of BFS Algorithm 109 leJOS EV3-Based BFS Algorithm 116 Summary 126 Chapter 7: Hill-Climbing Search and Its Implementation with Lego Mindstorms 127 Introduction to Heuristic Search 127 Overview of Hill-Climbing Search 131 leJOS EV3-Based Hill-Climbing Algorithm 139 Summary 146 Chapter 8: Dijkstra’s Algorithm and Its Implementation with Lego Mindstorms 147 Introduction to Dijkstra’s Algorithm 147 leJOS EV3-Based Dijkstra’s Algorithm 163 Summary 173 Chapter 9: The A* Search Algorithm and Its Implementation with Lego Mindstorms 174 What Is the A* Algorithm? 174 The Basic Idea of the A* Searching Strategy 174 Practice for Path Planning Using the A* Algorithm 184 Summary 188 Chapter 10: Introducing the Touch Sensor and Ultrasonic Sensor 189 Sensor Classes 189 Touch Sensor 190 Ultrasonic Sensor 192 Programming Practice with Touch Sensor 194 Programming Practice with Ultrasonic Sensor 196 Summary 197 Chapter 11: Introducing the Light Sensor and Color Sensor 198 Light Sensor 198 Color Sensor 200 Programming Practice with the Color and Light Sensors 202 Summary 207 Chapter 12: Introduction to Behavior Programming 208 Introduction to Behavior Programming 208 The Behavior API Functions 210 Design Pattern of Behavior Programming 211 Programming Practice with Behavior Programming 214 Summary 222 Chapter 13: Multithreading Programming with Java leJOS 223 The Thread Concept 223 Using Threads in leJOS 224 Method start() 226 Method isAlive () 226 Method sleep () 226 Practice with Multithreading in Java leJOS 227 Summary 233 Index 234 This book will show you the difference between making a robot move and making a robot think . Using Mindstorms EV3 and LeJOS—an open source project for Java Mindstorms projects—you’ll learn how to create Artificial Intelligence for your bot. Your robot will learn how to problem solve, how to plan, how to learn, and how to communicate. Along the way, you’ll learn about classical AI algorithms for teaching hardware how to think, algorithms that you can then apply to your own robotic inspirations. If you’ve ever wanted to learn about robotic intelligence in a practical, playful way, Beginning Robotics Programming in Java with LEGO Mindstorms is for you. What you’ll learn: Build your first LEGO EV3 robot step-by-step Install LeJOS and its firmware on Lego EV3 Create and upload your first Java Program into Lego EV3 LeJOS API Functions Java Programming for Motors Robotics Behavior Programming with Sensors Common AI Algorithms like DFS, BFS, and Dijkstra’s Algorithm Java Multithreading Programming with Lego EV3 Who this book is for: Students, teachers, and makers with basic Java programming experience who want to learn how to apply Artificial Intelligence to a practical robotic system. Discover the difference between making a robot move and making a robot think . Using Mindstorms EV3 and LeJOS—an open source project for Java Mindstorms projects—you'll learn how to create Artificial Intelligence (AI) for your bot. Your robot will learn how to problem solve, how to plan, and how to communicate. Along the way, you'll learn about classical AI algorithms for teaching hardware how to think; algorithms that you can then apply to your own robotic inspirations. If you've ever wanted to learn about robotic intelligence in a practical, playful way, Beginning Robotics Programming in Java with LEGO Mindstorms is for you. What you'll learn: Build your first LEGO EV3 robot step-by-step Install LeJOS and its firmware on Lego EV3 Create and upload your first Java program into Lego EV3 Work with Java programming for motors Understand robotics behavior programming with sensors Review common AI algorithms, such as DFS, BFS, and Dijkstra's Algorithm Who this book is for: Students, teachers, and makers with basic Java programming experience who want to learn how to apply Artificial Intelligence to a practical robotic system. Front Matter....Pages i-xv Introduction to Lego Mindstorms and leJOS....Pages 1-25 Introduction to Motor Sensors....Pages 27-41 Controlling Wheeled Vehicles....Pages 43-63 Coordinators and Navigator API....Pages 65-81 Depth-First Search Algorithm and Its Implementation with Lego EV3....Pages 83-100 Breadth-First Search and Its Implementation with Lego Mindstorms....Pages 101-118 Hill-Climbing Search and Its Implementation with Lego Mindstorms....Pages 119-138 Dijkstra’s Algorithm and Its Implementation with Lego Mindstorms....Pages 139-165 The A* Search Algorithm and Its Implementation with Lego Mindstorms....Pages 167-181 Introducing the Touch Sensor and Ultrasonic Sensor....Pages 183-191 Introducing the Light Sensor and Color Sensor....Pages 193-202 Introduction to Behavior Programming....Pages 203-217 Multithreading Programming with Java leJOS....Pages 219-229 Back Matter....Pages 231-234 This Book Will Show You The Difference Between Making A Robot Move And Making A Robot Think. Using Mindstorms Ev3 And Lejos, An Open Source Project For Java Mindstorms Projects, You'll Learn How To Create Artificial Intelligence For Your Bot. Your Robot Will Learn How To Problem Solve, How To Plan, How To Learn, And How To Communicate. Along The Way, You'll Learn About Classical Ai Algorithms For Teaching Hardware How To Think, Algorithms That You Can Then Apply To Your Own Robotic Inspirations. If You've Ever Wanted To Learn About Robotic Intelligence In A Practical, Playful Way, Beginning Robotics Programming In Java With Lego Mindstorms Is For You. If youѫve ever wanted to learn about robotic intelligence in a practical, playful way, this book will show you how to make your robot learn how to problem solve, how to plan, and how to communicate. -- Edited summary from book