...
The on_robot_event()
method will print all incoming events, which are: LanguageChanged
, TextStarted
, and TextDone
. If you, for example, touch the robots head sensors (while to program is running) the events FrontTactilTouched
, MiddleTactilTouched
, and/or ReadTactilTouched
RearTactilTouched
will also be printed.
The sleep statements avoid the program to stop before all the events are generated. See what happens when you remove the sleep statements. Most of the time you do not know how long you have to wait for an action to finish. Therefore, sleep statements are not the way to go. Ideally, you want the robot to wait until it has received the necessary data and select it’s next action based on the available data.
...