DeepGait: Planning and Control of Quadrupedal Gaits using Deep Reinforcement Learning

DeepGait: Planning and Control of Quadrupedal Gaits using Deep Reinforcement Learning


This paper addresses the problem of legged locomotion in non-flat terrain. As legged robots such as quadrupeds are to be deployed in terrains with geometries which are difficult to model and predict, the need arises to equip them with the capability to generalize well to unforeseen situations. In this work, we propose a novel technique for training neural-network policies for terrain-aware locomotion, which combines state-of-the-art methods for model-based motion planning and reinforcement learning. Our approach is centered on formulating Markov decision processes using the evaluation of dynamic feasibility criteria in place of physical simulation. We thus employ policy-gradient methods to independently train policies which respectively plan and execute foothold and base motions in 3D environments using both proprioceptive and exteroceptive measurements. We apply our method within a challenging suite of simulated terrain scenarios which contain features such as narrow bridges, gaps and stepping-stones, and train policies which succeed in locomoting effectively in all cases.

Legged Robots; Deep Learning in Robotics and Automation; Motion and Path Planning

I Introduction

Fig. 1: The suite of terrains: the baseline Flat-World scenario (left), the Random-Stairs scenario (bottom center), and composite Temple-Ascent (right) scenario comprising a set of winding stairs and two derelict bridges containing stepping-stones and gaps of varying size.

Legged locomotion in non-flat terrain, both structured and unstructured, poses a significant challenge in robotics. Operating autonomously in such environments requires addressing the problem of multi-contact motion planning and control. If a legged robot such as ANYmal [hutter2016anymal] is to traverse complex environments autonomously, it must possess the capability to select footholds appropriate for the terrain, while also retaining balance at all times. This work deals specifically with the problem of planning and executing sequences of footholds for quadrupedal locomotion in rigid non-flat terrain using proprioceptive and exteroceptive sensing.

Dynamically walking on non-flat terrain necessitates the optimization of continuous state-input trajectories such as the motion of the base, as well as discrete decision variables such as which surface, and when, to make contact with. This has been addressed predominantly using model-based approaches, such as those employing deterministic optimization techniques [kuindersma2016optimization, winkler2018gait], in conjunction with other heuristics [fankhauser2018robust], to plan motions for both the base and feet. Although some of the aforementioned approaches are able to solve such problems compromising both continuous and discrete variables [kuindersma2016optimization, winkler2018gait], these remain too computationally intensive to be executed online. Thus, only kinostatic approaches [doi:10.1002/rob.21610, fankhauser2018robust] have managed to perform online foothold planning. Also, most methods typically employ some form of parameterization or qualification of the terrain [Kalakrishnan:2011:LPC:1936801.1936805, fankhauser2018robust, tonneau2018reachability] in order to simplify the search for viable footholds.

One of the primary challenges in multi-contact planning for multi-legged systems lies in dealing with the combinatorial problem due to the vast number of contact configurations admissible for the terrain. Typical solutions involve either assuming the gait pattern [doi:10.1002/rob.21610, fankhauser2018robust] or employing sampling-based search techniques [tonneau2018efficient, tonneau2018reachability]. There also exist works that have combined both optimization and sampling-based methods [Kalakrishnan:2011:LPC:1936801.1936805, doi:10.1002/rob.21610, griffin2019footstep]. However, these typically resort to decoupling the selection of footholds from the optimization of base motions and thus remain kinostatic as they tend to neglect the dynamics of the system.

Some works have also incorporated machine-learning techniques for facilitating terrain perception [Kalakrishnan:2011:LPC:1936801.1936805, magana2019fast, klamt2019towards]. Others, have employed Deep Reinforcement Learning (DRL) [heess2017emergence, Peng:2017:DDL:3072959.3073602] for realizing end-to-end terrain-aware locomotion. The use of the latter, however, still poses several challenges, namely: (1) how to eliminate undesirable yet retain beneficial emergent behavior, and (2) reduce overall sample complexity and train policies efficiently.

