Many organisms move using traveling waves of body undulation, and most work has focused on single-plane undulations in fluids. Less attention has been paid to multiplane undulations, which are particularly important in terrestrial environments where vertical undulations can regulate substrate contact. A seemingly complex mode of snake locomotion, sidewinding, can be described by the superposition of two waves: horizontal and vertical body waves with a phase difference of ±90°. We demonstrate that the high maneuverability displayed by sidewinder rattlesnakes (Crotalus cerastes) emerges from the animal's ability to independently modulate these waves. Sidewinder rattlesnakes used two distinct turning methods, which we term differential turning (26°change in orientation per wave cycle) and reversal turning (89°). Observations of the snakes suggested that during differential turning the animals imposed an amplitude modulation in the horizontal wave whereas in reversal turning they shifted the phase of the vertical wave by 180°. We tested these mechanisms using a multimodule snake robot as a physical model, successfully generating differential and reversal turning with performance comparable to that of the organisms. Further manipulations of the two-wave system revealed a third turning mode, frequency turning, not observed in biological snakes, which produced large (127°) in-place turns. The two-wave system thus functions as a template (a targeted motor pattern) that enables complex behaviors in a high-degree-offreedom system to emerge from relatively simple modulations to a basic pattern. Our study reveals the utility of templates in understanding the control of biological movement as well as in developing control schemes for limbless robots.sidewinder | biomechanics | robotics | template | control P ropagating waves of flexion along the axis of a long, slender body (henceforth "axial waves") to produce propulsion is common in biological locomotion in aquatic and terrestrial environments. The majority of biological studies of axial wave propulsion at different scales have occurred in aquatic environments (1, 2). Understanding the efficacy of given wave patternswhich are often assumed to act in a single plane (e.g., mediolateral axial bending)-can be gained through full solution of the equations of hydrodynamics (3) or approximations (4). Terrestrial environments such as sand, mud, and cluttered heterogeneous substrates encountered by limbless axial undulators such as snakes can display similar (if not greater) complexity, yet far less attention has been paid to such locomotion (5, 6).Snake axial propulsion in terrestrial environments differs from fluid locomotion in two key ways. First, most substrates are not yet described at the level of fluids (7), making it a challenge to understand how substrate-body interactions affect locomotor performance, and therefore requiring robotic physical models. Second, the body may be both laterally and/or dorsoventrally flexed (5) to allow different elements of the body to contact ...