Skip to content

Integration of the skrl RL library - #6

Merged
Mayankm96 merged 29 commits into
isaac-sim:mainfrom
Toni-SM:skrl-integration
Jan 26, 2023
Merged

Mayankm96 merged 29 commits into
isaac-sim:mainfrom
Toni-SM:skrl-integration

Conversation

@Toni-SM

@Toni-SM Toni-SM commented Jan 22, 2023 •

Copy link
Copy Markdown
Contributor

Description

Integration of the skrl reinforcement learning library

  • Adds a wrapper function to wrap an IsaacEnv for skrl compatibility
  • Adds a trainer class that also logs episode information
  • Adds train.py and play.py in workflows to run skrl
  • Adds configuration files for currently included environments with parameters matching that of rl_games as close as possible

Dependencies:

Type of change

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

Checklist

  • I have run the pre-commit checks with pre-commit run --all-files (see here instructions to set it up)
  • 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

@Mayankm96 Mayankm96 added the enhancement New feature or request label Jan 22, 2023
@Mayankm96

Mayankm96 commented Jan 22, 2023 •

Copy link
Copy Markdown
Contributor

Thanks a lot for the pull request! I'll take a look at it tomorrow.

Can you please also update the changelog and the version in the config/extension.toml file of omni.isaac.orbit_envs?

https://isaac-orbit.github.io/orbit/source/refs/contributing.html#maintaining-a-changelog

@Toni-SM

Toni-SM commented Jan 22, 2023

Copy link
Copy Markdown
Contributor Author

Done, CHANGELOG and extension.toml files updated!!!

@Mayankm96

Mayankm96 commented Jan 25, 2023 •

Copy link
Copy Markdown
Contributor

Hi!

I finally got time today to test this out. I am yet to try training on the classic environments but would be nice to do some evaluations while having the same configurations for PPO across the frameworks.

Right now, mostly tried training for the reach environment. I have the following comments.

Issues

  1. Currently, while training the reach environment, I am seeing a divergence in the loss curve of the value function. Is it possible the parameters are not tuned? I suppose there might be tiny differences in algorithmic implementations but don't think the value function should be diverging. One possible explanation could be that the learning iterations are too large and that's causing some kind of collapse.

    value_skrl

  2. The learned policy for reach seems to be not that stable (I tried the best_agent.pt) . It is quite shaky which I don't see when I train with rsl_rl. Maybe again the parameters are not similar or the same and that is the potential problem.

    skrl.mp4
  3. Currently, the play.py is using the runner class to run the agent-env interaction.

    • When I hit the STOP icon on the GUI, it just freezes and doesn't exit the script quickly. Is there a possible issue in the trainer that doesn't let it exit?
    • When I hit the X icon on the GUI, I observe a similar behavior.

Nice to haves

  • Is it possible to also log the episode information in the runner? Many times in robotics, we care about how each reward term is evolving (for weight tuning). The cumulative reward is often hard to decipher when having many reward terms
  • Can the play.py just load the last or best checkpoint by default? We do something similar for rsl-rl (code snippet).
  • An updated example on how to use a learned policy outside the runner loop. It should usually be simple since that is a torch model that needs to be loaded. But it would be great if we can have an example to show this. It comes quite handy when deploying a policy in a complete robot system (in this case, an extension).

Additional comments

  • We will also need to add the license of skrl inside the docs/licenses/dependencies directory for book-keeping purposes.

@Mayankm96
Mayankm96 self-requested a review January 25, 2023 10:36
@Toni-SM

Toni-SM commented Jan 25, 2023 •

Copy link
Copy Markdown
Contributor Author

Done...

Summary:

  • Create a customized trainer in the file where the skrl wrapper is defined for:
    • log episode information during training
    • simplify train.py and play.py
  • Remove logging in play.py
  • Move the import statements to the beginning of the config.py file

@Mayankm96 Mayankm96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good to me now. Thanks a lot for working on skrl integration. It is great to have more libraries supported in the workflows.

Would love to try out other agents as well in skrl at some point and provide examples :)

@Mayankm96 Mayankm96 changed the title Skrl integration Integration of the skrl RL library Jan 26, 2023
@Mayankm96
Mayankm96 merged commit e9862d4 into isaac-sim:main Jan 26, 2023
@Toni-SM

Toni-SM commented Jan 26, 2023

Copy link
Copy Markdown
Contributor Author

Great!
Let's work on integrating new agents in future pull requests!

By the way... The online documentation does not reflect any changes 🤔

@Mayankm96

Copy link
Copy Markdown
Contributor

It should be up now! :)

By the way, I made some minor refactoring in this commit f7e4183 :

  • renaming of SkrlLogTrainer to SkrlSequentialLogTrainer
  • readding of the eval mode to the class for completeness
  • some docstring fixes
  • setting the agent to "eval" mode in the play.py script

@Toni-SM

Toni-SM commented Jan 26, 2023

Copy link
Copy Markdown
Contributor Author

Nice... It looks much better now

@Toni-SM
Toni-SM deleted the skrl-integration branch August 18, 2023 08:06
RLRK-dev added a commit to RLRK-dev/IsaacLab that referenced this pull request Jul 10, 2026
…xtracted, provenance)

