| 
 | 1 | +#!/bin/bash  | 
 | 2 | + | 
 | 3 | +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.  | 
 | 4 | +# SPDX-License-Identifier: Apache-2.0  | 
 | 5 | + | 
 | 6 | +# Licensed under the Apache License, Version 2.0 (the "License");  | 
 | 7 | +# you may not use this file except in compliance with the License.  | 
 | 8 | +# You may obtain a copy of the License at  | 
 | 9 | + | 
 | 10 | +# http://www.apache.org/licenses/LICENSE-2.0  | 
 | 11 | + | 
 | 12 | +# Unless required by applicable law or agreed to in writing, software  | 
 | 13 | +# distributed under the License is distributed on an "AS IS" BASIS,  | 
 | 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  | 
 | 15 | +# See the License for the specific language governing permissions and  | 
 | 16 | +# limitations under the License.  | 
 | 17 | + | 
 | 18 | +set -e  | 
 | 19 | + | 
 | 20 | +# Get the parent directory of the current script  | 
 | 21 | +PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"  | 
 | 22 | + | 
 | 23 | +# Source utility functions  | 
 | 24 | +source "$PROJECT_ROOT/tools/env_setup/bash_utils.sh"  | 
 | 25 | + | 
 | 26 | +# Check if running in a conda environment  | 
 | 27 | +check_conda_env  | 
 | 28 | + | 
 | 29 | +# Ensure the parent third_party directory exists  | 
 | 30 | +mkdir -p "$PROJECT_ROOT/third_party"  | 
 | 31 | + | 
 | 32 | +# ---- Install IsaacSim ----  | 
 | 33 | +echo "Installing IsaacSim..."  | 
 | 34 | +pip install "isaacsim[all,extscache]==5.0.0" \  | 
 | 35 | +    git+https://github.com/isaac-for-healthcare/ [email protected] \  | 
 | 36 | +    --extra-index-url https://pypi.nvidia.com  | 
 | 37 | + | 
 | 38 | +ISAACLAB_DIR="$PROJECT_ROOT/third_party/IsaacLab"  | 
 | 39 | + | 
 | 40 | +if [ -d "$ISAACLAB_DIR" ]; then  | 
 | 41 | +    echo "IsaacLab directory already exists at $ISAACLAB_DIR. Skipping clone. Will use existing."  | 
 | 42 | +else  | 
 | 43 | +    echo "Cloning IsaacLab repository into $ISAACLAB_DIR..."  | 
 | 44 | +    git clone -b release/2.3.0 https://github.com/isaac-sim/IsaacLab.git "$ISAACLAB_DIR"  | 
 | 45 | +fi  | 
 | 46 | + | 
 | 47 | + | 
 | 48 | + | 
 | 49 | +pushd "$ISAACLAB_DIR"  | 
 | 50 | +echo "Installing IsaacLab ..."  | 
 | 51 | +yes Yes | ./isaaclab.sh --install  | 
 | 52 | +popd  | 
 | 53 | + | 
 | 54 | +# Remove top-level import of omni.log  | 
 | 55 | +sed -i '/^[[:space:]]*import omni\.log[[:space:]]*$/d' "$ISAACLAB_DIR/source/isaaclab/isaaclab/utils/math.py"  | 
 | 56 | + | 
 | 57 | +# Insert an indented local import immediately before each usage of omni.log.warn(  | 
 | 58 | +# This preserves the leading whitespace so the inserted import lives inside the function body  | 
 | 59 | +sed -i -E 's/^([[:space:]]*)omni\.log\.warn\(/\1import omni.log\  | 
 | 60 | +\1omni.log.warn(/g' "$ISAACLAB_DIR/source/isaaclab/isaaclab/utils/math.py"  | 
 | 61 | + | 
 | 62 | +echo "IsaacSim and dependencies installed successfully!"  | 
0 commit comments