Effective motion planning and localization are necessary tasks for swarm robotic systems to maintain a desired formation while maneuvering. Herein, we present an inchworm-inspired strategy that addresses both these tasks concurrently using anchor robots. The proposed strategy is novel as, by dynamically and optimally selecting the anchor robots, it allows the swarm to maximize its localization performance while also considering secondary objectives, such as the swarm’s speed. A complementary novel method for swarm localization, that fuses inter-robot proximity measurements and motion commands, is also presented. Numerous simulated and physical experiments are included to illustrate our contributions.