Abstract-In this paper, a distributed collective movement control method is proposed for a swarm robotics system based on an internal energy thermodynamic model. The system can move between obstacles with a changing aggregation suitable for confronting obstacle arrangements in an environment. The swarm robot shape is a fixed aggregation formed by virtual attraction and repulsion forces based on the proposed method. It follows a leader agent while retaining its shape. When the swarm robot aggregation shape cannot be maintained during movement though narrow spaces with obstacles, the swarm robot flexibly changes shape according to that of the local environment. To this end, it employs virtual thermal motion, which is made possible with directives and enables continuous movement. A simulation confirmed the capability of the proposed method in enabling the solidity and flexibility collective movement of swarm robots. The results furthermore showed that the parameter setting range is important for applying the proposed method to collective movement.