This code manages a robot, which means it decides which tasks should be done, set's the LEDs, collects the information and gets input from the buttons. So for example, this node can abort a task if the batteries are empty and order the robot to come back.
All nodes which execute tasks have to ask, before they start to do something.
This code is licenced under GPL v2. If you have any questions, don't hestitate to ask.