Isaac Sim - gkgkgk1215/else GitHub Wiki

Isaac Sim

Install NVIDIA Driver, CUDA

Verify the Isaac Sim installation

  • Environmental variables: Input the following lines in the bash file:
# Isaac Sim root directory
export ISAACSIM_PATH="${HOME}/.local/share/ov/pkg/isaac-sim-4.1.0"
# Isaac Sim python executable
export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh"
  • Check that the simulator runs as expected:
source ~/.bashrc
# note: you can pass the argument "--help" to see all arguments possible.
${ISAACSIM_PATH}/isaac-sim.sh
  • Check that the simulator runs from a standalone python script:
# checks that python path is set correctly
${ISAACSIM_PYTHON_EXE} -c "print('Isaac Sim configuration is now complete.')"
# checks that Isaac Sim can be launched from python
${ISAACSIM_PYTHON_EXE} ${ISAACSIM_PATH}/standalone_examples/api/omni.isaac.core/add_cubes.py
${ISAACSIM_PYTHON_EXE} ${ISAACSIM_PATH}/standalone_examples/api/omni.isaac.franka/follow_target_with_rmpflow.py

Setup Anaconda environment (not necessary)

  • Create environment
cd ${ISAACSIM_PATH}
conda remove --name isaac-sim --all
conda env create -f environment.yml
conda activate isaac-sim
source setup_conda_env.sh

Install PyTorch (deprecated)

(testing) conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia
pip install torch==2.2.2 --index-url https://download.pytorch.org/whl/cu121
  • Verify PyTorch
import torch
print(torch.cuda.is_available())
print(torch.__version__)

VS Code Setting (Option 1)

"env": {
    "RESOURCE_NAME": "IsaacSim",
    "PYTHONPATH": "${workspaceFolder}/vsprojects:${workspaceFolder}/lecture"
},
  • Terminal--Run Task--"setup_python_env"--"Continue without scanning the task output.
  • Check ".standalone_examples.env" file is created in the ".vscode" folder.
  • Open ${ISAACSIM_PATH}/standalone_examples/api/omni.isaac.franka/follow_target_with_rmpflow.py and start debugging (Ctrk+F5 or F5)

VS Code Setting (Option 2)

Isaac Lab

git clone https://github.com/isaac-sim/IsaacLab.git
  • Create Isaac Sim Symbolic Link
cd IsaacLab
ln -s /home/minho/.local/share/ov/pkg/isaac-sim-4.1.0 _isaac_sim
  • Setting up the conda environment (optional)
conda remove --name minho --all
conda create -n minho python=3.10
./isaaclab.sh --conda minho
  • Installation

If you choose to install in your conda env, you should conda activate minho before execuding the following lines.

Installing Isaac Lab in the conda env causes the import issue when Isaac-Sim launching by Omniverse, since the Omniverse launcher uses the basic env. (w/o conda).

sudo apt install cmake build-essential
conda activate minho
./isaaclab.sh --install

Verify the Isaac Lab installation

# Option 1: Using the isaaclab.sh executable
# note: this works for both the bundled python and the virtual environment
./isaaclab.sh -p source/standalone/tutorials/00_sim/create_empty.py

# Option 2: Using python in your virtual environment
python source/standalone/tutorials/00_sim/create_empty.py

Orbit Surgical

# Set the IsaacLab_PATH environment variable to point to your Isaac Lab installation directory
export IsaacLab_PATH="${HOME}/IsaacLab"
  • Clone ORBIT-Surgical repository to a directory outside the Isaac Lab installation directory:
cd ~
git clone https://github.com/orbit-surgical/orbit-surgical
  • Install ORBIT-Surgical
conda activate minho
cd orbit-surgical/
./orbitsurgical.sh

Set up IDE

To setup the IDE, please follow these instructions:

  1. Open the ORBIT-Surgical directory on Visual Studio Code IDE.
  2. Run VSCode Tasks, by pressing Ctrl+Shift+P, selecting Tasks: Run Task and running the setup_python_env in the drop down menu. When running this task, you will be prompted to add the absolute path to your Isaac Sim installation.

