Skip to content

refactor: extract LocomotionBaseEnv — eliminate G1/Go1/Go2 code duplication - #181

Merged
TATP-233 merged 1 commit into
mainfrom
feat/extract-locomotion-base-env
Apr 9, 2026
Merged

TATP-233 merged 1 commit into
mainfrom
feat/extract-locomotion-base-env

Conversation

@TATP-233

@TATP-233 TATP-233 commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #133

  • Extract LocomotionBaseEnv base class into locomotion/common/ module, consolidating 7 identical methods from G1/Go1/Go2 base environments
  • Extract shared configs: LocomotionBaseCfg, ControlConfigBase, Sensor, Commands, DomainRandConfig
  • Rename Domain_Rand → DomainRandConfig (PascalCase)
  • Extract sample_velocity_commands() to common module
  • Line count reductions: G1 52%, Go1 62%, Go2 50%

Test plan

  • make check passes (ruff format + ruff check + mypy + pyright)
  • make test passes (329 tests, 0 failures)
  • All 222 backend tests pass
  • uv run python scripts/train_rsl_rl.py task=go1_joystick algo.max_iterations=3
  • uv run python scripts/train_rsl_rl.py task=g1_joystick algo.max_iterations=3

Closes #133

- Create `locomotion/common/` module with shared base class, configs, and utilities
- `LocomotionBaseEnv` consolidates 7 identical methods from 3 robot base envs
- `LocomotionBaseCfg` + `ControlConfigBase` provide shared config inheritance
- `DomainRandConfig` replaces `Domain_Rand` (PascalCase naming)
- `Commands` + `sample_velocity_commands` extracted to common module
- Line count reductions: G1 52%, Go1 62%, Go2 50%
- Fix pre-existing mypy type-arg error in xml_utils.py
@TATP-233
TATP-233 merged commit 4e0fada into main Apr 9, 2026
5 checks passed
@TATP-233
TATP-233 deleted the feat/extract-locomotion-base-env branch April 9, 2026 16:41
TATP-233 added a commit that referenced this pull request May 4, 2026
refactor: extract LocomotionBaseEnv — eliminate G1/Go1/Go2 code duplication
TATP-233 added a commit that referenced this pull request May 30, 2026
refactor: extract LocomotionBaseEnv — eliminate G1/Go1/Go2 code duplication
TATP-233 added a commit that referenced this pull request Sep 4, 2026
refactor: extract LocomotionBaseEnv — eliminate G1/Go1/Go2 code duplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work: 提取 LocomotionBaseEnv — 消除 G1/Go1/Go2 三重代码复制

2 participants