For a self-reconfigurable robot, how to metamorphose to adapt itself to environment is a difficult problem. To solve this problem, a new relative orientation model which describes modules and their surrounding grids was given, a module motion rules database which enables the robot to avoid obstacles was established, and finally a three-layer planner based on dynamic meta-modules was developed. The firstlayer planner designates the category of each module in robot by evaluation functions and picks out the modules in dynamic meta-modules. The second-layer planner plans the dynamic meta-module path according to output parameters of the first-layer planner. The third-layer planner plans the motion of the modules in dynamic meta-module using topology variation oriented methods. To validate the efficiency of the three-layer planner, two simulations were given. One is the simulation of a single dynamic meta-module, the other is the simulation of planning with an initial configuration composed of 8 modules in complicated environment. Results show that the methods can make robot with any initial configuration move through metamorphosis in complicated environment efficiently.