Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors environment launcher scripts by centralizing common CLI argument wiring and environment-config construction into shared helpers, and folds the previous standalone preview script functionality into run_env.py.
Changes:
- Introduces
add_env_launcher_args_to_parser()andbuild_env_cfg_from_args()ingym_utils.pyto share launcher argument/config logic. - Updates
run_env.pyandrun_agent.pyto use the shared helpers and adds an interactive preview path inrun_env.py. - Updates a sample gym config to include a camera recording event; removes the old
preview_env.pyscript.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
embodichain/lab/scripts/run_env.py |
Switches to shared launcher helpers and adds interactive preview mode. |
embodichain/lab/scripts/run_agent.py |
Switches to shared launcher helpers for env cfg creation. |
embodichain/lab/scripts/preview_env.py |
Removed (preview functionality moved into run_env.py). |
embodichain/lab/gym/utils/gym_utils.py |
Adds shared argparse/env-cfg builder helpers for launchers. |
configs/gym/pour_water/gym_config_simple.json |
Adds a record_camera interval event to record camera data. |
Comments suppressed due to low confidence (1)
embodichain/lab/scripts/run_agent.py:74
build_env_cfg_from_args()returnsaction_config, and the shared launcher args now include--action_config, butgymnasium.make(...)here doesn’t pass it through. If tasks rely onkwargs.get("action_config")(e.g., action bank configs),--action_configwill have no effect inrun_agent.py. Pass it along (e.g., via**action_configoraction_config=...depending on the expected API).
# Load configurations
env_cfg, gym_config, action_config = build_env_cfg_from_args(args)
agent_config = load_json(args.agent_config)
# Create environment
env = gymnasium.make(
id=gym_config["id"],
cfg=env_cfg,
agent_config=agent_config,
agent_config_path=args.agent_config,
task_name=args.task_name,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ce/EmbodiChain into yueci/refactor-env-launch
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 modularize the env launching function.
Type of change
Checklist
black .command to format the code base.