Skip to content

Support detach assets from env automatic reset #121

Merged
yuecideng merged 2 commits intomainfrom
yueci/add-detach-rest
Feb 5, 2026
Merged

Support detach assets from env automatic reset #121
yuecideng merged 2 commits intomainfrom
yueci/add-detach-rest

Conversation

@yuecideng
Copy link
Contributor

@yuecideng yuecideng commented Feb 5, 2026

Description

This PR implement a mechanism to detach assets from BaseEnv automatic reset. The event functor for configure the asset is also implemented

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

Copilot AI review requested due to automatic review settings February 5, 2026 04:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds functionality to detach specific assets from automatic reset in the BaseEnv, allowing certain objects to maintain their state across environment resets. This is useful for scenarios where some objects should persist while others are reset between episodes.

Changes:

  • Added excluded_uids parameter to reset_objects_state() method in SimulationManager to skip resetting specific assets
  • Introduced add_detached_uids_for_reset() method in BaseEnv to manage the list of assets excluded from automatic resets
  • Implemented set_detached_uids_for_env_reset() event functor to configure detached assets via the event system
  • Updated type hints from Union[X, Y] to X | Y syntax (Python 3.10+) throughout events.py for consistency

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
embodichain/lab/sim/sim_manager.py Extended reset_objects_state() to accept excluded_uids parameter and check UIDs against exclusion list before resetting each asset type
embodichain/lab/gym/envs/base_env.py Added _detached_uids_for_reset attribute and add_detached_uids_for_reset() method; modified reset() to pass excluded UIDs to sim manager
embodichain/lab/gym/envs/managers/events.py Added set_detached_uids_for_env_reset() event functor and modernized type hints from Union to `

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yuecideng yuecideng merged commit 663f7d3 into main Feb 5, 2026
5 checks passed
@yuecideng yuecideng deleted the yueci/add-detach-rest branch February 5, 2026 10:34
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.

2 participants