Motion Control for Legged Robot Using Model Predictive Control