Today’s lesson unites tasks from the fish-lesson and the scorpion-lesson. The lesson is more like a revision so feel free to let students struggle on their own with the tasks.
Use some tape or something more creative to mark the kiwi’s den for your field today. Use a ball, or something else, for food. The size of the ball is not that important as kiwi eat virtually anything (as kiwi are omnivorous) :).
The task consists of two parts: going to someone’s hand and back to the den and checking whether the robot has caught the ball (food).
In the first task the robot starts moving forward until it reaches a student’s hand thanks to the ultrasonic sensor and then stops. It is reasonable to set the ultrasonic sensor at a value of 10 cm. After the robot reaches the student’s hand, it should open its beak (the degrees for the medium motor should be preset). The value of the degrees is found in the previous task – about 180 degrees. Then, the robot waits for 1 second so that the student has time to put the “food” into the kiwi’s beak. As we don’t know in advance how big the food is, we cannot set the degrees for the medium motor which is why we program the robot to move for 1 second. In the next tasks we will add a check for whether the robot has managed to take any food with its beak. Finally, the robot goes backwards using the wait block, until the value of the rotation sensor of one or both motors is less or equal to 0, which is analogous to the fish task from Lesson 2. Just like in the previous lessons, be careful with the port you set for the wait block as its default setting is for the motor driving the beak!
The second task comes as an improvement of the first one. You should repeat the measurements you made in the previous lesson. The expected degrees are 0. If the kiwi has taken any food with its beak, the degrees will be more than 0. That is why we should add a switch block after closing the beak. During this block we will check whether the degrees of the medium motor are more than 0. If yes, then the kiwi has managed to take some food and it should go back to its den. If not, then the kiwi has not managed to take any food and it should try again. In order to be able to check the result after the second open-and-close of the beak, you should put the switch block in a loop. As a result the kiwi will keep opening and closing its beak and will return to its den only when it catches food.
You can find programs for the robot here: https://www.fllcasts.com/programs/acvhyl-program-for-the-ev3-kiwi-bird-robot-lintu
If the beaks brake, tell your students to lower the power as kiwi are not very strong, although they eat meat as well.