Book Image

Smart Robotics with LEGO MINDSTORMS Robot Inventor

By : Aaron Maurer
Book Image

Smart Robotics with LEGO MINDSTORMS Robot Inventor

By: Aaron Maurer

Overview of this book

LEGO MINDSTORMS Robot Inventor is the latest addition to the LEGO MINDSTORMS theme. It features unique designs that you can use to build robots, and also enable you to perform activities using the robot inventor application. You'll begin by exploring the history of LEGO MINDSTORMS, and then delve into various elements of the Inventor kit. Moving on, you'll start working on different projects which will prepare you to build a variety of smart robots. The first robotic project involves designing a claw to grab objects, and helps you to explore how a smart robot is used in everyday life and in industry. The second project revolves around building a working guitar that can be played and modified to meet the needs of the user. As you advance, you'll explore the concept of biomimicry as you discover how to build a scorpion robot. In addition to this, you'll also work on a classic robotic challenge by building a sumobot. Throughout the book, you'll come across a variety of projects that will provide you with hands-on experience in building creative robots, such as building a Dragster, Egg Decorator, and Plankton from Spongebob Squarepants. By the end of this LEGO book, you'll have got to grips with the concepts behind building a robot, and also found creative ways to integrate them using the application based on your creative insights and ideas.
Table of Contents (12 chapters)

Programming

When you boot up the software, you will have the choice to build any of the five robots already loaded up for you to build and use the code provided. Follow the instructions online provided in the software. If you need more information about the software and hardware and details about the kit, then head to https://www.lego.com/en-de/themes/mindstorms/about and you will get what you need from this page.

I find having the software on a computer or laptop for coding is quite helpful because of the larger screen and being able to store programs into my system. It is a good idea to have the software installed on your tablet or phone because these are good for the remote control feature of the software. Explore all the options to find what works best for you as a designer.

To get started, with version 10.0.3 (713488), LEGO updated the software to give you an option to get a quick overview of the sensors and builds and how they work with the Intelligent Hub. If you have any experience with Mindstorms, then you won't necessarily need this, but it is a great addition for those who are new to the Mindstorms robotics systems.

However, this little build and coding activity is a great start to explore much of the content shared in this chapter.

You can access this activity anytime by going to Settings | General and accessing the activity titled Welcome Robot Inventor:

Figure 2.16 – The Welcome Robot Inventor activity found in Settings

Figure 2.16 – The Welcome Robot Inventor activity found in Settings

Beyond this quick intro screen, you are prompted right away with the screen featuring the five robot builds, where you can choose any of them and build, code, and expand based on all the activities each robot provides.

This is a great time to explore these builds if you want to learn more about what this kit can do. These builds will give you ideas on how to build certain parts of robots as well as seeing how the coding platform operates. While this chapter has been mostly informative, take the time to build these models to experience what this robot kit is capable of making:

Figure 2.17 – The main screen with the five robot builds

Figure 2.17 – The main screen with the five robot builds

Once you have had your fill of those robots, then it is time to begin to build your own projects. When you are ready to create your own builds and programs, you can scroll down to Other and get started on your ideas.

You will have the choice to program with blocks or Python, as shown in the following screenshot:

Figure 2.18 – You can choose blocks or Python

Figure 2.18 – You can choose blocks or Python

When you choose Word Blocks, you will get a Scratch-like interface to explore and build. This is a drag-and-drop application. You can see how the software looks when you choose the block coding option:

Figure 2.19 – The coding platform looks like Scratch when you choose blocks

Figure 2.19 – The coding platform looks like Scratch when you choose blocks

The software is a Scratch-based programming platform. It uses a drag-and-drop coding process that many will already be familiar with if you have used Scratch, Blockly, MakeCode, or Code.org, and so you will be quite comfortable with the interface. The layout of colors on the black backdrop makes it easy to organize, find blocks, and explore the interface.

If you are looking to see even more blocks and add your Xbox or PlayStation controller, be sure to add the necessary extensions to your software by clicking on the gray-outlined blocks at the bottom of your screen, as shown here:

Figure 2.20 – Note the extensions at the bottom left of your screen to find these blocks

Figure 2.20 – Note the extensions at the bottom left of your screen to find these blocks

There is also a Python coding option within the software that will allow those who know how to program in Python to really push the boundaries of coding. This is a very important feature to bring this kit to the next level of experience and expertise. The following screenshot showcases what the Python coding interface looks like in the software if you wish to go down this route:

Figure 2.21 – Python coding interface within the software

Figure 2.21 – Python coding interface within the software

I know that not everyone knows how to code in Python, so for the sake of this book, we will stick with the graphical interface for ease of understanding.

Having both options to code and program within the software is a huge bonus to prior kits. The option for text programming is going to allow the LEGO community to see some incredible projects being developed.

If you are new to Python, there is a manual icon on the side of the screen to help you see how the blocks look in Python, named Knowledge Base:

Figure 2.22 – Find the Knowledge Base icon on the right side of the screen

Figure 2.22 – Find the Knowledge Base icon on the right side of the screen

Once you click on the Knowledge Base icon, you will be provided with a menu of options to help with your learning and coding journey. Simply choose the topic you need help with, as shown in the following screenshot:

Figure 2.23 – Expanded help options within the notebook

Figure 2.23 – Expanded help options within the notebook

The one fundamental difference to this programming environment compared to the LEGO SPIKE Prime kit is that lessons are missing. Of course, this is designed for retail instead of education like the SPIKE Prime, so that makes sense, but it's still worth pointing out. However, please check out the lessons to expand your skills as there is compatibility between the two. You can find the lessons here: https://education.lego.com/en-us/lessons?products=SPIKE%E2%84%A2+Prime+Set.

When you boot up the software, there are no introductions or any quick demos. Instead, you have to decide to build one of the five robots to get started, or hopefully, you have enough confidence to get started without guidance. One bonus of this software is that with each robot build, there are several activities to expand on the robots to learn some new build techniques and use to inspire the building of your own creations.

One crucial part of the programming software is being able to access data from your motors and sensors. You can access the Intelligent Hub through the software to gather all the data on your motors and sensors to be able to enhance your coding and build ideas.

On your software interface, at the top left of your screen, you can see some basic data or you can click on the Intelligent Hub icon to open up a new screen to dive deeper:

Figure 2.24 – Click the Intelligent Hub icon noted in this screenshot to access the data on your Intelligent Hub

Figure 2.24 – Click the Intelligent Hub icon noted in this screenshot to access the data on your Intelligent Hub

There is a ton of potential in this kit as you continue to explore and unravel all that can be accomplished.