Skip to content

Adds Simple Cube Peg In Hole Environment and Task #2264

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zoemcc
Copy link

@zoemcc zoemcc commented Apr 7, 2025

Description

This commit adds a simple peg-in-hole task using repurposed assets from the isaac-sim asset browser. I started from the Isaac-Lift-Cube-Franka-v0 task and modified the Props/Flip_Stack/t_connector_physics.usd asset to have a hole collision that aligns with its visual hole. I sized the hole in the task so that the cube from the previous task just barely fits into the hole. This provides a nice rectangular insertion task, which is a little harder than the existing cylindrical peg-insertion task in Isaac-Factory-PegInsert-Direct-v0. The formulation is simpler, as well, so it can scale to much higher parallel environment numbers: the default is 4096 which works well on my 3090. It's not the peg-in-hole task that was in the Orbit paper, since I wanted to keep it simple and use assets that were readily available to me and NVIDIA already had the license to, but I'm open to expanding the setup to include the peg-in-hole toy from the paper.

I performed some reward shaping while iteratively training the task and I'm happy with the training consistency. The rewards used for the cube lifting were mostly sufficient to modify for the hole insertion task but I have 4 scales of goal distance rewards instead of 2: one to encourage exploration towards the hole, another for approaching the hole object, another for approaching the hole itself, and another for getting inside the hole. I had to add object orientation into the observations because the robot needs to be able understand rotating the object so that it fits into the rectangular hole. I haven't added agents for any other RL library than RSL-RL right now, but before this gets merged I'm planning on adding default agents for the other RL libraries.

Currently I'm hosting the modified instanceable hole asset on my own public s3 bucket, so anyone running the code should have it "just work" for now, and then when this is merged and the modified asset is uploaded onto the Isaac s3 bucket we can change the USD URL prefix to the ISAAC_NUCLEUS_DIR instead of mine: ZOEMCC_BUCKET_DIR . Otherwise it's formatted exactly the same to make testing and merging as painless as possible.

I added the documentation change but the code link in the docs won't work until this is merged to main.

Fixes #748

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Screenshots

franka_peg_in_hole

Training montage video: all of the training video outputs concatenated into one video, with the constituent training step in the top left of the video as text. I also have a shell script that does this automatically that I can submit a separate pull request for if desired hehe.

peg_in_hole_training_montage.mp4

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@zoemcc zoemcc changed the title Feature peg in hole env Adds Simple Cube Peg In Hole Environment and Task Apr 7, 2025
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.

[Proposal] Checklist of environments to add to the framework
1 participant