Discover our
resources

Activity: Don't just stand there!

Equipment:

  • 1 robot minimum
  • 1 computer/robot
  • Small arena with obstacles

Settings :

  • Example configuration: "supervised learning".

Duration :

1 hour

Age :

Ages 8 and up

Equipment set-up

Make a 60cm-diameter circle on the tarpaulin with the black tape, doubling the thickness of the circle to 4-5 cm. Place the Thymio robot and 4 or 5 small objects inside the circle. Object characteristics: These objects must be light enough to be moved by Thymio. They can be of any shape, but light in color to reflect the sensors' infrared rays. They should be between 2 and 9 cm wide. Example: cups, Lego elements, small wooden blocks...‍

Objective

No, we're not turning Thymio into a vacuum cleaner! Thymio will simply be in charge of pushing all objects outside the circle, as shown in the figure below:




What Thymio has to do

We're going to teach Thymio what to do using the method we discovered in the previous activity, "Thymio the Fearful", the supervised learning method.Recall that in supervised learning, we looked at the values of his sensors, then told Thymio the action to perform.We had studied only a few important situations. Thanks to the neural network, Thymio had learned what to do in situations it had never encountered before.‍

A first simulation by hand‍

Place a few objects at random inside the black circle, including Thymio. Simulate by hand what the robot has to do to push the objects out of the circle. But be careful, there are a few guidelines to follow. Otherwise our ideas won't be used in the program. Check that the actions you've imagined are actually present in the Actions tab of the Alphai software. The action to be performed will always depend on the sensor values. You'll need to imagine what the sensors are sensing. In particular, for a given sensor state, don't suggest several different actions.
For example, let's say that if the central sensor picks up something, you ask it to move forward: don't later suggest that it turn right if the central sensor picks up something again. Take the robot by hand. The first movement is to move the robot straight ahead for a short distance, 3 or 4 cm. Then push an object out of the circle. You can take the situation described in the previous figure, where Thymio will touch the purple object from the side. Determine the actions to be performed based on the information from the sensors. Once you've analyzed the situation, you can try to reproduce it with Alphai, adding actions if necessary.

‍Gettingorganized

‍Tohelp you remember which action to take, when looking at the status of the sensors, it's handy to use a table. Use the table in Appendix 2 and fill it in as follows: In the first column, indicate what's around or under Thymio. In the sensors columns.

  • if the sensor picks something up, put a cross
  • if he doesn't get anything, put a hyphen
  • if it doesn't matter what it picks up, put a question mark.

In the actions column, enter the correct action. Once you've figured out how to push an object out of the circle, find out how to use the black circle to send Thymio back inside the circle. Then continue the simulation by hand until you've pushed all the objects [1]. Note: to complete the picture, there are several possible solutions [2] and you don't have to use all the lines. Finally, complete the learning process, switch to autonomous mode and watch Thymio push all the objects out of the circle! Final adjustment of actions and possible solutions in appendix 3.

[1] It may be interesting to film the 'cleaning' done by hand with a webcam and view it afterwards so that the group can check whether the robot will really be able to perform all the movements made by hand.

[2] A solution that would consider all possible cases with 7 collectors (5 horizontal and 2 below) would have to study at least 128 different situations!

Reminder to connect Thymio*Appendix and Appendix (solution->Help)

Appendix (solution->Help) 

First tab settings

Sensors tab

Select proximity IR sensors and line-following IR sensors in values.

Actions tab
AI tab

Possible solutions

Only the Actions tab needs to be modified.

10 actions in all.

Caption:

X: something in front

- nothing in sight

Note that the left and right rear sensors are not used at all. To do this, in the Sensors tab, select Proximity IR / sensor selection: front sensors.