@@ -24,28 +24,40 @@ export ISAACLAB_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && p
24
24
25
25
# extract isaac sim path
26
26
extract_isaacsim_path () {
27
- # Check if IsaacSim directory manually specified
28
- # Note: for manually build isaacsim, this: _build/linux-x86_64/release
29
- if [ ! -z ${ISAACSIM_PATH} ];
30
- then
31
- # Use local build (for internal development) or user specified path
32
- local isaac_path=${ISAACSIM_PATH}
33
- else
34
- # Check if we have pip package installed
35
- if [ $( pip list | grep -c ' isaacsim-rl' ) ]; then
36
- # Use the python executable to get the path
37
- local python_exe=$( extract_python_exe)
38
- # Retrieve the path importing isaac sim and getting the environment path
27
+ # Check if we have pip package installed inside conda environment
28
+ if ! [[ -z " ${CONDA_PREFIX} " ]]; then
29
+ # Use the python executable to get the path
30
+ local python_exe=${CONDA_PREFIX} /bin/python
31
+ # Retrieve the path importing isaac sim and getting the environment path
32
+ if [ $( ${python_exe} -m pip list | grep -c ' isaacsim-rl' ) ]; then
39
33
local isaac_path=$( ${python_exe} -c " import isaacsim; import os; print(os.environ['ISAAC_PATH'])" )
40
34
else
41
- # Use the sym-link path to Isaac Sim directory
42
- local isaac_path=${ISAACLAB_PATH} /_isaac_sim
35
+ # If package not installed, use an empty path for failure
36
+ local isaac_path=' '
43
37
fi
38
+ elif command -v python & > /dev/null; then
39
+ # Use the python executable to get the path
40
+ local python_exe=$( which python)
41
+ # Retrieve the path importing isaac sim and getting the environment path
42
+ if [ $( ${python_exe} -m pip list | grep -c ' isaacsim-rl' ) ]; then
43
+ local isaac_path=$( ${python_exe} -c " import isaacsim; import os; print(os.environ['ISAAC_PATH'])" )
44
+ else
45
+ # If package not installed, use an empty path for failure
46
+ local isaac_path=' '
47
+ fi
48
+ else
49
+ # Use the sym-link path to Isaac Sim directory
50
+ local isaac_path=${ISAACLAB_PATH} /_isaac_sim
44
51
fi
45
52
# check if there is a path available
46
53
if [ ! -d " ${isaac_path} " ]; then
47
- echo " [ERROR] No Isaac Sim directory found at path: ${isaac_path} " >&2
48
- echo " [ERROR] Please specify the path to the Isaac Sim directory using 'ISAACSIM_PATH' environment variable." >&2
54
+ # throw an error if no path is found
55
+ echo -e " [ERROR] Unable to find the Isaac Sim directory: '${isaac_path} '" >&2
56
+ echo -e " \tThis could be due to the following reasons:" >&2
57
+ echo -e " \t1. Conda environment is not activated." >&2
58
+ echo -e " \t2. Isaac Sim pip package 'isaacsim-rl' is not installed." >&2
59
+ echo -e " \t3. Isaac Sim directory is not available at the default path: ${ISAACLAB_PATH} /_isaac_sim" >&2
60
+ # exit the script
49
61
exit 1
50
62
fi
51
63
# return the result
@@ -58,27 +70,33 @@ extract_python_exe() {
58
70
if ! [[ -z " ${CONDA_PREFIX} " ]]; then
59
71
# use conda python
60
72
local python_exe=${CONDA_PREFIX} /bin/python
61
- else
62
- # check if pip package is installed
63
- if [ $( pip list | grep -c ' isaacsim-rl' ) ]; then
64
- # use current python executable
73
+ elif command -v python & > /dev/null; then
74
+ # use the python executable to get the path
75
+ if [ $( ${python_exe} -m pip list | grep -c ' isaacsim-rl' ) ]; then
65
76
local python_exe=$( which python)
66
77
else
67
- # obtain the isaac sim path
68
- local isaac_path=$( extract_isaacsim_path)
69
- # use python from kit
70
- local python_exe=${isaac_path} /python.sh
78
+ # leave a blank path for failure
79
+ local python_exe=' '
71
80
fi
81
+ else
82
+ # obtain the isaac sim path
83
+ local isaac_path=$( extract_isaacsim_path)
84
+ # use python from kit
85
+ local python_exe=${isaac_path} /python.sh
72
86
fi
73
87
# check if there is a python path available
74
88
if [ ! -f " ${python_exe} " ]; then
75
- echo " [ERROR] No python executable found at path: ${python_exe} " >&2
89
+ echo -e " [ERROR] Unable to find any Python executable at path: '${python_exe} '" >&2
90
+ echo -e " \tThis could be due to the following reasons:" >&2
91
+ echo -e " \t1. Conda environment is not activated." >&2
92
+ echo -e " \t2. Isaac Sim pip package 'isaacsim-rl' is not installed." >&2
93
+ echo -e " \t3. Python executable is not available at the default path: ${ISAACLAB_PATH} /_isaac_sim/python.sh" >&2
76
94
exit 1
77
95
fi
78
96
# kit dependencies are built with python 3.10 so any other version will not work
79
97
# this is needed in case users have multiple python versions installed and the wrong one is being used
80
98
if [ " $( ${python_exe} --version | grep -c ' 3.10' ) " -eq 0 ]; then
81
- echo " [ERROR] Found version: $( ${python_exe} --version) while expecting 3.10. Please use the correct python version." >&2
99
+ echo " [ERROR] Found Python version: $( ${python_exe} --version) while expecting 3.10. Please use the correct python version." >&2
82
100
exit 1
83
101
fi
84
102
# return the result
@@ -261,8 +279,6 @@ while [[ $# -gt 0 ]]; do
261
279
fi
262
280
# install the rl-frameworks specified
263
281
${python_exe} -m pip install -e ${ISAACLAB_PATH} /source/extensions/omni.isaac.lab_tasks[" ${framework_name} " ]
264
- # setup vscode settings
265
- update_vscode_settings
266
282
# unset local variables
267
283
unset extract_python_exe
268
284
unset install_isaaclab_extension
0 commit comments