Using sensors to control your tank

Concept summary and lesson

Examples/demo

Your tanks now have..... RADAR! RADAR is RAdio Distance And Range, by the way. Today, we're writing code that will let the tank use the radar to explore its environment.

When your tank gets started now, you'll have some new data in the sensors structure. At the moment, it only tells you when it finds a wall, and how far the wall is from you. Here's how it works:

This "radar" is actually pretty similar in its capabilities to your ultrasonic sensors, or a lidar sensor. For game reasons, the radar can differentiate friend from foe and also identify when it's bouncing off of terrain, but a real sensor wouldn't do that.

Changes to the tank-battle game

Other sensors we can add

Since we have a tank with sensors now, we might consider having some other kinds of data about the world:

Other cool stuff that doesn't exist yet

Media resources

Exercises