Commit f4548020 authored by matthewtrepte's avatar matthewtrepte Committed by Kelly Guo

Fixes if statement conditions in isaaclab install/launch script (#251)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->

Adding "-gt 0" to complete 2 if statement conditions in the launch
script.

Change is taken out of - https://github.com/isaac-sim/IsaacLab/pull/1622
by steple.

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarmatthewtrepte <mtrepte@nvidia.com>
parent 51cfcff5
...@@ -40,7 +40,7 @@ extract_isaacsim_path() { ...@@ -40,7 +40,7 @@ extract_isaacsim_path() {
# Use the python executable to get the path # Use the python executable to get the path
local python_exe=$(extract_python_exe) local python_exe=$(extract_python_exe)
# Retrieve the path importing isaac sim and getting the environment path # Retrieve the path importing isaac sim and getting the environment path
if [ $(${python_exe} -m pip list | grep -c 'isaacsim-rl') ]; then if [ $(${python_exe} -m pip list | grep -c 'isaacsim-rl') -gt 0 ]; then
local isaac_path=$(${python_exe} -c "import isaacsim; import os; print(os.environ['ISAAC_PATH'])") local isaac_path=$(${python_exe} -c "import isaacsim; import os; print(os.environ['ISAAC_PATH'])")
fi fi
fi fi
...@@ -73,7 +73,7 @@ extract_python_exe() { ...@@ -73,7 +73,7 @@ extract_python_exe() {
# note: we need to check system python for cases such as docker # note: we need to check system python for cases such as docker
# inside docker, if user installed into system python, we need to use that # inside docker, if user installed into system python, we need to use that
# otherwise, use the python from the kit # otherwise, use the python from the kit
if [ $(python -m pip list | grep -c 'isaacsim-rl') ]; then if [ $(python -m pip list | grep -c 'isaacsim-rl') -gt 0 ]; then
local python_exe=$(which python) local python_exe=$(which python)
fi fi
fi fi
...@@ -95,11 +95,13 @@ extract_python_exe() { ...@@ -95,11 +95,13 @@ extract_python_exe() {
extract_isaacsim_exe() { extract_isaacsim_exe() {
# obtain the isaac sim path # obtain the isaac sim path
local isaac_path=$(extract_isaacsim_path) local isaac_path=$(extract_isaacsim_path)
# python executable to use # isaac sim executable to use
local isaacsim_exe=${isaac_path}/isaac-sim.sh local isaacsim_exe=${isaac_path}/isaac-sim.sh
# check if there is a python path available # check if there is a python path available
if [ ! -f "${isaacsim_exe}" ]; then if [ ! -f "${isaacsim_exe}" ]; then
# check for installation using Isaac Sim pip # check for installation using Isaac Sim pip
# note: pip installed Isaac Sim can only come from a direct
# python environment, so we can directly use 'python' here
if [ $(python -m pip list | grep -c 'isaacsim-rl') -gt 0 ]; then if [ $(python -m pip list | grep -c 'isaacsim-rl') -gt 0 ]; then
# Isaac Sim - Python packages entry point # Isaac Sim - Python packages entry point
local isaacsim_exe="isaacsim isaacsim.exp.full" local isaacsim_exe="isaacsim isaacsim.exp.full"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment