-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes BaseEnv and RLEnv consistent with desired definitions (#197)
# Description As discussed in the past, the `BaseEnv` should only contain an observation-action interface, while `RlEnv` should contain also the task-specific interface. Based on this, the MR introduces the following changes: * Moves randomization manager to the `BaseEnv` class with the default settings to reset the scene to the defaults specified in the configurations of assets. * Moves command generator to `RlEnv` class * Adds a `NullCommandGenerator` for no command environments: This is easier to work with than having checks for None. ## Type of change - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.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 - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file --------- Signed-off-by: Mayank Mittal <[email protected]> Co-authored-by: jsmith-bdai <[email protected]>
- Loading branch information
1 parent
97d684c
commit 447aa31
Showing
13 changed files
with
209 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
52 changes: 52 additions & 0 deletions
52
...extensions/omni.isaac.orbit/omni/isaac/orbit/command_generators/null_command_generator.py
This file contains 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,52 @@ | ||
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES, ETH Zurich, and University of Toronto | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
"""Sub-module containing command generator that does nothing.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING, Sequence | ||
|
||
from omni.isaac.orbit.command_generators.command_generator_base import CommandGeneratorBase | ||
|
||
if TYPE_CHECKING: | ||
from .command_generator_cfg import NullCommandGeneratorCfg | ||
|
||
|
||
class NullCommandGenerator(CommandGeneratorBase): | ||
"""Command generator that does nothing. | ||
This command generator does not generate any commands. It is used for environments that do not | ||
require any commands. | ||
""" | ||
|
||
cfg: NullCommandGeneratorCfg | ||
"""Configuration for the command generator.""" | ||
|
||
""" | ||
Properties | ||
""" | ||
|
||
@property | ||
def command(self): | ||
"""Null command. | ||
Raises: | ||
RuntimeError: No command is generated. Always raises this error. | ||
""" | ||
raise RuntimeError("NullCommandGenerator does not generate any commands.") | ||
|
||
""" | ||
Implementation specific functions. | ||
""" | ||
|
||
def _resample_command(self, env_ids: Sequence[int]): | ||
pass | ||
|
||
def _update_command(self): | ||
pass | ||
|
||
def _update_metrics(self): | ||
pass |
This file contains 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 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 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 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
Oops, something went wrong.