Skip to content

refactor: extract shared LocomotionDRProvider base class (#184) - #186

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

TATP-233 merged 1 commit into
mainfrom
feat/extract-locomotion-dr-provider

Conversation

@TATP-233

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

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces LocomotionDRProvider base class in common/dr_provider.py
  • Shared: validate(), build_interval_randomization_plan(), _sample_commands(), build_reset_plan() template, build_reset_observation() template
  • Hooks for robot-specific behavior: _get_qvel_limit(), _build_extra_info_updates(), _compute_reset_obs()
  • G1 provider: ~50 → ~20 lines (overrides qvel limit + gait_phase + obs)
  • Go1/Go2 providers: ~50 → ~10 lines each (only override obs)
  • Net reduction: ~150 lines of duplicated DR code eliminated

Test plan

  • make check (ruff format + ruff check + mypy + pyright) — all pass
  • make test — 329 passed, 12 skipped

Closes #184
Depends on #183 (feat/extract-locomotion-rewards)

Introduce LocomotionDRProvider in common/dr_provider.py with shared
validate, build_interval_randomization_plan, _sample_commands, and
template methods for build_reset_plan/build_reset_observation.

G1/Go1/Go2 providers now inherit from the base class and only override
robot-specific hooks (_get_qvel_limit, _build_extra_info_updates,
_compute_reset_obs), eliminating ~150 lines of duplicated DR code.
@TATP-233
TATP-233 merged commit 1022557 into main Apr 9, 2026
5 checks passed
@TATP-233
TATP-233 deleted the feat/extract-locomotion-dr-provider branch April 9, 2026 17:35
TATP-233 added a commit that referenced this pull request May 4, 2026
…vider

refactor: extract shared LocomotionDRProvider base class (#184)
TATP-233 added a commit that referenced this pull request May 30, 2026
…vider

refactor: extract shared LocomotionDRProvider base class (#184)
TATP-233 added a commit that referenced this pull request Sep 4, 2026
…vider

refactor: extract shared LocomotionDRProvider base class (#184)
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: 提取 Locomotion DomainRandomizationProvider 共享基类 — 消除重复代码

2 participants