Set your conda environment as the default interpreter in VSCode by opening the command palette (Ctrl+Shift+P), choosing Python: Select Interpreter and selecting your conda environment.

If everything executes correctly, it should create a file .python.env in the .vscode directory. The file contains the python paths to all the extensions provided by Isaac Sim and Omniverse. This helps in indexing all the python modules for intelligent suggestions while writing code.

Verification using Teleoperation

We provide interfaces for providing commands in SE(2) and SE(3) space for robot control. In case of SE(2) teleoperation, the returned command is the linear x-y velocity and yaw rate, while in SE(3), the returned command is a 6-D vector representing the change in pose.

To play inverse kinematics (IK) control with a keyboard device:

${IsaacLab_PATH}/isaaclab.sh -p source/standalone/environments/teleoperation/teleop_se3_agent.py --task Isaac-Lift-Needle-PSM-IK-Rel-v0 --num_envs 1 --teleop_device keyboard

The script prints the teleoperation events configured. For keyboard, these are as follows:

Keyboard Controller for SE(3): Se3Keyboard
    Reset all commands: L
    Toggle gripper (open/close): K
    Move arm along x-axis: W/S
    Move arm along y-axis: A/D
    Move arm along z-axis: Q/E
    Rotate arm along x-axis: Z/X
    Rotate arm along y-axis: T/G
    Rotate arm along z-axis: C/V

Trouble Shooting

No module named pip

cd ${ISAACSIM_PATH}
./python.sh -m ensurepip (reinstall pip)
./python.sh -m pip install numpy==1.22.2 (compatible version with Isaac Sim)

Diverge when collide with ground

  • ground์— ์ถฉ๋Œ์‹œ ๋ฐ˜์ž‘์šฉ์œผ๋กœ ๋กœ๋ด‡์ด ํŠ•๊ฒจ๋‚˜์˜ค๋ฉด์„œ ๋ฐœ์‚ฐํ•จ (ground๋Š” 'fixed' ํŠน์„ฑ์„ ๊ฐ€์ง.)
  • ground๋ฅผ obstacle๋กœ ์ธ์‹ํ•˜๋„๋ก ํ•˜๊ฑฐ๋‚˜ z-position ๊ฐ’์ด ์Œ์ˆ˜๊ฐ€ ๋˜์ง€ ์•Š๋„๋ก ์„ค์ •ํ•ด์•ผ ํ•จ.
  • ์œ ์‚ฌํ•˜๊ฒŒ, box๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ground ์•„๋ž˜๋กœ ๋Œ์–ด๋‚ด๋ฆฌ๋ฉด ํŠ•๊ฒจ๋‚˜๊ฐ. ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ ์ž์ฒด physics๊ฐ€ ๊ทธ๋ ‡๊ฒŒ ์„ค์ •๋˜์–ด์žˆ๋Š” ๋“ฏ.

UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown

  • import matplotlib.pyplot as plt
  • plt.show() ํ•จ์ˆ˜ ํ˜ธ์ถœ์‹œ ๋ฐœ์ƒ
  • ์ตœ์‹  ๋ฒ„์ ผ์˜ PyQt5๋ฅผ ์„ค์น˜ํ•ด์ฃผ๋ฉด ๋จ. (Isaac Sim ํ™˜๊ฒฝ์—์„œ๋Š” ./python.sh -m pip install PyQt5==5.14.1)

imshow() during launching simulation_app

  • simulation_app๊ณผ cv2.imshow()๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Œ. ์•„๋งˆ๋„ Qt๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด์„œ ์ถฉ๋Œ์ด ์žˆ๋Š”๋“ฏ.
  • ๋”ฐ๋ผ์„œ ์บก์ณํ•œ ์ด๋ฏธ์ง€๋ฅผ ํ™•์ธํ•˜๊ณ  ์‹ถ์œผ๋ฉด, plt.show()๋ฅผ ํ™œ์šฉํ•ด์•ผ ํ•จ.
import matplotlib.pyplot as plt
...
plt.imshow(seg_rgb)
plt.show()