Learning · Robot club · about 15 min
What a model gets: the sensor views as lists of numbers.
[1 mark]How many numbers are in the depth grid from tof_grid()?
[1 mark]What does this program print?
grid = list(range(64)) level = grid[16:32] print(len(level), level[0], level[-1])
[1 mark]Which rows of the depth grid look straight ahead, level with the robot?
[1 mark]One cell of the depth grid reads 400. What does that mean?
[1 mark]The camera image is 320 by 240 pixels, and each pixel is three numbers. How many numbers is one frame?
[1 mark]A model has only seen the depth grid with the robot facing a wall straight on. The robot turns a little. What happens to the numbers?
[1 mark]What is the name for the small set of numbers you choose to hand to a model, which still tell the situations apart?
Print the level rows' nearest and farthest readings as depth: min <cm>, max <cm>. Do not drive.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() # 64 distances, 8 rows of 8 grid = tof_grid() print(grid)
Plan your program here, then type it in and press Run.