Skip to content

Commit 429e671

Browse files
committed
issaclab: install on python env and update to 2.3.0
* That way the reinstall is skipped when recreating the container * Also allow to update isaacsim because the container use python3.10 by default * Update README.md * devcontainer: fix hooks scripts Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
1 parent 7058abb commit 429e671

File tree

5 files changed

+78
-22
lines changed

5 files changed

+78
-22
lines changed

.devcontainer/hooks/postCreate.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,10 @@ if [ -h "$WORKSPACE_ROOT/rob_ws" ] && [ -h "$WORKSPACE_ROOT/trsa_ws" ]; then
2727
echo "source $WORKSPACE_ROOT/trsa_ws/install/setup.bash" >> ~/.bashrc
2828
fi
2929

30-
if [ -d "/home/$USERNAME/isaac_ros-dev" ]; then
31-
ln -sf /home/$USERNAME/isaac_ros-dev "$WORKSPACE_ROOT/"
32-
mkdir -p /home/$USERNAME/isaac_ros-dev || continue
33-
echo "export ISAAC_ROS_WS=/home/$USERNAME/isaac_ros-dev" >> ~/.bashrc
34-
fi
35-
3630
# Add useful allias
3731
echo 'alias ros2_cmake_pkg="ros2 pkg create --build-type ament_cmake"' >> ~/.bashrc
3832
echo 'alias ros2_python_pkg="ros2 pkg create --build-type ament_python"' >> ~/.bashrc
3933

4034
# Something deleted the package indexes so we re-download them for convenience.
4135
sudo apt-get update
42-
sudo rosdep update
36+
rosdep update

.devcontainer/hooks/postStart.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ git config --global safe.directory "*"
1414
git submodule update --init --recursive
1515

1616
# Ensure dependencies are installed.
17-
sudo rosdep install --ignore-src --from-path "/home/$USERNAME/rob_ws" -y
18-
sudo rosdep install --ignore-src --from-path "/home/$USERNAME/trsa_ws" -y
19-
sudo rosdep install --ignore-src --from-path "/home/$USERNAME/isaac_ros-dev" -y || continue
20-
sudo pip install -r "$WORKSPACE_ROOT/requirements.txt"
17+
rosdep install --ignore-src --from-path "/home/$USERNAME/rob_ws" -y
18+
rosdep install --ignore-src --from-path "/home/$USERNAME/trsa_ws" -y
19+
rosdep install --ignore-src --from-path "/home/$USERNAME/isaac_ros-dev" -y || continue
20+
pip install -r "$WORKSPACE_ROOT/requirements.txt"
21+
22+
# Install IsaacLab and IsaacSim if isaac_ros-dev exist
23+
if [ -d "/home/$USERNAME/isaac_ros-dev" ]; then
24+
ln -sf /home/$USERNAME/isaac_ros-dev "$WORKSPACE_ROOT/"
25+
echo "export ISAAC_ROS_WS=/home/$USERNAME/isaac_ros-dev" >> ~/.bashrc
26+
echo "Installing Isaac Sim and Isaac Lab"
27+
$WORKSPACE_ROOT/.devcontainer/scripts/issaclab-pyenv.sh
28+
echo 'alias issacload="source ~/isaac_ros-dev/env_isaacsim/bin/activate"' >> ~/.bashrc
29+
fi
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# This script installs Isaac Sim and Isaac Lab using a Python virtual environment
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
set -e
7+
echo ""
8+
echo "====================================================================="
9+
echo "Installing Isaac Sim + Isaac Lab Python Environment"
10+
echo "====================================================================="
11+
echo "Environment Path: isaac_ros-dev/env_isaacsim"
12+
echo "Python Version: 3.11"
13+
echo "---------------------------------------------------------------------"
14+
echo ""
15+
16+
# --- Install Python and create venv ---
17+
if ! command -v python3.11 &> /dev/null; then
18+
sudo apt-get update -y && sudo apt-get install -y python3.11 python3.11-venv
19+
fi
20+
21+
if [ -d "isaac_ros-dev/env_isaacsim" ]; then
22+
echo "Existing environment detected at isaac_ros-dev/env_isaacsim."
23+
echo "Skipping environment creation and package installation."
24+
echo ""
25+
echo "To activate later, run:"
26+
echo " source isaac_ros-dev/env_isaacsim/bin/activate"
27+
echo " or use the `issacload` alias"
28+
echo ""
29+
echo " Or, create that handy alias if dosent exit:"
30+
echo " echo 'alias issacload="source ~/isaac_ros-dev/env_isaacsim/bin/activate"' >> ~/.bashrc"
31+
echo "====================================================================="
32+
echo ""
33+
fi
34+
35+
python3.11 -m venv isaac_ros-dev/env_isaacsim
36+
source isaac_ros-dev/env_isaacsim/bin/activate
37+
38+
# Pip Install for Isaac Sim and Isaac Lab dependencies (you can edit the version)
39+
pip install --upgrade pip
40+
pip install isaaclab[isaacsim,all]==2.2.0 --extra-index-url https://pypi.nvidia.com
41+
pip install -U torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu129
42+
pip install git+https://github.com/isaac-sim/rl_games.git@python3.11
43+
44+
# --- Fancy End Banner ---
45+
echo ""
46+
echo "====================================================================="
47+
echo " Installation Complete!"
48+
echo "====================================================================="
49+
echo "Isaac Sim + Isaac Lab environment is ready to use."
50+
echo "Location: isaac_ros-dev/env_isaacsim"
51+
echo ""
52+
echo "To activate later, run:"
53+
echo " source isaac_ros-dev/env_isaacsim/bin/activate"
54+
echo " or use the `issacload` alias"
55+
echo ""
56+
echo " Or, create that handy alias if dosent exit:"
57+
echo " echo 'alias issacload="source ~/isaac_ros-dev/env_isaacsim/bin/activate"' >> ~/.bashrc"
58+
echo "====================================================================="
59+
echo ""

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ There are two alias that can be used to create ros packages:
4747
- `ros2_cmake_pkg`: Create a Ros2 C/C++ package in the current directory
4848
- `ros2_python_pkg`: Create a Ros2 Python package in the current directory
4949

50+
There also alias to auto-load the Isaac Sim and Issac Lab python envrioment, called `isaacload`
51+
This enviroment is only created `isaac_ros-dev` folder is mounted in the container, look at [`postCreate.sh`](./.devcontainer/hooks/postCreate.sh) and [`issaclab-pyenv.sh`](./.devcontainer/scripts/issaclab-pyenv.sh)
52+
5053
### VS Code Tasks
5154

5255
For developer convenience, some common tasks are present in [`tasks.json`](./.vscode/tasks.json). Use them by opening the Command Palette and typing `task`. The following tasks are available:

requirements.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
# Compose `requirements.txt` from ROS packages into here.
2-
3-
# Example:
4-
5-
# Install this one intel systems
2+
# Install this intel systems
63
#--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
74
#intel-extension-for-pytorch==2.6.10+xpu
85
#oneccl_bind_pt==2.6.0+xpu
9-
106
torch
117
torchvision
128
torchaudio
139
ultralytics
1410
numpy<2
1511
kconfiglib
1612
pyros-genmsg
17-
future
18-
19-
# For issaclab and issacsim (optional)
20-
#--extra-index-url https://pypi.nvidia.com
21-
#isaaclab[isaacsim,all]==2.1.0
22-
#isaacsim[all,extscache]==4.5.0
13+
future

0 commit comments

Comments
 (0)