Rs '記録してくれ' (02:09): consolidate the scattered measured point
data into ONE values table for the p5 CANONICAL_MOTION_TABLE_V1
ledger. comp3_point_data_ledger_v1.py machine-extracts from the banked
run JSONs (no hand-typing) with PER-ROW provenance (run commit +
cell). Tables: T1 z_drop (cell x arm) / T2 claw z @close / T3 lane
cable z + L-R diff / T4 bend by scene (flat vs supported) / T5 per-arm
park z / T6 rise. Mapping note baked in (NEAR/手前=R, FAR/奥=L,
camera-verified dfbe7fc; rise hook-capable, read with z_drop).
Standing rule (Rs isaac-sim#6): key point data supplied to this ledger
same-turn as the result bank.
RLRK-dev added a commit to RLRK-dev/IsaacLab that referenced this pull request Jul 10, 2026
…egration fragment

%12/p5 relay (02:12/02:15): integrate point data per-STEP into the
canonical 43-step table (not a separate ledger). STEP-keyed r3
fragment comp3_point_data_STEPkeyed_r3.md: STEP3 park z / STEP4 clamp
(claw z + lane-cable-z + bend footnotes) / STEP5 lift (z_drop + rise
footnotes), each row provenance = run commit + cell. Honest gaps:
STEP6-17 NOT comp3-measured (G1 arc = STEP2-5 only) -> recording-
nominal EE z per G-phase supplied instead (golden w0e_81rerun,
flagged). STEP3 R+3~4mm correction = HELD not confirmed (per-arm cell
found cable-coupling; R-only not a clean lever). Mapping camera-
verified (dfbe7fc). Standing rule: point data to the ledger
same-turn as the bank.
RLRK-dev added a commit to RLRK-dev/IsaacLab that referenced this pull request Jul 10, 2026
… + fork-4 F-A ruling

r3 (a) Rs isaac-sim#6 'organize point data into the step table': new sec 1.2a
current-measured values (mujoco-ko), STEP-keyed, alongside canonical
json sec 1.2 (unchanged). Source = %11 comp3_point_data_STEPkeyed_r3.md
(e84f1b1, per-row provenance). STEP2-5 = comp3-measured (park z
1.0668 / claw z 0.80583 symmetric / lift 1.1468 + z_drop/lane/bend
footnotes); STEP6-17 = recording-nominal (NOT comp3, G-phase flagged);
STEP18-43 = no measurement (explicit). 手前R+3mm = HELD (cable-coupling:
R z_drop 15.86 != uniform-dz3 R 0.0, not a clean lever). Added sec 5
rule 7 (same-turn point-data integration, permanent). arm attribution
camera-verified (dfbe7fc).
r3 (b) fork-4 F-A confirmed (Rs 02:26 = keep current baseline): VN-2 =
HELD/informative close (R-only depth not adopted); VN-1 = study track
continues (F-B on validated design); motion-table v2 = none for now.
Cascade: renewal batch-C C-defer premise (imminent v2 fold) dissolved;
%12 surfacing C-timing re-adjudication to Rs; C stays HOLD.
Canonical json/process/approved-dispositions unchanged (measured cols =
block-hash-exempt measured-log). Table sha256: 5a7d0d0f7f76a202d7a75ca6ddb5b5c2cab449214bbf3f97b82b66b7f0f75f5c
RLRK-dev added a commit to RLRK-dev/IsaacLab that referenced this pull request Jul 16, 2026
Assembles the D0 rulings into an implementable spec: architecture;
outbox/manifest layout with the Stage-A :117-additive field table (#2,
#3); the disk-budget re-estimate off the measured cadence (~8 RL
steps/s/proc, ~120 ep/h at N=4, ~1.4 GB/day -- no deletion, loud
low-disk warn) (#1); the R5 flip+tripwire implementation with the
two-sided identifiability legs and the byte-repro no-change proof (isaac-sim#4);
the supervisor spec (launch check N=4-k, new-individual restart, K_fail
halt, atomic in-flight discard) (isaac-sim#5); the relocate lever as config with
an existence test; the E0 pre-registration table (contention >=0.8
per-proc ratio proposal, byte-repro hard pass, K/K_fail pins, dead-
instrument positive control) (isaac-sim#6); and the trainer bring-up contention
observation leg on cuda:2, explicitly outside E0 acceptance (isaac-sim#7).
Numbers marked PROVISIONAL pending the provenance-hardened v3
calibration and E0.
kellyguo11 added a commit that referenced this pull request Nov 23, 2026
## Description

The Documentation Links job on #9070 fails because the G1 motion preview
was renamed from `g1_cr7.mp4` to `g1_jump_and_turn.mp4` on the
documentation asset host. [Hugging Face PR
#6](https://huggingface.co/datasets/nvidia/isaaclab-docs-assets/discussions/6)
confirms a 100% identical file rename.

Update the G1 motion-tracking guide and Command Builder to use the
renamed asset, preserving both video previews. The old reference is
already on `main`, introduced in #9098.

[Failing link-check
job](https://github.com/isaac-sim/IsaacLab/actions/runs/45206719337/job/137804323431)

## Type of change

- Documentation update

## Validation

- Renamed video URL: HTTP 200; old URL: HTTP 404.
- Lychee v0.24.2 on the updated motion-tracking guide: four links OK,
zero errors.
- `ISAACLAB_CHANGELOG_BASE_REF=upstream/main uv run --no-sync isaaclab
--format`: passed all hooks.
- `node --check docs/source/_static/css/environment-browser.js` and `git
diff --check`: passed.
- Clean Sphinx build attempted locally; blocked during API autosummary
imports by missing simulation dependencies in the minimal macOS
environment. Full documentation build remains for CI.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] I have validated the changed behavior with focused coverage
- No source package changes or test changes; no changelog fragment
required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants