Controlling the execution of the behavior

The possibility to freeze, stop or block commands in URBI is a very powerful tool to control the execution of a behavior. For example, if the transitions which are expressed with a at command are prefixed by a tag, like this:

track_transition:
     at (ball.visible ~ 100ms) {
        stop search;
        speaker = found;
        track: tracking();
     };

search_transiton:
     at (!ball.visible ~ 100ms) {
        stop track;
        speaker = lost;
        search: searching();
     };

It becomes very easy to temporarily suspend or reactivate a transition by commands like:

freeze track_transition;
...
unfreeze track_transition;

Also, it is possible to block the execution of a state, but still accept transitions to this state (waiting silently for another transition to make the robot move to another state):

block search;
...
unblock search;

Using freeze, block and stop, it is simple to modify behaviors or reassign priorities online during the execution of a program, which is a very useful feature for robotics. The possibilities are numerous, since the behavior tuning can be controlled by events or other programs running in parallel, or even by a controlling remote program or a user over a telnet session.