-
Notifications
You must be signed in to change notification settings - Fork 858
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 different render modes to IsaacEnv
#63
Merged
Merged
Conversation
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
Mayankm96
force-pushed
the
feature/render-modes
branch
from
April 14, 2023 14:15
a4c346c
to
0f15911
Compare
Mayankm96
force-pushed
the
feature/render-modes
branch
from
April 14, 2023 14:23
f1ca2f9
to
5117a3c
Compare
Currently this PR is generating the following error which needs to be fixed before merging it.
The issue is something to do with the enabled extensions. Here's the minimal repro: import os
from omni.isaac.kit import SimulationApp
# launch omniverse app
app_experience = f"{os.environ['EXP_PATH']}/omni.isaac.sim.python.gym.headless.render.kit"
config = {"headless": True}
simulation_app = SimulationApp(config, experience=app_experience)
import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.core.simulation_context import SimulationContext
from omni.isaac.core.utils.viewports import set_camera_view
from omni.isaac.core.world import World
def main():
"""Spawns lights in the stage and sets the camera view."""
# Load kit helper
sim = World(physics_dt=0.01, rendering_dt=0.01, backend="torch")
# Set main camera
set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0])
# Spawn things into stage
# Lights-1
prim_utils.create_prim(
"/World/Light/GreySphere",
"SphereLight",
translation=(4.5, 3.5, 10.0),
attributes={"radius": 2.5, "intensity": 600.0, "color": (0.75, 0.75, 0.75)},
)
# Lights-2
prim_utils.create_prim(
"/World/Light/WhiteSphere",
"SphereLight",
translation=(-4.5, 3.5, 10.0),
attributes={"radius": 2.5, "intensity": 600.0, "color": (1.0, 1.0, 1.0)},
)
# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Simulate physics
while simulation_app.is_running():
# If simulation is stopped, then exit.
if sim.is_stopped():
break
# If simulation is paused, then skip.
if not sim.is_playing():
sim.step(render=not simulation_app.config["headless"])
continue
# perform step
sim.step()
if __name__ == "__main__":
# Run empty stage
main()
# Close the simulator
simulation_app.close() |
1 task
Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Mayankm96
force-pushed
the
feature/render-modes
branch
from
April 27, 2023 18:52
166f83f
to
b6e571d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR updates the
IsaacEnv
class to support different rendering modes (as suggested by OpenAI Gym documentation). This allows users to also record videos using the environment by using thegym.wrapper.RecordVideo
wrapper.To enable rendering of the viewport, the user needs to set
viewport=True
while initializing the environment. This flag will enable extensions required to create the renderer. It is to note that enabling the viewport will lead to a certain performance drop.As an example of creating the environment while running headless but enabling the rendering:
Additionally, all workflows
train.py
have been updated to take the command line argumentvideo
that performs the above wrapping and saves videos into the experiment logging directory.Fixes OIGE #17
Type of change
Screenshots
Running the above command will generate a video similar to the follows. The resolution of the image can be changed through the
IsaacEnvCfg.ViewerCfg.resolution
. By default it is 1280 x 720.rl-video-step-1500.mp4
Checklist
pre-commit
checks with./orbit.sh --format
config/extension.toml
file