The role of sensory feedback is a central question in understanding vertebrate locomotion. Sensory feedback related to movement of the body and its interaction with the environment is known to have profound effects on the central pattern generator (CPG), the neural circuit responsible for generating the basic locomotor pattern. Conversely, the CPG controls muscle activation, leading to changes in body configurations as it interacts with the environment. We take two approaches to understanding the role of sensory feedback in locomotion: a control-theory approach and a CPG-based approach. In the control theory approach, we have developed a general method of computing the optimal local feedback control law given a model of the plant (the mapping from muscle activation to movement) and a cost rate function that penalizes muscle activation and rewards speed through the environment. The first step in this method is to the compute the optimal steady-state swimming pattern. In the CPG-based approach, we have investigated the role of sensory feedback in a simple closed-loop model in which a CPG produces a pattern of muscle activation which is modified by sensory feedback related to body curvature.