Text this: Optimal Foot Trajectory Planning of Bipedal Robots Based on a Measure of Falling