Book Image

Learning Lego Mindstorms EV3

By : Gary Garber
Book Image

Learning Lego Mindstorms EV3

By: Gary Garber

Overview of this book

Table of Contents (19 chapters)
Learning LEGO MINDSTORMS EV3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
10
Other Programming Languages
Index

Improving dead reckoning


In this next section, we will use autonomous data logging to collect sensor data, which we will graph and then analyze to improve our dead reckoning skills. Because the Gyro Sensor is so susceptible to drift, I know many FIRST LEGO League (FLL) teams who still prefer to use dead reckoning to navigate a course. Reconciling the amount of turning in dead reckoning with the values of the Motor Rotation sensors can be tedious and time consuming.

Data logging allows us to directly compare the values of the Gyro Sensor to the values of the Motor Rotation sensors over a period of time.

Let's begin by attaching a Gyro Sensor to port 2 on our robot. For the graphs in this chapter, I attached the Gyro Sensor to the caster-bot, but you can do this with any of our robots. In the following screenshot, you can see a simple program to acquire and store data from the sensors:

In the following steps, I will describe the program in the preceding screenshot:

  1. We start out by using sensor...