We propose a new method that combines state-of-the-art model-based and model-free methods to enable quadrupedal systems to traverse complex non-flat terrain. Our formulation consists of: (1) a terrain-aware planner that generates sequences of footholds and base motions that direct the robot towards a target heading, and (2) a foothold and base motion controller which executes the aforementioned sequence while maintaining balance and dealing with disturbances. Both planner and controller are realized as stochastic policies parameterized using Neural-Network (NN) function approximation, which are optimized using state-of-the-art Deep Reinforcement Learning (DRL) algorithms.

Our contributions with this work are: (1) A novel method for training kinodynamic motion planners, which employs a Trajectory Optimization (TO) technique for determining so-called transition feasibility between discrete support phases using a coarse model of the robot. This removes the need for a planner to interact with both physics and a controller during training, allows the two policies to be trained independently, and leads to a significant reduction in overall sample complexity. (2) A simple formulation for realizing dynamic walking controllers that use target footholds as references and rely solely on proprioceptive sensing. This allows us to train controllers that can fully exploit the kinematics and dynamics of the robot in order to track arbitrary target footholds, irrespective of the planner used to generate them.

We evaluate the performance of our method across a set of challenging locomotion scenarios using a physics simulator and present results thereof. Our experiments demonstrate that the planner can generalize well across terrain types, and the controller succeeds in tracking reference footholds while always balancing the robot. Moreover, we illustrate the advantages of our method by comparing it with a state-of-the-art model-based approach [fankhauser2018robust].

Ii Preliminaries

Ii-a Reinforcement Learning

We consider the problem of sequential decision making in which an agent interacts with an environment with the objective of maximizing cumulative reward. We model this problem as a discrete-time infinite Markov Decision Processes (MDP) with a discounted expected return objective. Such an MDP consists of set of states , a set of actions , a transition dynamics distribution, an initial state distribution, a scalar reward function , and a scalar discount factor . The agent selects actions according to a policy with the objective of maximizing the expected return , where is the scalar reward resulting from the state transition at time-step . As we consider infinite MDPs in which and are infinite sets, we use parameterized stochastic policies , which are distributions over actions conditioned on observations given parameter vectors .

Ii-B Model of the System

The robot comprises an unactuated floating base and four articulated legs with actuated rotational joints. The state of the robot is specified as: the absolute1 position of the base, is the rotation matrix representing the absolute attitude of the base, are the absolute linear and angular velocities of the base, are the angular positions and velocities of the joints. The robot is controlled using joint torques . Moreover, we assume that we can extract robocentric measurements of local terrain elevation via the mapping with a resolution of . In order to reason precisely about gaits and transitions between contact supports, we define a parameterization thereof that encompasses all necessary information. We thus parameterize a gait as a sequence of so-called support phases. Each phase is defined by the tuple


where is a vector indicating for each of the feet a closed, , or open, , contact w.r.t the terrain, are the stacked absolute positions of the feet, and are the phase timing variables. For every phase , defines the time at which the switch to the current contact configuration occurred, while the switch to next. Fig. 2 (b) illustrates the aforementioned quantities.

Iii Methodology

(a) (b)
Fig. 2: (a) Overview of the proposed control structure used at deployment time. (b) Phases within a sequence are indexed using , and every index corresponds to a point in time centered around a window defined by the durations and . The center of the window is defined by the motion of the base as captured by the phase . defines the time-to-switch from the current contact support to the next, specified in , and defines the time elapsed since the switch from the previous contact support, specified in , to the current.

We propose a two-level hierarchy comprising a high-level Gait Planner (GP) and a low-level Gait Controller (GC) operating at different time-scales, inspired by [Peng:2017:DDL:3072959.3073602]. The GP, evaluated at roughly 2Hz, serves as a local terrain-aware planner, and uses both exteroceptive and proprioceptive measurements to generate a finite sequence of support phases, i.e. a phase plan. The GC, evaluated at 100Hz, serves as a hybrid motion planner and controller, and uses only proprioceptive sensing in combination with the aforementioned phase plan to output joint position references. Finally, a joint-space PD controller (with zero target joint velocity) uses these joint position references to compute joint torques at 400Hz. The highest-level command to the system is provided as the desired walking direction in the form of the deviation of base attitude w.r.t the goal. Fig. 2(a) provides an overview of the system.

Iii-a Gait Planning

