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 based on the information generated by the plurality of the publishing models; 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 models; and a message hub configured to receive and store the information generated by the plurality of publishing modules, the message hub comprising filters configured to select a first subset of the information matching a first condition and a second subset of the information matching a second condition, the first condition and the second condition described in a procedural language, the message hub configured to send the first subset of the information to the first subscribing module and the second subset of the information to the second subscribing module.