gbionics/amp-rsl-rl

🔁 AMP-RSL-RL: Adversarial Motion Priors for robotic RL (PPO + motion imitation)

What it solves

Teaching humanoid robots complex, natural movements (like walking or running) is hard to program by hand. This library lets robots learn such motor skills from motion capture recordings of real movements, using a technique called adversarial imitation learning. It extends the RSL-RL reinforcement learning library (which implements the PPO algorithm) with Adversarial Motion Priors (AMP), so agents can imitate reference motions instead of relying on hand-coded behaviors.

How it works

The library combines two ideas:

  • PPO (Proximal Policy Optimization), a standard reinforcement learning algorithm from RSL-RL, which trains the agent's policy (its decision-making network) through trial and error.
  • AMP (Adversarial Motion Priors), which adds a discriminator network used for adversarial training. The discriminator provides style rewards that push the agent to imitate the reference motions, keeping the adversarial training consistent with symmetric counterparts.

Motion capture data is supplied as .npy files containing a dictionary with joint names, joint positions, root position, root orientation (quaternions in xyzw order), and frames-per-second. The library resamples this data to match the simulator's timestep.

The training pipeline is organized into modules: algorithms (AMP and PPO implementations), networks (policy and discriminator), runners (training and evaluation routines), storage (replay buffer for experience collection), and utils (dataset loaders and motion tools).

It also supports symmetry-aware data augmentation and mirror-loss regularization from RSL-RL, based on the ICRA 2024 paper by Mittal et al. This helps learn symmetric policies (e.g., left/right symmetric gaits). The discriminator and expert/policy motion buffers are augmented using the same configuration so style rewards stay aligned.

Who it's for

Researchers and engineers working with humanoid or legged robots who want to train locomotion skills from motion capture data. It is designed to work with Isaac Lab 3 (the rsl-rl 5 configuration layout) and requires Python 3.12 or newer. Users need to provide their own motion capture datasets, or can use the ready-made AMP Dataset on Hugging Face.

Highlights

  • Extends RSL-RL's PPO with Adversarial Motion Priors for imitation learning
  • Learns motor skills from motion capture data instead of hand-coded behaviors
  • Supports Mixture-of-Experts (MoE) actor networks via MoEModel
  • Symmetry-aware data augmentation and mirror-loss regularization for policy updates
  • Installable via pip (amp-rsl-rl), with optional example support
  • Ready-to-use motion capture dataset available on Hugging Face
  • BSD 3-Clause license, developed at Istituto Italiano di Tecnologia

Related

  • Project
  • Project
  • Project
  • Project