Gait Synthesis and Resilient Task Planning for Ambulating Soft Robots