Skip to content

Commit

Permalink
in headless mode, we cannot visualize the graph and omni.debug.draw i…
Browse files Browse the repository at this point in the history
…s not available
  • Loading branch information
fan-ziqi committed Nov 19, 2024
1 parent 3e54ca2 commit bc5af14
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import omni.isaac.lab.utils.math as math_utils
import torch
import torchvision.transforms as transforms
from omni.isaac.debug_draw import _debug_draw

from viplanner.config import TrainCfg

Expand Down Expand Up @@ -51,7 +50,12 @@ def __init__(self, model_dir: str, fear_threshold: float = 0.5, device: str = "c
self.traj_generate = TrajOpt()

# setup waypoint display in Isaac
self.draw = _debug_draw.acquire_debug_draw_interface()
# in headless mode, we cannot visualize the graph and omni.debug.draw is not available
try:
import omni.isaac.debug_draw._debug_draw as omni_debug_draw
self.draw = omni_debug_draw.acquire_debug_draw_interface()
except ImportError:
print("[WARNING] Graph Visualization is not available in headless mode.")
self.color_fear = [(1.0, 0.4, 0.1, 1.0)] # red
self.color_path = [(0.4, 1.0, 0.1, 1.0)] # green
self.size = [5.0]
Expand Down

0 comments on commit bc5af14

Please sign in to comment.