Skip to content

Contribute

Steve edited this page Feb 8, 2024 · 1 revision

Philosophy

The main reason for this fork of Legged Gym <https://github.com/leggedrobotics/legged_gym/>_ is that our main goal isn't to train good policies, but to iterate on ideas; training good policies is how we do that. In that spirit, the coding philosophy is to make it easy to change and try things. E.g. faster code-execution lets us try things faster, but only if it doesn't sacrifice readability.

This means, among other things:

  • Move as much as possible into the config file: trying out different observations and actions shouldn't need re-implement the environment.
    • Configurations should be in one place only. E.g. you shouldn't have to set the number of observations in the env config, and then also remember to set it in the policy config.
  • Make the environment stateful: we rely heavily on getters and setters for the environment, and anything that could be changed has to be implemented as a buffer in the environment. This lets us decouple environment and runner, and avoid having the interface (like env.step()) with very specific returns. This lets us try customizations of the runner more easily.
  • Hide book-keeping code, expose algorithmic code. The algorithms are where we want to explore ideas; things should be easy to use, but not hidden out of the way.

We subscribe to clean code <https://github.com/dev-marko/clean-code-book>, and rely on ruff <https://github.com/astral-sh/ruff> for linting and formatting, and pytest for unit-tests. For PRs, please make sure to install the pre-commit hooks, or manually run ruff check and ruff format before pushing.

Clone this wiki locally