Skip to main content
main-content
Top

About this book

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

Table of Contents

Chapter 1. Introduction to Lego Mindstorms and leJOS

Abstract
This chapter provides step-by-step guidance on how to set up the environment for Java robotics programming with Lego Mindstorms EV3, including a basic overview of Lego Mindstorms EV3 and an introduction to leJOS EV3.
Wei Lu

Chapter 2. Introduction to Motor Sensors

Abstract
This chapter provides an introduction to EV3 large servo motors and their corresponding motor classes provided in leJOS EV3.
Wei Lu

Chapter 3. Controlling Wheeled Vehicles

Abstract
This chapter introduces various methods provided in the MovePilot class of leJOS EV3. You will learn know how to apply these methods in the pilot classes to control the wheeled vehicle so that it can trace out a predefined geometric shape with sides of a predefined length, including a square, triangle, and hexagon.
Wei Lu

Chapter 4. Coordinators and Navigator API

Abstract
This chapter introduces you the basics of the Cartesian coordinate system used in leJOS EV3. It also teaches you how to apply programming methods in the Navigation class to control the wheeled vehicle in order to trace out a predefined path with coordinates in a two-dimensional plane.
Wei Lu

Chapter 5. Depth-First Search Algorithm and Its Implementation with Lego EV3

Abstract
The act of searching falls under the artificial intelligence (AI) umbrella. The major goal of AI is to give computers the ability to think: in other words, to mimic human behavior.
Wei Lu

Chapter 6. Breadth-First Search and Its Implementation with Lego Mindstorms

Abstract
Just as you were introduced to the depth-first search (DFS) algorithm in Chapter 5, in this chapter you will learn how to implement a breadth-first search (BFS) algorithm in leJOS EV3.
Wei Lu

Chapter 7. Hill-Climbing Search and Its Implementation with Lego Mindstorms

Abstract
Just as you were introduced to the depth-first search (DFS) algorithm in Chapter 5 and the breadth-first search algorithm in Chapter 6, in this chapter, you will learn the basic ideas behind heuristic search strategies and how to implement a hill-climbing algorithm, which is one of the most typical heuristic approaches in leJOS EV3.
Wei Lu

Chapter 8. Dijkstra’s Algorithm and Its Implementation with Lego Mindstorms

Abstract
Following up on Chapter 7’s discussion of heuristic search algorithms, this chapter will address Dijkstra's algorithm.
Wei Lu

Chapter 9. The A* Search Algorithm and Its Implementation with Lego Mindstorms

Abstract
This chapter will introduce you to the fundamentals of the A* search algorithm. After completing this chapter, you will be able to apply the A* algorithm to solve path-planning issues in practice.
Wei Lu

Chapter 10. Introducing the Touch Sensor and Ultrasonic Sensor

Abstract
As you saw in Chapter 3, motors are the most important component for performing movement. In this chapter, you will learn about a set of sensors that are applied to perform informed movements.
Wei Lu

Chapter 11. Introducing the Light Sensor and Color Sensor

Abstract
The LEGO Mindstorms EV3/NXT kit comes with four common sensors: the touch sensor, the color sensor, the light sensor, and the ultrasonic sensor.
Wei Lu

Chapter 12. Introduction to Behavior Programming

Abstract
Robots have the ability to achieve a set of human-like behaviors, such as sensing, planning, and acting through using behavior programming. In this chapter, you will learn behavior programming on the basis of the subsumption architecture defined in leJOS.
Wei Lu

Chapter 13. Multithreading Programming with Java leJOS

Abstract
Multithreading is a very well-known programming feature, which allows you to execute multiple jobs at the same time. When developing programs for robots, you need to consider this programming feature as the basis of your programming architecture.
Wei Lu
Additional information