Purpose of reviewIn recent years, legged robots locomotion has been transitioning from mostly flat ground in controlled settings to generic indoor and outdoor environments, approaching now real industrial scenarios. This paper aims at documenting some of the key progress made in legged locomotion control that enabled this transition.Recent findingsLegged locomotion control makes extensive use of numerical trajectory optimization and its online implementation, model predictive control. A key progress has been how this optimization is handled, with refined models and refined numerical methods. This led the legged locomotion research community to heavily invest in and contribute to the development of new optimization methods and efficient numerical software.SummaryWe present an overview of the typical approach to legged locomotion control, which involves primarily planning a sequence of contacts with the environment and computing a corresponding dynamically feasible trajectory of the Center of Mass of the robot. We then detail recent progress in contact planning and trajectory optimization with either the full Lagrangian dynamics of legged robots or with reduced models.