rofunc.learning.RofuncRL.tasks.utils.env_loaders#

1.  Module Contents#

1.1.  Functions#

cwd

Context manager to change the current working directory

load_isaacgym_env_preview2

Load an Isaac Gym environment (preview 2)

load_isaacgym_env_preview3

Load an Isaac Gym environment (preview 3)

load_isaacgym_env_preview4

Load an Isaac Gym environment (preview 4)

load_omniverse_isaacgym_env

Load an Omniverse Isaac Gym environment

load_isaac_orbit_env

Load an Isaac Orbit environment

1.2.  API#

rofunc.learning.RofuncRL.tasks.utils.env_loaders.cwd(new_path: str) None[source]#

Context manager to change the current working directory

This function restores the current working directory after the context manager exits

Parameters:

new_path (str) – The new path to change to

rofunc.learning.RofuncRL.tasks.utils.env_loaders.load_isaacgym_env_preview2(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)[source]#

Load an Isaac Gym environment (preview 2)

Parameters:
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (--task TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the rlgpu directory (default: “”). If empty, the path will obtained from isaacgym package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises:
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgym package is not installed or the path is wrong

Returns:

Isaac Gym environment (preview 2)

Return type:

tasks.base.vec_task.VecTask

rofunc.learning.RofuncRL.tasks.utils.env_loaders.load_isaacgym_env_preview3(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)[source]#

Load an Isaac Gym environment (preview 3)

Isaac Gym benchmark environments: NVIDIA-Omniverse/IsaacGymEnvs

Parameters:
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (task=TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the isaacgymenvs directory (default: “”). If empty, the path will obtained from isaacgymenvs package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises:
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgymenvs package is not installed or the path is wrong

Returns:

Isaac Gym environment (preview 3)

Return type:

isaacgymenvs.tasks.base.vec_task.VecTask

rofunc.learning.RofuncRL.tasks.utils.env_loaders.load_isaacgym_env_preview4(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)[source]#

Load an Isaac Gym environment (preview 4)

Isaac Gym benchmark environments: NVIDIA-Omniverse/IsaacGymEnvs

Parameters:
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (task=TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the isaacgymenvs directory (default: “”). If empty, the path will obtained from isaacgymenvs package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises:
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgymenvs package is not installed or the path is wrong

Returns:

Isaac Gym environment (preview 4)

Return type:

isaacgymenvs.tasks.base.vec_task.VecTask

rofunc.learning.RofuncRL.tasks.utils.env_loaders.load_omniverse_isaacgym_env(task_name: str = '', omniisaacgymenvs_path: str = '', show_cfg: bool = True, multi_threaded: bool = False, timeout: int = 30)[source]#

Load an Omniverse Isaac Gym environment

Omniverse Isaac Gym benchmark environments: NVIDIA-Omniverse/OmniIsaacGymEnvs

Parameters:
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (task=TASK_NAME). Command line argument has priority over function parameter if both are specified

  • omniisaacgymenvs_path (str, optional) – The path to the rofunc.learning.RofuncRL.tasks.omniisaacgym directory (default: “”). If empty, the path will obtained from rofunc.learning.RofuncRL.tasks.omniisaacgym package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

  • multi_threaded (bool, optional) – Whether to use multi-threaded environment (default: False)

  • timeout (int, optional) – Seconds to wait for data when queue is empty in multi-threaded environment (default: 30)

Raises:
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The rofunc.learning.RofuncRL.tasks.omniisaacgym package is not installed or the path is wrong

Returns:

Omniverse Isaac Gym environment

Return type:

omni.isaac.gym.vec_env.vec_env_base.VecEnvBase or omni.isaac.gym.vec_env.vec_env_mt.VecEnvMT

rofunc.learning.RofuncRL.tasks.utils.env_loaders.load_isaac_orbit_env(task_name: str = '', show_cfg: bool = True)[source]#

Load an Isaac Orbit environment

Isaac Orbit: https://isaac-orbit.github.io/orbit/index.html

This function includes the definition and parsing of command line arguments used by Isaac Orbit:

  • --headless: Force display off at all times

  • --cpu: Use CPU pipeline

  • --num_envs: Number of environments to simulate

  • --task: Name of the task

  • --num_envs: Seed used for the environment

Parameters:
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (--task TASK_NAME). Command line argument has priority over function parameter if both are specified

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises:

ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

Returns:

Isaac Orbit environment

Return type:

gym.Env