Deadline of this assignment is set to: 2016-04-08 20:00:00

1. Task: Hockey and calibration

1. During the weekend March 12th and 13th, several hundreds of robots from all over the World will meet in Vienna to compete at a famous robotics contest RobotChallenge. In one of the categories Puck Collect, the robots will be collecting pucks of their color. Ice hockey championship is approaching slowly, and the hockey players are getting ready... In this round of the Summer league, the robot will acquire a puck and show an offensive hockey attack.



Task: the field with the length of at least 1.2 m and width of at least 80 cm is divided into three parts of similar sizes using black lines (1.5 - 2.5 cm tape). You can mark the borders with a tape of a different color. The robot starts at one end of the field, the goal is located at the other end. It is formed by two columns - you can use a tube with multivitamins for instance. They are placed 15 - 20 cm from each other. The puck is located at an unknown and random location in the central part of the field. You can use a tea candle and paint it as needed.



The robot starts in the direction of the goal, acquires the puck in any way, finds the goal, and scores. The goal is valid when the full body of the puck crosses the goal line in the proper direction. Please show us on your video that the robot is capable of acquiring the puck at an arbitrary location in the central part of the field.

2. Different sensors that we connect to the NXT or EV3 control unit have different nature. For example, the touch sensor is a simple digital sensor, its state can be expressed by a single bit of information: 0 or 1. On the contrary, the ultrasonic sensor is a complex device. It contains a separate microcontroller, which drives the measurement and computation of the distance by generating and detecting the ultrasonic waves. Third, the light sensor is yet another type of sensor: it is an analogue sensor. The cable leading from the sensor to the EV3 brick transmits electric voltage. This voltage will smoothly change depending on the amount of reflected light entering the sensor. The NXT control unit will process this voltage directly inside of its processor, while the EV3 uses an external chip (an analogue to digital converter). In both cases though, this analogue voltage signal in the range 0-5 Volts is converted to a 10-bit integer value (i.e. a number between 0 and 1023). However, when programming, the sensor reading appears in the range 0-100. This is because part of the original range 0-1023 is "cut-out" into the resulting normalized range 0-100. We are allowed to modify this normalization function if we want - using the process called [analogue] sensor calibration. NXT-G provides a separete "Calibrate" block for this purpose. EV3 uses the usual sensor block in a separate calibration mode:



In both cases, we can inform the software, which "dark" value should correspond to a new value 0 and which "bright" value should correspond to value 100. Remaining shades will be represented by some number between 0 and 100.
Tasks:
- Build a robot with a light sensor (use the color sensor in light sensor mode in case of EV3). The sensor should measure the intensity of the reflected light from the floor. Calibrate the sensor so that the black tape will give 0 and bright floor will give 100. Verify that the sensor works as expected.
- Try to show that the sensor measures have higher precision after calibration than before it was calibrated. For example, try to reliably distinguish among 5-10 different shades.
- When one sensor is calibrated, all sensors on all ports are calibrated in the same way. However, this is not always what we need. Some sensors can be mounted in a different way so that they report different values for the same color. Can you solve this problem? Install a second sensor so that it will report different values in the same situation. Develop your own sensor calibration method, which will store the sensor calibration in the brick, so that the calibration does not have to be performed again each time after the program is started. It should also support calibration of different sensors with different calibration values. Verify and document your results.

As usual, you can solve task 1, or task 2. If you like, you can solve both, but you will only get points from one of the tasks (the better solution counts). We are looking forward to your solutions! Remember to upload the picture of your robot, your team, link to an unlisted YouTube video, program, and add a short description.

Solutions