How to use Fusion’s Optical Distance Sensor. FB7a

Japan has a sport called SUMO in which each person attempts to push the other out of an arena. We would not have much chance of competing! But we can have fun with a robot version of SUMO. To play SUMO, it is good if another Robot is available – but you can get the same satisfaction by pushing out a toy from the SUMO arena. To enable our robot to play SUMO, we need to be able to teach our Fusion Robot how to know when it has reached the edge of the SUMO arena. The downloadable arena we used has a white center with black borders, as shown below. To detect the black line that surrounds the arena, we need to find out how to use Fusion’s Optical Distance sensor. The video below demonstrates the use of Fusion’s Optical Distance Sensor to detect whether the Sensor (and the hence the robot) is in the white center of the SUMO rink, or if it has found the black edge of that rink. The difference in sensor readings obtained from the Optical Distance Sensor when it is over the white area, and when it is over the black area of the rink, can later be used to teach Fusion how to stay inside the SUMO rink.
If you have access to an A1 printer, a printable arena we use for Robot SUMO can be downloaded by clicking here. Update: In the latest version of the Fusion Blockly software, the “Example” program used in this video has been moved to the menu location: Help/Examples/Intermediate/OpticalDistanceSensor/odsRead.blk