The GP operates by sequentially querying the planning policy to generate the aforementioned phase plan. We thus formulate an MDP in order to train using DRL, and our objective is to ensure that the resulting policy learns to respect the kinodynamic properties and limits of the robot, as well as contact constraints, when proposing phase transitions. Moreover, we aim to avoid direct interaction with the physics of the system, and instead craft the transition dynamics of the MDP by employing a transition feasibility criterion realized as a Linear Program (LP) using the framework defined in [fernbach2019ccroc]. Lastly, we avoid explicitly modeling or qualifying the terrain, as done in [fankhauser2018robust, tonneau2018efficient], and instead directly use measurements of local terrain elevation. The resulting MDP, allows us to train to infer a distribution over phase transitions, which are not only feasible but also maximize locomotion performance (refer to the discussion in Sec. V).

Support Phase Transition Feasibility

Transition feasibility amounts to evaluating if a feasible motion exists between a pair of support phases , where the former is assumed while the latter is a candidate successor. As previously mentioned, we employ the general framework defined in [fernbach2019ccroc] to design a convex LP using the Convex Resolution Of Centroidal dynamics trajectories (CROC) formulation. We use CROC to derive a set of linear equality and inequality constraints, forming a convex polytope, using the following terms:

  1. A Centroidal Dynamics model of the system.

  2. The contact force unilateral and friction constraints.

  3. Assume angular momentum rate of zero.

  4. Parameterization of CoM motion as a Bezier curve.

  5. Restrict motion of the feet w.r.t. the base.

  6. Restrict contact forces in magnitude and direction.

The specific variant of CROC we employ uses a trivial cost, a time-discretization of the CoM trajectory, and incorporates the parameterization of the contact forces into the decision variables of the optimization. We defer the reader to [fernbach2019ccroc] for further details regarding CROC. The resulting formulation allows us to realize the transition feasibility mapping . Therefore, we evaluate the LP for pairs of phases , to determine if the corresponding phase transition is feasible, 1, or not, 0.

MDP Specification

Modeling locomotion as discrete sequences of support phases , as defined in Sec. II-B, allows us to formulate phase transitions that exhibit the Markov property [Sutton:2018], and thus lends itself to modeling the overall problem of gait planning as an MDP. Specifically, we define the state of the MDP as the tuple , where is the current absolute position of the goal in the world, while observations and actions are defined as the tuples and , respectively. Observations, consist of terms pertaining to the current state of the robot and the coincident terrain in the form of: the attitude w.r.t the goal , the CoM velocity , the feet positions , the feet contact states and the local height-map . Conversely, actions, contain terms pertaining to changes to the current phase , in the form of the CoM rotation , CoM translation , CoM velocity , feet positions , feet contact states and the phase timings . All action terms are scaled, offset and clipped to lie in . The exact definitions for actions and observations are provided in Tab. I.

GP Observation GP Action
TABLE I: Transformations used to form from phases and phase transitions from : the matrix defines a rotation about the world’s z-axis by angle , and decodes a 3-digit binary encoding into a vector of contact states.

Transition Dynamics

We define state transition dynamics for this MDP employing a formalism defining so-called termination condition functions , which determine if an episode terminates. By formulating an episode termination as a transition into an absorbing terminal state, we can say that, an episode under this MDP, terminates whenever . In this MDP, in particular, we employ the following termination conditions:

  1. : Checks for obstacles or gaps within the vicinity of each foothold using an fixed eight-point grid surrounding each foot.

  2. : Checks for collisions between base and terrain.

  3. : Evaluates .

Thus, each step of this MDP proceeds as follows: (1) Given a state , the MDP computes the corresponding observation , which is constructed according to the transformations in Tab. I, and is passed to the agent to select an appropriate action according to . (2) The selected action , is used to compute the candidate phase , again using the set of transformations defined in Tab. I. (3) The aforementioned terminations conditions are used to assert if the phase transition is feasible. This formulation therefore allows the agent to propose the phase transition directly, while the MDP only checks if it is feasible and otherwise terminate the episode.

