Git Product home page Git Product logo

omnidrones's Introduction

IsaacDrones

Setup

Install Omniverse Isaac Sim. For convenience, we recommend exporting the following environment variables to your ~/.bashrc or ~/.zshrc files:

# Isaac Sim root directory
export ISAACSIM_PATH="${HOME}/.local/share/ov/pkg/isaac_sim-2022.2.0"

Isaac Sim provides a built-in Python 3.7 environment containing a PyTorch (1.13.0) installation. So there are different options to set up a development environment.

Option 1: Built-in Python environment

The built-in python interpreter launch script is at ${ISAACSIM_PATH}/python.sh. So the straightforward way to use the built-in environment is

# to launch a script
${ISAACSIM_PATH}/python.sh path/to/script.py
# to install some package
${ISAACSIM_PATH}/python.sh -m pip install name_of_package_here

python.sh works by setting up the necessary environment variables including PYTHONPATH so that you can import the functionalities of Isaac SIm as modules in Python scripts. Check ${ISAACSIM_PATH}/setup_python_env.sh for more detail.

Option 2: Conda environment (recommended)

Using a separate conda environment is sometimes more flexible and comfortable. For example, you may want to install newer versions of PyTorch or share the same Isaac Sim Installation with other users. This can be done by creating a conda environment with Python 3.7. To automate the setup process, we also add two env_vars.sh files that are sourced every time we activate/deactivate our conda environment.

conda create -n sim python=3.7
conda activate sim
# at OmniDrones/
cp -r conda_setup/etc $CONDA_PREFIX

The activation script etc/conda/activate.d/env_vars.sh looks like:

echo "Setup Isaac Sim Conda environment."
export PYTHONPATH_PREV=$PYTHONPATH
export LD_LIBRARY_PATH_PREV=$LD_LIBRARY_PATH

if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ]; then
    echo "Connected via SSH."
    if [ -z "$DISPLAY" ]; then
        echo "Set DISPLAY=:10.0 to use X11 forwarding."
        export DISPLAY=:10.0 
        # here 10 is the X11DisplayOffset in /etc/ssh/sshd_config
    fi
fi

Where setting up X11 forwarding allows viewing the Isaac Sim GUI via an SSH connection. The correct value of DISPLAY depends on your display setting and SSH config. You can check the SSH config using cat /etc/ssh/sshd_config | grep X11, which would give something like

X11Forwarding yes # make sure this is `yes`
X11DisplayOffset 10 # decides the DISPLAY variable
X11UseLocalhost yes

Developer Guide: Working with VSCode

To enable features like linting and auto-completion with VSCode Python Extension, we need to let the extension recognize the extra paths we added during the setup process.

Create a file .vscode/settings.json at your workspace if it is not already there.

A first solution is to set python.analysis.extraPaths: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_standalone_python.html#isaac-sim-python-vscode.

Another solution is to provide an envFile:

# for Option 1
source ${ISAACSIM_PATH}/setup_python_env.sh
# for Option 2
conda activate sim
# check your python environment by
python -c "from omni.isaac.kit import SimulationApp"
# verify which torch is being used
python -c "import torch; print(torch.__path__)"
# then
printenv > .vscode/.python.env

And edit .vscode/settings.json:

{
    "python.envFile": "${workspaceFolder}/.vscode/.python.env",
}

Installation

Clone the repo and install through pip.

omnidrones's People

Contributors

btx0424 avatar lgshub avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.