The concept of a modular climbing caterpillar robot is inspired by the kinematics of real caterpillars. Two typical kinematics models and gaits are investigated based on the crawling motion of the inchworm and the tobacco hornworm. Due to the fixed constraints between the suckers and the wall, the gait of a caterpillar robot engages a changing kinematic chain which is from an open chain to a closed chain, and then to an open chain in order. During the open chain periods, an unsymmetrical phase method (UPM) is used to ensure the reliable attachment of the passive suckers to the wall. In the closed-chain state, a four-link kinematics model is adopted to fulfill the fixed constraints. By combining the two methods together, the complete joint control trajectories are acquired for a modular caterpillar robot with seven joints. At last, on-site tests confirm the proposed principles and the validity of the climbing gait.