In addition, we outline certain considerations regarding the computation of . First, if a foot would be in contact for both phases and , the new foothold is reset to that of since stance feet cannot change positions. Second, the z-coordinates of the feet and CoM positions are adjusted according to the height of the terrain at their respective locations, and for the CoM in particular, the height is set to a constant above the lowest foothold. Lastly, to evaluate the kinematic constraints of CROC, we need to infer the intermediate orientations. To this end, we use a first-order approximation of the angular velocity of the base by linearly interpolating between the starting and next base attitudes of each transition. Doing so also renders zero angular momentum between consecutive support phases, which is inline with assumptions made by CROC. One can thus envision an extension to CROC that includes angular momentum, which we intend to explore in future work.

Reward Function

We design a reward function which drives the agent to learn behaviors for reaching the goal position, facing the goal as much as possible, minimizing kinematic effort during phase transitions and inhibiting long stance phases. The final reward function is specified as the combination of multiplicative and additive terms


where rewards the agent for bringing the average foothold position closer towards the goal and penalizes moving it away, penalizes the robot for not facing the goal, penalizes for moving the feet away from the nominal footholds located beneath the shoulders and penalizes for not lifting a foot over multiple steps, therefore promoting exploration and prevents the policy from getting stuck in the local optimum of remaining in a constant stance.

Furthermore, we would like to emphasize certain features of the multiplicative term in the above reward function. Specifically, this term results in a penalty that is small when is small, i.e., beginning of training, and large when is large, i.e., towards the end of training, thus resulting in a form of automatic scaling of the overall multiplicative term. We found that using these multiplicative rewards results in beneficial gradients throughout all iterations of training, as their values are ensured never to be too large as to hinder exploration, and never too small as to have negligible effect. Furthermore, as is computed using the average position of footholds and not of the base, the agent is required to walk in order to maximize reward, as opposed to just merely leaning. The latter aspect is important, since leaning forward also inhibits the motion of the front legs, therefore making it much harder to walk. Tab. II details the aforementioned reward terms.

Policy Definition

We parameterize the GP’s policy as a Gaussian distribution with a diagonal covariance matrix . The mean is output by a NN which inputs both exteroceptive and proprioceptive measurements into a series of NN layers, similar to those proposed in [Peng:2017:DDL:3072959.3073602]. First, is input into three CNN layers, the output of which is subsequently input into one more fully-connected layer. The resulting latent output from the height-map is concatenated with the raw proprioceptive measurements, then fed into two more fully-connected layers with ReLU and tanh nonlinearities, and finally passed through a linear output layer. The standard-deviation parameters are realized by an additional layer that is independent of the observations and is used to drive exploration during training. Fig. 3(a) provides a graphical depiction of the NN model. Due to the inclusion of high-dimensional height-map data in the observations as well as the relatively large dimensionality of the actions , we trained with a variant of Proximal Policy Optimization (PPO) using clipped loss and a Generalized Advantage Estimation (GAE) critic [schulman2017proximal].

Fig. 3: The neural-network models used for the latent parameters of policy distributions of the (a) GP and (b) GC, respectively.

Iii-B Gait Control

The GC is responsible for executing the support phase sequence provided by the GP while maintaining balance at all times. It operates by tracking a series of footholds and base positions extracted from the support phase sequence generated by the GP. In order to learn this behavior, we define an MDP with transition dynamics which incorporates the physics of the system and specify an appropriate parameterization for . Training a GC agent in such an MDP requires only that a target phase sequence be provided, and does not assume that a GP is available a priori. In fact, the target phase sequence can be provided arbitrarily as long as the target footholds are feasible. However, in this work, we elected to utilize a GP for this purpose solely as a matter of convenience so to avoid the use of additional elements.

Target Foothold Extraction

Assuming the GP is queried at some time , we denote the resulting phase sequence as , where is the initial phase as measured by the GP before generating the sequence of length . This amounts to rolling-out2 the planning policy by recursively evaluating using its own output.

MDP Definition

Given a phase sequence , the GC proceeds to extract the following target quantities: (a) target position for the base , (b) target feet contact states , and (c) target foothold positions for all legs. In the case of , targets are set by looking ahead into the phase plan so to ensure that both swing and stance legs have valid references at all times. Thus, the GC computes the foothold tracking errors , at 100Hz, while the target footholds are updated at approximately 2Hz. We specify MDP states , observations and actions defined as


