Support detach assets from env automatic reset #121
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_uidsparameter toreset_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]toX | Ysyntax (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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implement a mechanism to detach assets from
BaseEnvautomatic reset. The event functor for configure the asset is also implementedType of change
Checklist
black .command to format the code base.