-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Adds example for gear assembly sim-to-real with UR10e #4044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Adds example for gear assembly sim-to-real with UR10e #4044
Conversation
Greptile Summary
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TrainingScript
participant Environment
participant GearTypeManager
participant RobotIK
participant PPOAgent
participant RewardManager
User->>TrainingScript: run train.py with task config
TrainingScript->>Environment: create env with UR10e gear assembly config
Environment->>GearTypeManager: initialize RandomizeGearType event
GearTypeManager->>Environment: register as _gear_type_manager
Environment->>Environment: setup scene with robot and 3 gear types
loop Training Episodes
Environment->>GearTypeManager: reset - randomize gear type
GearTypeManager->>Environment: set active gear per env
Environment->>RobotIK: SetRobotToGraspPose event
RobotIK->>RobotIK: run IK to compute grasp pose
RobotIK->>Environment: update robot joint positions
Environment->>Environment: RandomizeGearsAndBasePose event
loop Episode Steps
Environment->>PPOAgent: get observation (joint pos/vel, gear shaft pose)
PPOAgent->>Environment: return action (delta joint positions)
Environment->>Environment: apply action and step simulation
Environment->>RewardManager: compute keypoint distance rewards
RewardManager->>Environment: return reward signal
Environment->>Environment: check terminations (gear dropped, orientation)
end
Environment->>PPOAgent: collect episode data
PPOAgent->>PPOAgent: update policy with PPO
end
TrainingScript->>User: save trained model checkpoint
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
22 files reviewed, 2 comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/events.py
Show resolved
Hide resolved
...lab_tasks/manager_based/manipulation/deploy/gear_assembly/config/ur_10e/joint_pos_env_cfg.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
...tasks/manager_based/manipulation/deploy/gear_assembly/config/ur_10e/agents/rsl_rl_ppo_cfg.py
Outdated
Show resolved
Hide resolved
...tasks/manager_based/manipulation/deploy/gear_assembly/config/ur_10e/agents/rsl_rl_ppo_cfg.py
Outdated
Show resolved
Hide resolved
...asks/isaaclab_tasks/manager_based/manipulation/deploy/gear_assembly/gear_assembly_env_cfg.py
Outdated
Show resolved
Hide resolved
...asks/isaaclab_tasks/manager_based/manipulation/deploy/gear_assembly/gear_assembly_env_cfg.py
Outdated
Show resolved
Hide resolved
docs/source/_static/setup/walkthrough_sim_real_gear_assembly_train.png
Outdated
Show resolved
Hide resolved
kellyguo11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we try to avoid having large .gif files in the repo directly? we can upload them to the server if needed and referenced from docs.
...asks/isaaclab_tasks/manager_based/manipulation/deploy/gear_assembly/gear_assembly_env_cfg.py
Outdated
Show resolved
Hide resolved
...lab_tasks/manager_based/manipulation/deploy/gear_assembly/config/ur_10e/joint_pos_env_cfg.py
Outdated
Show resolved
Hide resolved
...lab_tasks/manager_based/manipulation/deploy/gear_assembly/config/ur_10e/joint_pos_env_cfg.py
Outdated
Show resolved
Hide resolved
|
Thanks for the edit and contribution : )), I'd like to ask a high level questions why not put this PR in deploy folder we created for the reach eariler? Are we planing to add peg insert and nut thread as well? if that's the intention, it might be more benefitial to work a general structure with all of them, right now mdp seems just tailored to gearmesh. |
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/observations.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/observations.py
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
…/IsaacLab into ashwinvk/deploy_gear_assembly
ooctipus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :)
…/IsaacLab into ashwinvk/deploy_gear_assembly
docs/source/_static/policy_deployment/02_gear_assembly/gear_assembly_sim_real.gif
Outdated
Show resolved
Hide resolved
docs/source/_static/policy_deployment/02_gear_assembly/sim_real_gear_assembly_train.png
Outdated
Show resolved
Hide resolved
source/isaaclab_assets/isaaclab_assets/robots/universal_robots.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/reach/reach_env_cfg.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/rewards.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/deploy/mdp/observations.py
Show resolved
Hide resolved
| from isaaclab.utils.noise import NoiseCfg | ||
|
|
||
|
|
||
| class ResetSampledConstantNoiseModel(NoiseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be an explanation to this choice? If this is something generally useful, maybe we should move it to the utils.noise module directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment. It was decided after discussion with @ooctipus to not add it to the deafult noise_models. It was mainly because he felt it would not be used by other envs as it is and instead might confuse users.
Co-authored-by: Mayank Mittal <[email protected]> Signed-off-by: Ashwin Varghese Kuruttukulam <[email protected]>
…/IsaacLab into ashwinvk/deploy_gear_assembly
rl-video-step-137600.mp4
Description
This PR introduces a new Gear Assembly manipulation task for sim-to-real training with the UR10e robot arm. This environment enables training policies for precise gear insertion tasks using reinforcement learning, with comprehensive sim-to-real transfer capabilities.
Summary of Changes
New Features
Gear Assembly Environment: Complete environment implementation for gear insertion tasks
gear_assembly_env_cfg.py)joint_pos_env_cfg.py)rsl_rl_ppo_cfg.py)MDP Components: Task-specific observation, reward, termination, and event functions
mdp/events.py: Randomization and reset events for robust trainingmdp/observations.py: State observation functionsmdp/rewards.py: Reward shaping for gear insertionmdp/terminations.py: Episode termination conditionsNoise Models: Enhanced noise simulation for domain randomization
noise_model.py,noise_cfg.py)Documentation
Core Enhancements
train.pywith additional logging and configuration optionsuniversal_robots.pywith gear assembly specific parametersisaaclab/envs/mdp/rewards.pyrl_cfg.py,setup.py)Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists thereUsage Example