RSL-RL

repository·main·Indexed 25 days ago

https://github.com/leggedrobotics/rsl_rl

A lightweight, GPU-accelerated reinforcement learning library implemented in PyTorch and optimized for robotics research. It features high-throughput Multi-GPU training and supports algorithms such as PPO and Distillation. RSL-RL is compatible with learning environments including Isaac Lab, Legged Gym, mjlab, and MuJoCo Playground. The library provides various model architectures (MLP, RNN, CNN), stochastic distributions, and extensions like Random Network Distillation (RND) and Symmetry augmentation.

Tokens
3.9K
Snippets
6
Records
43
Agent score
84%

What's inside rsl_rl

  1. Overview of RSL-RL

    main
    RSL-RL is a GPU-accelerated, lightweight learning library designed for robotics research. It is optimized for high-throughput training with native Multi-GPU support and features robotics-focused algorithms like PPO and Student-Teacher Distillation. Its compact design is intended for rapid prototyping and testing new ideas without the overhead of large, complex libraries.
  2. Implement a custom Environment interface

    main

    To use RSL-RL with a custom environment, your environment must implement the :class:~rsl_rl.env.vec_env.VecEnv`` abstract interface. Specifically, it must implement the following methods:

    • :func:~rsl_rl.env.vec_env.VecEnv.step``
    • :func:~rsl_rl.env.vec_env.VecEnv.get_observations``
  3. Install RSL-RL for development

    main

    If you intend to contribute to RSL-RL or need to modify its source code, install it in editable mode. Clone the repository and use pip install -e . to ensure changes to the source are reflected in your environment.

    git clone https://github.com/leggedrobotics/rsl_rl
    cd rsl_rl
    pip install -e .
  4. Extend RSL-RL with custom classes via configuration

    main
    RSL-RL is designed to be extensible without modifying the library source. You can pass custom classes (for models, loggers, etc.) directly in your configuration dictionary. Use the :func:~rsl_rl.utils.utils.resolve_callable`` utility to resolve these classes from the configuration.
  5. Configure Observation Groups in RSL-RL

    main

    RSL-RL uses TensorDict to handle observations returned by the environment's VecEnv.step method. These observations are organized into observation groups.

    You configure how these groups are assigned to different model components (like the actor or critic) using the obs_groups dictionary in your runner configuration. The obs_groups dictionary maps an observation set (a key like actor or critic) to a list of observation groups (the keys present in the TensorDict).

    For example, if your environment returns a policy tensor (for deployment) and a privileged tensor (only for training), you can configure the actor to only see the policy group while the critic sees both.