The Auto Thresholding challenge was fairly simple. Auto thresholding is the idea that the robot should adjust to its surroundings especially if it has sensors that measures something about its surroundings. For example, a robot may use a light sensor to detect the light in a room and based on the input it gets from the light sensor, it will do something else. This robot would not function the same way in a different room with brighter or dimmer lights. In order to counteract this problem, one should auto threshold their programs to let the robot create a threshold in every room it is in, and then compare the light it is shown to that threshold. Auto thresholding allows these types of programs to work in all environments.
Here is an example of the auto thresholding program that Kaity and I created:
This motion detection program is designed to detect the light in a room as soon as it is turned on. It saves this value in a variable, n and then the program compares the light detected by the sensor to the value of 100 + n. If we were only running this program in one environment, the if statement would read: if sensor4 > 100.... However, we use auto thresholding to allow this program to run in any environment. This way, the robot always detects that the light sensor value is 100 greater than the light in the room.
This program was successful, and Kaity and I had a lot of fun waving our hands in front of the sciborg making it chirp.
No comments:
Post a Comment