Download simulation/modules/IsaacLab/docs/source/overview/developer-guide/vs_code.rst from hk239/v2d: direct link, hf CLI and curl.
- Browser
- Download file 4.22 kB
-
https://huggingface.co/datasets/hk239/v2d/resolve/main/simulation/modules/IsaacLab/docs/source/overview/developer-guide/vs_code.rst
- Command line
-
hf download hf://datasets/hk239/v2d/simulation/modules/IsaacLab/docs/source/overview/developer-guide/vs_code.rst
-
curl -L -o vs_code.rst https://huggingface.co/datasets/hk239/v2d/resolve/main/simulation/modules/IsaacLab/docs/source/overview/developer-guide/vs_code.rst
4.22 kB
| .. _setup-vs-code: | |
| Setting up Visual Studio Code | |
| ----------------------------- | |
| **This is optional. You do not need to use VScode to use Isaac Lab** | |
| `Visual Studio Code <https://code.visualstudio.com/>`_ has proven an invaluable tool for the development of Isaac Lab. The Isaac Lab repository includes the VSCode files for setting up your development environment. These are included in the ``.vscode`` directory and include the following files: | |
| .. code-block:: bash | |
| .vscode | |
| βββ tools | |
| βΒ Β βββ launch.template.json | |
| βΒ Β βββ settings.template.json | |
| βΒ Β βββ setup_vscode.py | |
| βββ extensions.json | |
| βββ launch.json # <- this is generated by setup_vscode.py | |
| βββ settings.json # <- this is generated by setup_vscode.py | |
| βββ tasks.json | |
| .. attention:: | |
| The following instructions on setting up Visual Studio Code only work with | |
| :ref:`Isaac Sim Binaries Installation <isaaclab-binaries-installation>` and not with | |
| :ref:`Pip Installation <isaaclab-pip-installation>`. | |
| To setup the IDE, please follow these instructions: | |
| 1. Open the ``IsaacLab`` directory on Visual Studio Code IDE | |
| 2. Run VSCode `Tasks <https://code.visualstudio.com/docs/editor/tasks>`__, by | |
| pressing ``Ctrl+Shift+P``, selecting ``Tasks: Run Task`` and running the | |
| ``setup_python_env`` in the drop down menu. | |
| .. image:: ../../_static/vscode_tasks.png | |
| :width: 600px | |
| :align: center | |
| :alt: VSCode Tasks | |
| .. note:: | |
| If this is your first time running tasks in VS Code, you may be prompted to select how to handle warnings. Simply follow | |
| the prompts until the task window closes. | |
| If everything executes correctly, it should create the following files: | |
| * ``.vscode/launch.json``: Contains the launch configurations for debugging python code. | |
| * ``.vscode/settings.json``: Contains the settings for the python interpreter and the python environment. | |
| For more information on VSCode support for Omniverse, please refer to the | |
| following links: | |
| * `Isaac Sim VSCode support <https://docs.isaacsim.omniverse.nvidia.com/latest/development_tools/vscode.html#visual-studio-code-vs-code>`__ | |
| Attach to a Running ``debugpy`` Session | |
| --------------------------------------- | |
| The generated ``.vscode/launch.json`` includes a ``Python: Debugger Attach`` | |
| configuration that starts to listen on port ``localhost:3000`` for the debugpy session. | |
| To use it: | |
| 1. Set your breakpoints. | |
| 2. Run your code under debugpy like so: | |
| .. code-block:: bash | |
| ./isaaclab.sh -p -m debugpy --listen 3000 --wait-for-client -c "from isaaclab.cli import cli; cli()" [cli_args] | |
| 3. In VS Code, select the ``Python: Debugger Attach`` configuration from the Run and Debug panel | |
| and press the green play button or ``F5``. VS Code will connect to the debugpy server | |
| running on ``localhost:3000``. | |
| Configuring the python interpreter | |
| ---------------------------------- | |
| In the provided configuration, we set the default python interpreter to use the | |
| python executable provided by Omniverse. This is specified in the | |
| ``.vscode/settings.json`` file: | |
| .. code-block:: json | |
| { | |
| "python.defaultInterpreterPath": "${workspaceFolder}/_isaac_sim/python.sh", | |
| } | |
| If you want to use a different python interpreter (for instance, from your conda or uv environment), | |
| you need to change the python interpreter used by selecting and activating the python interpreter | |
| of your choice in the bottom left corner of VSCode, or opening the command palette (``Ctrl+Shift+P``) | |
| and selecting ``Python: Select Interpreter``. | |
| For more information on how to set python interpreter for VSCode, please | |
| refer to the `VSCode documentation <https://code.visualstudio.com/docs/python/environments#_working-with-python-interpreters>`_. | |
| Setting up formatting and linting | |
| --------------------------------- | |
| We use `ruff <https://github.com/astral-sh/ruff/>`_ as a formatter and linter. | |
| These are configured in the ``.vscode/settings.json`` file: | |
| .. code-block:: json | |
| { | |
| "ruff.configuration": "${workspaceFolder}/pyproject.toml", | |
| } | |
| The ruff linter will show warnings and errors in your code to help you follow Python best practices and the project's coding standards. | |