IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

Adds live plots to managers

Open pascal-roth opened this issue 1 year ago • 4 comments

Description

This adds a UI interface to the Managers in the ManagerBasedEnv and The MangerBasedRLEnv. Additions include:

  • UI widgets for LiveLinePlot and ImagePlot
  • ManagerLiveVisualizer/Cfg: Given a ManagerBase (i.e. action_manager, observation_manager, etc) and a config file this class creates the the interface between managers and the UI.
  • EnvLiveVisualizer: A 'manager' of ManagerLiveVisualizer. This is added to the ManagerBasedEnv but is only called during the initialization of the managers in load_managers
  • Adds get_active_iterable_terms implementation methods to ActionManager, ObservationManager, CommandsManager, CurriculumManager, RewardManager, and TerminationManager. This method exports the active term data and labels for each manager and is called by ManagerLiveVisualizer.
  • Additions to BaseEnvWindow and RLEnvWindow to register ManagerLiveVisualizer UI interfaces for the chosen managers.

Screenshots

Screencast from 09-06-2024 01:20:18 PM.webm

Implementation

image

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • [x] I have run the pre-commit checks with ./isaaclab.sh --format
  • [x] I have made corresponding changes to the documentation
  • [x] 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
  • [x] I have added my name to the CONTRIBUTORS.md or my name already exists there

pascal-roth avatar Aug 28 '24 16:08 pascal-roth

Forgot to say, thanks for putting this up and all the reworking on the initial design! This will be super useful for debugging :+1:

jsmith-bdai avatar Sep 17 '24 21:09 jsmith-bdai

@renezurbruegg, as the original author, some feedback from you would be helpful

pascal-roth avatar Sep 18 '24 07:09 pascal-roth

Nice changes and great work @jtigue-bdai, thanks a lot. I left some high level inputs / discussion about the changes.

Love the Image Visualizer, really nice to have this!

renezurbruegg avatar Sep 18 '24 16:09 renezurbruegg

Nice changes and great work @jtigue-bdai, thanks a lot. I left some high level inputs / discussion about the changes.

Love the Image Visualizer, really nice to have this!

@renezurbruegg I am not seeing your comments.

jtigue-bdai avatar Sep 19 '24 14:09 jtigue-bdai

@jsmith-bdai I ran the default anymal training and had to make some bugfixes, please have a look. Afterwards, we should be able to merge it

pascal-roth avatar Oct 11 '24 16:10 pascal-roth

@renezurbruegg ping for visibility, let us know if you have any more comments

pascal-roth avatar Oct 11 '24 16:10 pascal-roth

I gave it a quick glance, here some small changes, will comment further under relevant discussions

@pascal-roth Looks good. Thanks

jtigue-bdai avatar Oct 11 '24 17:10 jtigue-bdai

@renezurbruegg and @jsmith-bdai I tried to visualize a depth image but there was no output on the console. Did any of you every try to do that?

pascal-roth avatar Oct 12 '24 13:10 pascal-roth

@pascal-roth Yeah I had it working with depth images. But it was before we adjusted the shape checks and I was using an observation that I removed on commit after the more comprehensive image observation was added recently.

jtigue-bdai avatar Oct 12 '24 13:10 jtigue-bdai

hm, any idea why it should be broken now? Still just passing an image to the function

pascal-roth avatar Oct 12 '24 17:10 pascal-roth

Looks good to me, maybe we should rename env_idx to env_ids for consistency?

Dhoeller19 avatar Oct 21 '24 13:10 Dhoeller19

Looks good to me, maybe we should rename env_idx to env_ids for consistency?

Difference to the standard notation is that env_idx is typically just a single env id and env_ids a list/ sequence of ids. Thus, the difference would make sense to me. If you don't like it, I can rename it.

pascal-roth avatar Oct 25 '24 08:10 pascal-roth

@Dhoeller19 do you think we can introduce a set of tests for the new class, I think we still have an issue in the dimension check.

pascal-roth avatar Nov 01 '24 09:11 pascal-roth