This paper presents a theoretical study of decentralized control for sensing-based shape formation on modular multirobot systems, where the desired shape is specified in terms of local sensor constraints between neighboring robot agents. We show that this problem can be formulated more generally as distributed constraint-maintenance on a networked multiagent system. It is strongly related to a class of multi-agent algorithms called distributed consensus, which includes several bio-inspired algorithms such as flocking and firefly synchronization. By exploiting this connection, we can theoretically analyze several important aspects of the decentralized shape formation algorithm and generalize it to more complex multi-agent scenarios. We show that the convergence time depends on (a) the number of robot agents and agent connection topology, (b) the complexity of the userspecified goal, and (c) the initial state of the robots. Using these results, we can provide precise statements on how t...