Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This draft PR adds a CartPole reinforcement learning environment to the embodichain framework. The implementation follows the existing pattern established by the PushCubeRL environment, introducing a new task where an agent must balance a pole on a movable cart by controlling the cart's position.
Changes:
- New CartPole RL environment class with success/failure conditions based on pole angle and velocity
- Optional goal_pose handling in RLEnv base class to support tasks without explicit goal positions
- New pole_upward reward function to encourage keeping the pole upright
- Configuration files for training and environment setup
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| embodichain/lab/gym/envs/tasks/rl/cart_pole.py | Implements CartPoleEnv with pole balancing logic, success criteria (angle < 0.05, velocity < 0.1), and truncation when pole falls beyond π/2 radians |
| embodichain/lab/gym/envs/rl_env.py | Makes goal_pose optional in info dictionary by checking for existence before adding, supporting tasks without explicit goal positions |
| embodichain/lab/gym/envs/managers/rewards.py | Adds pole_upward reward function that rewards keeping pole angle close to vertical (0 radians) |
| embodichain/lab/gym/envs/init.py | Imports and registers CartPoleEnv for use in the framework |
| configs/agents/rl/cart_pole/train_config.json | PPO training configuration with hyperparameters, camera settings, and wandb integration |
| configs/agents/rl/cart_pole/gym_config.json | Environment configuration including robot URDF path, joint parameters, observations, rewards, and control settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yuecideng
requested changes
Jan 29, 2026
yuecideng
requested changes
Jan 29, 2026
yuecideng
approved these changes
Jan 30, 2026
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
Add cart pole rl env.
example:
python embodichain/agents/rl/train.py --config configs/agents/rl/basic/cart_pole/train_config.jsonTODO:
Type of change
Screenshots
ep198_main_cam_allenvs.mp4
Checklist
black .command to format the code base.