where is the gravity-aligned z-axis of frame expressed in coordinates of frame , is the distance between the lowest stance foot and the base along the z-axis of , is the vector of previous target joint positions, and is a phase variable indicating the normalized time within a support phase. The transition dynamics of this MDP includes the generation of the phase plan using the GP, the physics of the system and the joint-space PD controller. As the PD controller is evaluated at 400Hz and the GC at 100Hz, we apply a zero-order hold of the joint positions output by the policy when computing joint torques commands. For this MDP, we also define the following termination conditions:

  1. : Angle between and exceeds .

  2. : Base collides with the terrain.

We have found that these two simple, yet effective, termination conditions are those principally responsible for the balancing and recovery behaviors learned during training, and thus their importance must not be understated. Moreover, we designed a reward function that emphasizes tracking of target foothold positions and contact states, but also contains terms that inhibit extraneous and aggressive motions during locomotion. The resulting reward function is defined as


where and are the task-specific rewards penalizing deviations from the target foothold positions and contact states, penalizes foot-slip for grounded feet, penalizes large velocities for swing legs, penalizes joint torques, penalizes vertical linear and roll-pitch angular velocities of the base and penalizes large angles between the unit vectors and of the base and world frame respectively.

Policy Definition

The GC’s policy, like that of the GP, is also parameterized as a Gaussian distribution with diagonal covariance matrix . While the mean is output by a simple NN with two fully-connected layers using non-linearities, shown in Fig. 3 (b), the standard deviation coefficients are, just as in the case of the GP, output by an additional layer of parameters which is independent of . Due to the relatively small dimensionality of the MDP and , we train the latter using Trust-Region Policy Optimization (TRPO) also employing a GAE critic [schulman2015high].

Gait Planner Rewards Gait Controller Rewards
TABLE II: The GP and GC reward terms. The subscript indexes each foot, and counts the current number of consecutive state updates for which foot has remained grounded. is a binary variable specifying whether a foot is within a cylinder of radius of target foothold. An over-lined letter describes the conjugate of the binary variable, e.g. . The weighting factors are: , , , , , , , , , .

Iv Results

Iv-a Experimental Setup

In order to evaluate our approach, we crafted a suit of terrain scenarios for training and testing the GC and GP agents, as depicted in Fig. 1. The first and most basic scenario consists of an infinite flat plane we refer to as Flat-World, which we use to establish a baseline for performance and behavior. Secondly, the Random-Stairs terrain presents a square area consisting of flat regions of randomly selected elevation. The elevation changes were generated in a way that results in an effective inclination diagonally across the map. The third terrain scenario is that which we call Temple-Ascent, and is a composite terrain consisting of gaps, stepping stones, stairs as well as flat regions. We realized the MDP environment for the GP using an own implementation of CROC in C++, while for the MDP environment of the GC we used the RaiSim [raisim] multi-body physics engine. All DRL algorithms were implemented using the TensorFlow3 C/C++ API4.

Iv-B Gait Planner

Training Setup

Training of GP policies in the terrain suite consists of a set of episodes where the robot’s objective is to reach a a goal position from a sufficiently distant starting location. Both starting and goal positions are selected randomly at the start of each episode. However, this procedure differs depending on the features of the terrain, as we must avoid invalid starting positions and unreachable goal positions, which, would negatively impact the resulting policies during training. Once valid starting and goal positions have been sampled, the robot’s initial attitude and footholds are also sampled uniformly from within respective bounds.

We thus trained two separate GP policies for Random-Stairs and Temple-Ascent respectively, using PPO with only parallel workers running on the respective desktop computer over iterations, which amounts to a total of two billion samples per run. Hyper-parameter values are listed in Tab. IV. We did not need to train a separate GP in Flat-World, and instead used that trained in Temple-Ascent for the respective performance evaluations.

Performance Metrics

In order to assess the performance of GP policies, we define the Episodic Success Rate (ESR), which measures the number of successfully reached goal positions over a finite number of episodes. Essentially, we execute a sufficiently large number of episodes where the robot tracks a reference goal position in the world and assert if the robot has reached within a vicinity of the goal and within a maximum permissible episode duration.

