8686
8787# Third-party imports
8888import gymnasium as gym
89+ import logging
8990import os
9091import time
9192import torch
9293
9394import isaaclab_mimic .envs # noqa: F401
9495
95- # Omniverse logger
96- import omni .log
9796import omni .ui as ui
9897from isaaclab .devices import Se3Keyboard , Se3KeyboardCfg , Se3SpaceMouse , Se3SpaceMouseCfg
9998from isaaclab .devices .openxr import remove_camera_configs
10099from isaaclab .devices .teleop_device_factory import create_teleop_device
100+
101+ logger = logging .getLogger (__name__ )
101102from isaaclab_mimic .ui .instruction_display import InstructionDisplay , show_subtask_instructions
102103
103104# Imports have to follow simulation startup.
@@ -196,7 +197,7 @@ def create_environment_config(
196197 env_name , env_cfg = arena_builder .build_registered ()
197198
198199 except Exception as e :
199- omni . log .error (f"Failed to parse environment configuration: { e } " )
200+ logger .error (f"Failed to parse environment configuration: { e } " )
200201 exit (1 )
201202
202203 # extract success checking function to invoke in the main loop
@@ -205,7 +206,7 @@ def create_environment_config(
205206 success_term = env_cfg .terminations .success
206207 env_cfg .terminations .success = None
207208 else :
208- omni . log . warn (
209+ logger . warning (
209210 "No success termination term was found in the environment."
210211 " Will not be able to mark recorded demos as successful."
211212 )
@@ -246,7 +247,7 @@ def create_environment(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg, env_name:
246247 env = gym .make (env_name , cfg = env_cfg ).unwrapped
247248 return env
248249 except Exception as e :
249- omni . log .error (f"Failed to create environment: { e } " )
250+ logger .error (f"Failed to create environment: { e } " )
250251 exit (1 )
251252
252253
@@ -271,26 +272,26 @@ def setup_teleop_device(callbacks: dict[str, Callable]) -> object:
271272 if hasattr (env_cfg , "teleop_devices" ) and args_cli .teleop_device in env_cfg .teleop_devices .devices :
272273 teleop_interface = create_teleop_device (args_cli .teleop_device , env_cfg .teleop_devices .devices , callbacks )
273274 else :
274- omni . log . warn (f"No teleop device '{ args_cli .teleop_device } ' found in environment config. Creating default." )
275+ logger . warning (f"No teleop device '{ args_cli .teleop_device } ' found in environment config. Creating default." )
275276 # Create fallback teleop device
276277 if args_cli .teleop_device .lower () == "keyboard" :
277278 teleop_interface = Se3Keyboard (Se3KeyboardCfg (pos_sensitivity = 0.2 , rot_sensitivity = 0.5 ))
278279 elif args_cli .teleop_device .lower () == "spacemouse" :
279280 teleop_interface = Se3SpaceMouse (Se3SpaceMouseCfg (pos_sensitivity = 0.2 , rot_sensitivity = 0.5 ))
280281 else :
281- omni . log .error (f"Unsupported teleop device: { args_cli .teleop_device } " )
282- omni . log .error ("Supported devices: keyboard, spacemouse, avp_handtracking" )
282+ logger .error (f"Unsupported teleop device: { args_cli .teleop_device } " )
283+ logger .error ("Supported devices: keyboard, spacemouse, avp_handtracking" )
283284 exit (1 )
284285
285286 # Add callbacks to fallback device
286287 for key , callback in callbacks .items ():
287288 teleop_interface .add_callback (key , callback )
288289 except Exception as e :
289- omni . log .error (f"Failed to create teleop device: { e } " )
290+ logger .error (f"Failed to create teleop device: { e } " )
290291 exit (1 )
291292
292293 if teleop_interface is None :
293- omni . log .error ("Failed to create teleop interface" )
294+ logger .error ("Failed to create teleop interface" )
294295 exit (1 )
295296
296297 return teleop_interface
0 commit comments