Skip to content

Commit

Permalink
Update real-world examples to latest OIGE implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Feb 12, 2024
1 parent fa10010 commit 1281b2b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import torch
import numpy as np

from omni.isaac.core.utils.extensions import enable_extension
enable_extension("omni.replicator.isaac") # required by OIGE

from omniisaacgymenvs.tasks.base.rl_task import RLTask
from omniisaacgymenvs.robots.articulations.franka import Franka as Robot

Expand All @@ -27,6 +24,8 @@
"headless": True,
"sim_device": "gpu",
"enable_livestream": False,
"warp": False,
"seed": 42,
"task": {"name": "ReachingFranka",
"physics_engine": "physx",
"env": {"numEnvs": 1024,
Expand Down Expand Up @@ -86,6 +85,7 @@
"rest_offset": 0.0},
"target": {"override_usd_defaults": False,
"fixed_base": True,
"make_kinematic": True,
"enable_self_collisions": False,
"enable_gyroscopic_forces": True,
"solver_position_iteration_count": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
from skrl.trainers.torch import SequentialTrainer
from skrl.utils.omniverse_isaacgym_utils import get_env_instance
from skrl.envs.torch import wrap_env
from skrl.utils import set_seed


# Seed for reproducibility
seed = set_seed() # e.g. `set_seed(42)` for fixed seed


# Define only the policy for evaluation
Expand Down Expand Up @@ -37,6 +42,7 @@ def compute(self, inputs, role):
from omniisaacgymenvs.utils.config_utils.sim_config import SimConfig
from reaching_franka_omniverse_isaacgym_env import ReachingFrankaTask, TASK_CFG

TASK_CFG["seed"] = seed
TASK_CFG["headless"] = headless
TASK_CFG["task"]["env"]["numEnvs"] = 64
TASK_CFG["task"]["env"]["controlSpace"] = "joint" # "joint" or "cartesian"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from skrl.utils import set_seed


# set the seed for reproducibility
set_seed(42)
# Seed for reproducibility
seed = set_seed() # e.g. `set_seed(42)` for fixed seed


# Define the models (stochastic and deterministic models) for the agent using helper mixin.
Expand Down Expand Up @@ -62,6 +62,7 @@ def compute(self, inputs, role):
from omniisaacgymenvs.utils.config_utils.sim_config import SimConfig
from reaching_franka_omniverse_isaacgym_env import ReachingFrankaTask, TASK_CFG

TASK_CFG["seed"] = seed
TASK_CFG["headless"] = headless
TASK_CFG["task"]["env"]["numEnvs"] = 1024
TASK_CFG["task"]["env"]["controlSpace"] = "joint" # "joint" or "cartesian"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import torch
import numpy as np

from omni.isaac.core.utils.extensions import enable_extension
enable_extension("omni.replicator.isaac") # required by OIGE

from omniisaacgymenvs.tasks.base.rl_task import RLTask

from omni.isaac.core.prims import RigidPrimView
Expand All @@ -28,6 +25,8 @@
"headless": True,
"sim_device": "gpu",
"enable_livestream": False,
"warp": False,
"seed": 42,
"task": {"name": "ReachingIiwa",
"physics_engine": "physx",
"env": {"numEnvs": 1024,
Expand Down Expand Up @@ -87,6 +86,7 @@
"rest_offset": 0.0},
"target": {"override_usd_defaults": False,
"fixed_base": True,
"make_kinematic": True,
"enable_self_collisions": False,
"enable_gyroscopic_forces": True,
"solver_position_iteration_count": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
from skrl.trainers.torch import SequentialTrainer
from skrl.utils.omniverse_isaacgym_utils import get_env_instance
from skrl.envs.torch import wrap_env
from skrl.utils import set_seed


# Seed for reproducibility
seed = set_seed() # e.g. `set_seed(42)` for fixed seed


# Define only the policy for evaluation
Expand Down Expand Up @@ -37,6 +42,7 @@ def compute(self, inputs, role):
from omniisaacgymenvs.utils.config_utils.sim_config import SimConfig
from reaching_iiwa_omniverse_isaacgym_env import ReachingIiwaTask, TASK_CFG

TASK_CFG["seed"] = seed
TASK_CFG["headless"] = headless
TASK_CFG["task"]["env"]["numEnvs"] = 64
TASK_CFG["task"]["env"]["controlSpace"] = "joint" # "joint" or "cartesian"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from skrl.utils import set_seed


# set the seed for reproducibility
set_seed(42)
# Seed for reproducibility
seed = set_seed() # e.g. `set_seed(42)` for fixed seed


# Define the models (stochastic and deterministic models) for the agent using helper mixin.
Expand Down Expand Up @@ -62,6 +62,7 @@ def compute(self, inputs, role):
from omniisaacgymenvs.utils.config_utils.sim_config import SimConfig
from reaching_iiwa_omniverse_isaacgym_env import ReachingIiwaTask, TASK_CFG

TASK_CFG["seed"] = seed
TASK_CFG["headless"] = headless
TASK_CFG["task"]["env"]["numEnvs"] = 1024
TASK_CFG["task"]["env"]["controlSpace"] = "joint" # "joint" or "cartesian"
Expand Down

0 comments on commit 1281b2b

Please sign in to comment.