Training Results

GP training required approximately hours in each terrain scenario. Throughout our experiments we found that the randomization scheme mentioned above and used for realizing the initial state distribution of the MDP was crucial for successfully learning to traverse all parts of the terrains. This demonstrates that if the agent does not observe all aspects of the terrain from the very beginning of training, it is often unable to generalize to unseen cases at test time.

Furthermore, we observed that, as the centroidal dynamics model employed by CROC is relatively conservative, it tends to limit the set of transitions that the policy can generate. This conservativeness is furthered by the fact that in this work, we limit the possible contact states that the GP’s policy can output to only those with three and four active contacts. Such a restriction was helpful for reducing the complexity of the problem, and we intend to extend to the general case of two and single contact configurations in future work.

We tested the GP policies in their respective terrain scenarios and evaluated their performance using the ESR metric. In all cases, we have observed that fully trained policies can generate valid support phase sequences which lead the robot to the goal with at an average ESR nearing . The performance of GP policies trained and tested in the terrain suite are presented in Tab. IV, where they have been deployed together with respective GC policies.

Another important observation regarding the output of the GP has to do with the types of gaits it manifests. In the case of Flat-World as well as in the flat regions of Temple-Ascent, we observe that the GP tends to output mostly cyclic support phases. This indicates that the agent learns to generate cyclic gaits even though no aspect of the MDP ever directed it to do so. In certain cases, however, such as the Stepping-Stones and Gaps bridges as well as when performing sharp point-turns, the GP outputs acyclic support phases.

Sample Complexity

One key contribution of this work is the significant reduction in sample complexity afforded by the use of transition feasibility instead of physical simulation to formulate the GP’s MDP. Using the transition feasibility check, we can evaluate the MDP’s transition dynamics at several thousands of steps-per-second, where each step corresponds to potentially several seconds of simulation time. Conversely, using a physics simulator typically requires several hundred or even thousands of steps to evaluate just one second of simulation time. Specifically, during training, we executed episodes with a maximum length of steps with each corresponding to an average duration of approximately , which amounts to of simulation time. However, the physics simulator using a time-step of would require steps to simulate the duration above. As the throughput of the transition feasibility LP and the physics simulator, for our formulation, is and respectively, we can estimate an -fold effective reduction in sample-complexity.

Iv-C Gait Controller

System Metric Flat Gaps Stepping-Stones Stairs
Nominal ESR
TABLE IV: Policy optimization algorithm hyper-parameters for the GC using TRPO and the GP using PPO (see [schulman2015trust, schulman2017proximal] for details).
Parameter Symbol TRPO PPO
Batch Size 24k 200k
Mini-Batches - 5
Max. Episode Length
Discount Factor 0.995 0.99
Trace Decay 0.99 0.97
Terminal Reward
KL Constraint 0.01 -
Clip - 0.2
Entropy Weight
Initial Variance
Adam Epochs -
Adam Learning-Rate -
Gradient Clipping -
CG Damping 0.1 -
CG Steps 40 -
TABLE III: Performance of the GC on the different terrain scenarios in Temple-Ascent, and under different kinds of variations to the system. The nominal system is that with which the GC was trained, and all variations are performed only at test time. is the mass of the base, while is the length of the shank links. ESR values are listed as percentages, and all results are presented as empirical means plus-minus the corresponding standard deviations.

Training Setup

Training a GC agent involves collecting MDP transitions over a rich set of target footholds. In order to achieve such a distribution of training samples, we ensure that both the initial state distribution of the MDP as well as the target footholds generated by the GP are appropriately and sufficiently randomized. Initial states are generated by first uniformly sampling initial and goal positions of the base from within the bounds of the world. We then orientate the base by sampling uniformly from attitudes centered on the current orientation facing the goal, and bounded by the vector of Euler angles . Moreover, we randomize the initial feet positions by uniformly sampling coordinates from a box defined in the base frame and centered around nominal values that would place the feet below the shoulders. Furthermore, to randomize the target footholds, we perform a randomized fixed rollout of the GP up to the maximum permissible length of an episode. Essentially, we rollout the GP however many times necessary such that the resulting phase sequence meets or exceeds the duration time of an episode, and randomize the target footholds at each step by adding a bias uniformly sampled from in the plane while ensuring that the coordinates are fixed to the terrain.

