1. A distributed system based on a publish-subscribe architecture for controlling a robot, comprising: a plurality of publishing modules configured to generate information for sharing with other modules; a first subscribing module configured to generate a first output for performing a first task in the robot including control of effectors of the robot based on the information generated by the plurality of the publishing modules; a second subscribing module configured to generate a second output for performing a second task in the robot based on the information generated by the plurality of the publishing modules; and a message hub separate from the plurality of publishing modules and configured to receive and store the information generated by the plurality of publishing modules, the message hub comprising a plurality of shared memory parts for storing different types of information, the message hub installed with a plurality of filters comprising at least a first filter and a second filter described in a procedural language to implement branching, loop and recursion operations in the first filter and the second filter, the first filter configured to select a first subset of the information matching a first condition for sending to the first subscribing module in one or more first messages identifying the plurality of shared memory parts which store the first subset of the information, the second filter configured to select a second subset of the information matching a second condition for sending to the second subscribing module in one or more second messages identifying the plurality of shared memory parts which store the second subset of the information.