Skip to content
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

Adds live plots to managers #893

Merged
merged 58 commits into from
Dec 16, 2024
Merged

Adds live plots to managers #893

merged 58 commits into from
Dec 16, 2024

Conversation

pascal-roth
Copy link
Collaborator

@pascal-roth pascal-roth commented Aug 28, 2024

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

  • 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

@pascal-roth pascal-roth added enhancement New feature or request dev team Issue or pull request created by the dev team labels Aug 28, 2024
Copy link
Collaborator

@jsmith-bdai jsmith-bdai left a comment

Choose a reason for hiding this comment

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

Left some initial comments, but haven't gone through it in detail.

It seems like we are defining a few pre-defined configs for these visualizers, but I wonder if there's a way we can have the user simply define the types of managers to be visualized e.g.:

class ManagerVisualizerCfg:
     to_visualize: ["actions", "observations", etc.]

We could probably make it a dictionary to enable the type of manager / specific config for that manager. Do you see this as being useful or do you see most users just wanting to visualize everything / nothing?

I haven't given it a ton of thought and the above is super rough, but we can discuss offline how this can be made a little simpler, while still enabling full flexibility. Happy to chat sometime today / tomorrow!

@jsmith-bdai
Copy link
Collaborator

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

@pascal-roth
Copy link
Collaborator Author

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

@jtigue-bdai jtigue-bdai marked this pull request as ready for review September 18, 2024 12:08
@pascal-roth
Copy link
Collaborator Author

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.

with frame:
# create line plot for single or multivariable signals
len_term_shape = len(numpy.array(term).shape)
if len_term_shape <= 2:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only want single floats and lists to be for the line plot, so that should be < 2 and then the image for everything that is 2D and 3D. So there is still something wrong with that check

@pascal-roth
Copy link
Collaborator Author

@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.

@kellyguo11 kellyguo11 merged commit b473b4d into main Dec 16, 2024
4 of 5 checks passed
@kellyguo11 kellyguo11 deleted the feature/manager-live-plots branch December 16, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev team Issue or pull request created by the dev team enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants