We present a distributed controller for the center of mass
of a modular robot. This is useful for locomotion of a
modular robot over uneven and unknown terrain. By
controlling the center of mass, a robot can prevent itself
from falling over. We present a distributed and
decentralized algorithm that computes the mass properties
of the robot. Additionally, each module also computes the
mass properties of the modules that are directly or
indirectly connected to each of its connectors. With this
information, each module can independently steer the center
of mass towards a desired position by adjusting its joint
positions. We present simulation results that show the
feasibility of the approach.