From 07735cdc8e7fc5d6cb0bff9ef4e762ae06665743 Mon Sep 17 00:00:00 2001 From: robotsfan Date: Tue, 19 Nov 2024 19:35:04 +0800 Subject: [PATCH] Bug fix (#41) # Description - [add save_path to data_collect.py](https://github.com/leggedrobotics/viplanner/commit/9889c1f829849ecbf3d761a46b3aa219a734dafe) - [fix readme script error](https://github.com/leggedrobotics/viplanner/commit/3fc7ed36d0096a720eb5465efcabc516f4be3a2f) - [updated the import path for MatterportSemanticCostMapping from `nav_collectors.configs` to `omni.viplanner.config`](https://github.com/leggedrobotics/viplanner/commit/3e54ca2dc988644f05318d65349b778884d98b95) - [in headless mode, we cannot visualize the graph and omni.debug.draw is not available](https://github.com/leggedrobotics/viplanner/commit/bc5af14c093aaef6455910c4857956bd980e98d8) ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./formatter.sh` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings --------- Co-authored-by: Pascal Roth <57946385+pascal-roth@users.noreply.github.com> --- omniverse/README.md | 2 +- .../omni/viplanner/collectors/terrain_analysis_cfg.py | 2 +- .../omni/viplanner/viplanner/viplanner_algo.py | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/omniverse/README.md b/omniverse/README.md index 9bd12b6..9440fa4 100644 --- a/omniverse/README.md +++ b/omniverse/README.md @@ -129,7 +129,7 @@ The rendered viewpoints are collected by executing ``` cd IsaacLab -./isaaclab.sh -p /omniverse/standalone/viplanner_demo.py --scene --num_samples +./isaaclab.sh -p /omniverse/standalone/data_collect.py --scene --num_samples ``` To test that the data has been correctly extracted, please run the 3D reconstruction and see if the results fits to the simulated environment. diff --git a/omniverse/extension/omni.viplanner/omni/viplanner/collectors/terrain_analysis_cfg.py b/omniverse/extension/omni.viplanner/omni/viplanner/collectors/terrain_analysis_cfg.py index 8f2f076..dd11c82 100644 --- a/omniverse/extension/omni.viplanner/omni/viplanner/collectors/terrain_analysis_cfg.py +++ b/omniverse/extension/omni.viplanner/omni/viplanner/collectors/terrain_analysis_cfg.py @@ -6,7 +6,7 @@ from __future__ import annotations -from nav_collectors.configs import MatterportSemanticCostMapping +from omni.viplanner.config import MatterportSemanticCostMapping from omni.isaac.lab.utils import configclass diff --git a/omniverse/extension/omni.viplanner/omni/viplanner/viplanner/viplanner_algo.py b/omniverse/extension/omni.viplanner/omni/viplanner/viplanner/viplanner_algo.py index 5fe4859..6247083 100644 --- a/omniverse/extension/omni.viplanner/omni/viplanner/viplanner/viplanner_algo.py +++ b/omniverse/extension/omni.viplanner/omni/viplanner/viplanner/viplanner_algo.py @@ -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 @@ -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]