With the aforementioned sampling scheme, we trained a GC agent using TRPO in Flat-World using only parallel workers for total of iterations. Moreover, as part of ongoing work to extend our method to full 3D foothold tracking, we present preliminary results for GC policies for stair-climbing by first pre-training in Random-Stairs then also on the stairs section of Temple-Ascent. Tab. IV presents the hyper-parameters most pertinent to the training of GC, for all of the cases mentioned above. We want to emphasize that in all cases, the same hyper-parameters were used, as we only adapted the initial state distribution accordingly for each terrain. TRPO was employed using mostly the default hyper-parameters specified in [schulman2015high, schulman2015trust].

Performance Metrics

We define two metrics for quantifying the performance of GC policies at test-time. First we define the Foothold Tracking Error Rate (FTER)


that measures the mean foothold tracking error throughout an individual episode of length , and is computed as a function of the desired contact states , the desired foothold positions and the measured feet positions while in contact with the terrain for each foot and at every time-step. Secondly, we define the Foothold Tracking Score (FTS) as the ratio of successfully tracked footholds over the total generated by the GP within an episode. At the end of each support phase, we check if feet which were previously in swing phase have contacted the ground within of the target foothold in the plane, and increment the FTS by one for each foot with a successful touchdown in the aforementioned region. These metrics are important with regard to the combined use of the GP and GC as they quantify how reliably a GC can execute the footholds generated by the GP. The planner has been trained to select footholds within a minimum distance of from any changes in elevation exceeding . As long as the controller can maintain foothold tracking within this region, then the combined system is ensured to operate safely.

Training Results

GC training endured for approximately 58 hours for Flat-World and approximately 116 hours for Random-Stairs and Temple-Ascent. The discrepancy in durations is due to the increased computational cost incurred in the physics engine when evaluating contacts between the terrain mesh and the multi-body system. Training in Flat-World results in a policy that succeeds in generalizing well to planar foothold tracking, while training in Random-Stairs and Temple-Ascent extends these capabilities to 3D. However, the stair-climbing agent trained in the latter case exhibits worse MER and FTS than those trained in the former. This difference is due to the difficulties in designing sampling schemes that always initialize the robot in valid initial states, but also to the similarity of the foothold targets generated by the GP as a result of the repetitive terrain features in the suite.

We evaluated the performance of the GC policies within Temple-Ascent across five runs, each consisting of episodes with a maximum length of . We also perturb the model of the robot (i.e., with which the GC was trained) to assess the robustness of the policies. Specifically, we increased the mass of the base by and varied the lengths of the shank links by . In each case, ESR, FTS, and FTER values were recorded in order to compute empirical means and standard deviations. The resulting performance measurements are presented in Tab. IV5 and Fig. 4 shows time-series plots of the policy overcoming a large gap. The final policies deployed are demonstrated in the supplementary video6.

Fig. 4: Plots of the GC policy overcoming the gap: (b) planar pose of the base, (b) desired vs measured positions of the feet, and (c) log-scale norm of the foothold tracking errors in the X-Y plane. The vertical dotted lines denote the times at which the foothold targets change according to the phase plan, gray regions denote the time spent crossing the gap, and the horizontal line in (c) denotes the error tolerance defined by the foothold tracking cylinder.

Iv-D Comparison to Existing Approaches

As mentioned in Sec. I, most methods addressing planning and control of multi-contact motions employ optimization, sampling-based search, or a combination thereof. Although those relying solely on optimization [kuindersma2016optimization, winkler2018gait, fankhauser2018robust] can be kinodynamic, they are not feasible online, yet those that employ sampling-based search [tonneau2018efficient, tonneau2018reachability], or both [Kalakrishnan:2011:LPC:1936801.1936805, doi:10.1002/rob.21610, griffin2019footstep] can be used online but remain kinostatic. The issue is that kinostatic methods are unable to fully exploit the dynamics of the system, and typically decouple foothold selection from the optimization of the base and feet motions, limiting their possible set of solutions. In addition, nearly all of the aforementioned approaches use some form of modelling [kuindersma2016optimization, Kalakrishnan:2011:LPC:1936801.1936805] or qualification [doi:10.1002/rob.21610, tonneau2018reachability, fankhauser2018robust] of the terrain. On the contrary, our approach relies on a minimal geometric representation of the terrain in the form of a height-map, performs gait-free kinodynamic planning by jointly optimizing base and swing feet motions together with the selection of footholds and is executable online.

