lerobot icon indicating copy to clipboard operation
lerobot copied to clipboard

refactor(env): introduce explicit gym ID handling in EnvConfig/factory

Open bsprenger opened this issue 8 months ago • 1 comments

What this does (✨ Feature)

This commit introduces properties for the gym package/ID associated with an environment config. They default to the current defaults (gym_{package_name}/{task_id}) to avoid breaking changes, but allow for easier use of external gym environments.

Subclasses of EnvConfig can override the default properties to allow the factory to import (i.e. register) the gym env from a specific module, and also instantiate the env from any ID string.

How it was tested

  • Tested to make sure existing environment configs still work with this change (ran test suite)
  • Added a test for a dummy external env config in (tests/envs/test_envs.py::test_factory_custom_gym_id)

How to checkout & try? (for the reviewer)

pytest -sx tests/envs/test_envs.py

bsprenger avatar Apr 21 '25 11:04 bsprenger

Closely related to #807 (merged). This is a next step to help use LeRobot with external projects 😊

@imstevenpmwork I'm not sure who to tag who could review this, let me know if you think I should tag someone in particular!

bsprenger avatar Apr 22 '25 09:04 bsprenger

Hi @AdilZouitine , thanks for the approval!

I had to rebase this commit due to the common->src folder structure change. Otherwise, the code is exactly the same as when you approved it.

Can you take a look again? What needs to happen to get this merged?

bsprenger avatar Jul 22 '25 13:07 bsprenger

Hi @AdilZouitine, any update on this? What can I do to help get this merged?

bsprenger avatar Aug 19 '25 12:08 bsprenger