Abstract-While legged animals are adept at traversing rough landscapes, it remains a very challenging task for a legged robot to negotiate unknown terrain. Control systems for legged robots are plagued by dynamic constraints from underactuation, actuator power limits, and frictional ground contact; rather than relying purely on disturbance rejection, considerable advantage can be obtained by planning nominal trajectories which are more easily stabilized. In this paper, we present an approach for designing nominal periodic trajectories for legged robots that maximize a measure of robustness against uncertainty in the geometry of the terrain. We propose a direct collocation method which solves simultaneously for a nominal periodic control input, for many possible one-step solution trajectories (using ground profiles drawn from a distribution over terrain), and for the periodic solution to a jump Riccati equation which provides an expected infinite-horizon cost-to-go for each of these samples. We demonstrate that this trajectory optimization scheme can recover the known deadbeat openloop control solution for the Spring Loaded Inverted Pendulum (SLIP) on unknown terrain. Moreover, we demonstrate that it generalizes to other models like the bipedal compass gait walker, resulting in a dramatic increase in the number of steps taken over moderate terrain when compared against a limit cycle optimized for efficiency only.