Lastly, to illustrate how our method performs compared to others, we present an experiment in which the robot is to walk over a set of large gaps with different sizes. Specifically, we compare with Free-Gait, a state-of-the-art model-based framework for perceptive locomotion [fankhauser2018robust] which jointly optimizes body poses and footholds using an Sequential Quadratic Programming solver. The experiment consists of two trials, corresponding to gaps of different sizes: . Fig. 5 provides snap-shots of the respective trials. Only our policies were able to traverse the gap. Free-Gait relies on a heuristic scoring of the surrounding terrain and selects footholds using a deterministic greedy search within the vicinity of a nominal foothold. As it ensures that the CoM remains within some margin of the support polygon, it does not sacrifice static stability, even momentarily, to extend the reach of the front legs. Conversely, our planner can identify valid footholds across the gap in a single shot, and our controller then orientates the base to extend leg reach while retaining balance at all times.

Fig. 5: Snap-shots of the comparison between our policies (top row) and Free-Gait (bottom row) overcoming the gap. The figures are numbered left-to-right to indicate the order of the frames.

V Conclusion & Discussion

This work proposes a new approach for training a two-layer hierarchy of NN policies which realizes terrain-aware locomotion for quadruped robots. We decompose locomotion into two parts trained independently using model-free DRL, and which interface via a carefully designed parameterization of quadrupedal gaits. As physical simulation incurs a high computational cost for use with DRL, our method reduces sample-complexity for training the gait planner by using a transition feasibility criteria realized as convex LP to formulate the transition dynamics of an MDP. Within a certain context, our formulation can resemble bilevel optimization schemes used in nonlinear programming. The upper-level optimization performed by model-free DRL optimizes the selection of footholds and instantaneous CoM motion for the coincident terrain. The lower-level optimization performed by the model-based LP optimizes phase transitions, thus resulting in optimal CoM trajectories between the support phases proposed by the higher-level. Although in this work we only used a trivial cost for the LP, we could instead formulate a cost that penalizes contact forces and CoM accelerations, and include it as an additional reward term in the MDP. Such a coupling of the LP and MDP optimization objectives would allow us to reason about both feasibility and optimality of the resulting gait plan. Furthermore, as the planner learns to generate relatively conservative foothold sequences due to the restrained centroidal dynamics model, the burden of realizing fully dynamic and optimal motions for the base and swing-feet is placed on the gait controller. Lastly, we have demonstrated the efficacy of this approach by successfully training and testing in a suite of challenging terrain scenarios. The resulting policies not only prove to be effective in the suite of rigid non-flat terrains but also manage to generalize well to previously unseen cases.



  1. We define a global inertial frame for the world, and local body-fixed frames for the base and for the feet. Left sub-scripts denote the frame in which the vector is expressed, but omit it for absolute quantities.
  2. The small range and dimensions selected for the elevation map, in conjunction with the limitation on maximum step length assumed by the planner, allows us to extract multiple successive samples of from within the effective field-of-view afforded by exteroceptive sensing.
  4. For the GP, we used a PC with 2x Intel Xeon E5-2680v4 (@2.4GHz) CPUs, 128GB of RAM, and an Nvidia GTX Titan (Pascal), and for the GC a PC with a single Intel Core i7-8700K (@3.7GHz) CPU, 64GB of RAM and an Nvidia GTX 2080 Ti GPU
  5. Although mean performance for stairs is in the nominal case, the variance is noticeably higher for the perturbed models, indicating that the policy is more sensitive w.r.t model variations than that for other terrains.
Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
Add comment
Loading ...
This is a comment super asjknd jkasnjk adsnkj
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test description