Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

Light Seeking

Let's try to design a Q-Learning project for the Lego Robotics Invention System (RIS). In order to take useful measurements, the robot will need to be able to sample two light value readings, one to the left and one to the right, and then contrast them. The robot will also have two bumpers, both front and rear, in order to detect when it is hung up on something. The total input this robot will have to work with is summarized in the following table.

Sensor

Function

1

Front touch sensor

2

Light sensor

3

Rear touch sensor


Normally, light-seeking robots contain two light sensors, each pointing in slightly different directions so it can compare the two values and head toward the strongest value. The RIS kit only comes with a single light sensor, so we will have to simulate two sensors. We can "fake" two sensors by making the entire robot rotate left, take a reading, and then rotate right and take another.

NOTE

Lego has other options for comparing two light readings.

Now that we know the function of the robot, we can proceed with the design. We'll make a simple tank called the Q-Tank ("Cute-Tank" because it's pocket-sized). The complete directions can be found here.

Figure 1 The Q-Tank.

  • + Share This
  • 🔖 Save To Your Account