-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adds recorder manager in manager-based environments #1336
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aface97
Adds recorder manager in manager-based environments
nvcyc e4acc57
Fixes add and get_next APIs in EpisodeData
nvcyc 8b92c5e
Removes unused prev_obs_buf in manager based env classes
nvcyc 7320dab
Simplifies getting env_name from cfg in RecorderManager
nvcyc 7f944d4
Updates docstrings in RecorderManager
nvcyc c2076f5
Updates recorder manager unit tests to test both CPU and CUDA envs
nvcyc fb5fdc2
Optimizes recorder manager code
nvcyc 49d30cd
Updates to retrieve asset states as dict
nvcyc 9107a52
Adds missing docstrings
nvcyc cf59eca
Updates hdf5 dataset handler to make it compatible with robomimic
nvcyc 3cb1d1d
Adds root pose and velocity to articulation state
nvcyc ce30005
Apply suggestions from code review
nvcyc 2b5d40c
Removes unused code
nvcyc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/recorders/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright (c) 2024, The Isaac Lab Project Developers. | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| """Various recorder terms that can be used in the environment.""" | ||
|
|
||
| from .recorders import * | ||
| from .recorders_cfg import * |
45 changes: 45 additions & 0 deletions
45
source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/recorders/recorders.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Copyright (c) 2024, The Isaac Lab Project Developers. | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| from omni.isaac.lab.managers.recorder_manager import RecorderTerm | ||
|
|
||
|
|
||
| class InitialStateRecorder(RecorderTerm): | ||
| """Recorder term that records the initial state of the environment after reset.""" | ||
|
|
||
| def record_post_reset(self, env_ids: Sequence[int] | None): | ||
| return "initial_state", self._env.scene.get_state(is_relative=True) | ||
|
|
||
|
|
||
| class PostStepStatesRecorder(RecorderTerm): | ||
| """Recorder term that records the state of the environment at the end of each step.""" | ||
|
|
||
| def record_post_step(self): | ||
| return "states", self._env.scene.get_state(is_relative=True) | ||
|
|
||
|
|
||
| class PreStepActionsRecorder(RecorderTerm): | ||
| """Recorder term that records the actions in the beginning of each step.""" | ||
|
|
||
| def record_pre_step(self): | ||
| return "actions", self._env.action_manager.action | ||
|
|
||
|
|
||
| class PreStepFlatPolicyObservationsRecorder(RecorderTerm): | ||
| """Recorder term that records the policy group observations in each step.""" | ||
|
|
||
| def record_pre_step(self): | ||
| return "obs", self._env.obs_buf["policy"] | ||
|
|
||
|
|
||
| class PreStepSubtaskTermsObservationsRecorder(RecorderTerm): | ||
| """Recorder term that records the subtask completion observations in each step.""" | ||
|
|
||
| def record_pre_step(self): | ||
| return "obs/subtask_term_signals", self._env.obs_buf["subtask_terms"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.