Skip to content

Commit d698323

Browse files
Mayankm96jtigue-bdai
authored andcommitted
Improves contribution guidelines for IsaacLab (isaac-sim#3403)
I realized there were some comments I often have to repeat in my reviewing process. I tried to add some of them into the code style page to directly point developers to it. - This change requires a documentation update - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] 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 - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Mayank Mittal <[email protected]> Co-authored-by: James Tigue <[email protected]>
1 parent 6a4e885 commit d698323

File tree

5 files changed

+279
-38
lines changed

5 files changed

+279
-38
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines.
55
66
Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
7+
8+
💡 Please try to keep PRs small and focused. Large PRs are harder to review and merge.
79
-->
810

911
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
@@ -21,8 +23,8 @@ is demanded by more than one party. -->
2123

2224
- Bug fix (non-breaking change which fixes an issue)
2325
- New feature (non-breaking change which adds functionality)
24-
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
25-
- This change requires a documentation update
26+
- Breaking change (existing functionality will not work without user modification)
27+
- Documentation update
2628

2729
## Screenshots
2830

@@ -40,6 +42,7 @@ To upload images to a PR -- simply drag and drop an image while in edit mode and
4042

4143
## Checklist
4244

45+
- [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
4346
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format`
4447
- [ ] I have made corresponding changes to the documentation
4548
- [ ] My changes generate no new warnings

docs/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@
9696
(r"py:.*", r"trimesh.*"), # we don't have intersphinx mapping for trimesh
9797
]
9898

99-
# emoji style
100-
sphinxemoji_style = "twemoji" # options: "twemoji" or "unicode"
10199
# put type hints inside the signature instead of the description (easier to maintain)
102100
autodoc_typehints = "signature"
103101
# autodoc_typehints_format = "fully-qualified"
@@ -124,8 +122,8 @@
124122
"python": ("https://docs.python.org/3", None),
125123
"numpy": ("https://numpy.org/doc/stable/", None),
126124
"trimesh": ("https://trimesh.org/", None),
127-
"torch": ("https://pytorch.org/docs/stable/", None),
128-
"isaacsim": ("https://docs.isaacsim.omniverse.nvidia.com/5.1.0/py/", None),
125+
"torch": ("https://docs.pytorch.org/docs/stable", None),
126+
"isaacsim": ("https://docs.isaacsim.omniverse.nvidia.com/5.0.0/py/", None),
129127
"gymnasium": ("https://gymnasium.farama.org/", None),
130128
"warp": ("https://nvidia.github.io/warp/", None),
131129
"dev-guide": ("https://docs.omniverse.nvidia.com/dev-guide/latest", None),
@@ -164,6 +162,7 @@
164162
"isaacsim.core.api",
165163
"isaacsim.core.cloner",
166164
"isaacsim.core.version",
165+
"isaacsim.core.utils",
167166
"isaacsim.robot_motion.motion_generation",
168167
"isaacsim.gui.components",
169168
"isaacsim.asset.importer.urdf",
@@ -261,7 +260,7 @@
261260
{
262261
"name": "Isaac Sim",
263262
"url": "https://developer.nvidia.com/isaac-sim",
264-
"icon": "https://img.shields.io/badge/IsaacSim-5.1.0-silver.svg",
263+
"icon": "https://img.shields.io/badge/IsaacSim-5.0.0-silver.svg",
265264
"type": "url",
266265
},
267266
{
@@ -281,7 +280,7 @@
281280
# Whitelist pattern for remotes
282281
smv_remote_whitelist = r"^.*$"
283282
# Whitelist pattern for branches (set to None to ignore all branches)
284-
smv_branch_whitelist = os.getenv("SMV_BRANCH_WHITELIST", r"^(main|devel|release/.*)$")
283+
smv_branch_whitelist = os.getenv("SMV_BRANCH_WHITELIST", r"^(main|devel)$")
285284
# Whitelist pattern for tags (set to None to ignore all tags)
286285
smv_tag_whitelist = os.getenv("SMV_TAG_WHITELIST", r"^v[1-9]\d*\.\d+\.\d+$")
287286
html_sidebars = {

docs/source/overview/environments.rst

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,6 @@ for the lift-cube environment:
142142
| |gr1_pp_waist| | |gr1_pp_waist-link| | Pick up and place an object in a basket with a GR-1 humanoid robot |
143143
| | | with waist degrees-of-freedom enables that provides a wider reach space. |
144144
+-------------------------+------------------------------+-----------------------------------------------------------------------------+
145-
| |g1_pick_place| | |g1_pick_place-link| | Pick up and place an object in a basket with a Unitree G1 humanoid robot |
146-
+-------------------------+------------------------------+-----------------------------------------------------------------------------+
147-
| |g1_pick_place_fixed| | |g1_pick_place_fixed-link| | Pick up and place an object in a basket with a Unitree G1 humanoid robot |
148-
| | | with three-fingered hands. Robot is set up with the base fixed in place. |
149-
+-------------------------+------------------------------+-----------------------------------------------------------------------------+
150-
| |g1_pick_place_lm| | |g1_pick_place_lm-link| | Pick up and place an object in a basket with a Unitree G1 humanoid robot |
151-
| | | with three-fingered hands and in-place locomanipulation capabilities |
152-
| | | enabled (i.e. Robot lower body balances in-place while upper body is |
153-
| | | controlled via Inverse Kinematics). |
154-
+-------------------------+------------------------------+-----------------------------------------------------------------------------+
155145
| |kuka-allegro-lift| | |kuka-allegro-lift-link| | Pick up a primitive shape on the table and lift it to target position |
156146
+-------------------------+------------------------------+-----------------------------------------------------------------------------+
157147
| |kuka-allegro-reorient| | |kuka-allegro-reorient-link| | Pick up a primitive shape on the table and orient it to target pose |
@@ -173,9 +163,6 @@ for the lift-cube environment:
173163
.. |cube-shadow| image:: ../_static/tasks/manipulation/shadow_cube.jpg
174164
.. |stack-cube| image:: ../_static/tasks/manipulation/franka_stack.jpg
175165
.. |gr1_pick_place| image:: ../_static/tasks/manipulation/gr-1_pick_place.jpg
176-
.. |g1_pick_place| image:: ../_static/tasks/manipulation/g1_pick_place.jpg
177-
.. |g1_pick_place_fixed| image:: ../_static/tasks/manipulation/g1_pick_place_fixed_base.jpg
178-
.. |g1_pick_place_lm| image:: ../_static/tasks/manipulation/g1_pick_place_locomanipulation.jpg
179166
.. |surface-gripper| image:: ../_static/tasks/manipulation/ur10_stack_surface_gripper.jpg
180167
.. |gr1_pp_waist| image:: ../_static/tasks/manipulation/gr-1_pick_place_waist.jpg
181168
.. |galbot_stack| image:: ../_static/tasks/manipulation/galbot_stack_cube.jpg
@@ -197,20 +184,16 @@ for the lift-cube environment:
197184
.. |stack-cube-link| replace:: `Isaac-Stack-Cube-Franka-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/stack/config/franka/stack_joint_pos_env_cfg.py>`__
198185
.. |stack-cube-bp-link| replace:: `Isaac-Stack-Cube-Franka-IK-Rel-Blueprint-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/stack/config/franka/stack_ik_rel_blueprint_env_cfg.py>`__
199186
.. |gr1_pick_place-link| replace:: `Isaac-PickPlace-GR1T2-Abs-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/pick_place/pickplace_gr1t2_env_cfg.py>`__
200-
.. |g1_pick_place-link| replace:: `Isaac-PickPlace-G1-InspireFTP-Abs-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/pick_place/pickplace_unitree_g1_inspire_hand_env_cfg.py>`__
201-
.. |g1_pick_place_fixed-link| replace:: `Isaac-PickPlace-FixedBaseUpperBodyIK-G1-Abs-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomanipulation/pick_place/fixed_base_upper_body_ik_g1_env_cfg.py>`__
202-
.. |g1_pick_place_lm-link| replace:: `Isaac-PickPlace-Locomanipulation-G1-Abs-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomanipulation/pick_place/locomanipulation_g1_env_cfg.py>`__
203187
.. |long-suction-link| replace:: `Isaac-Stack-Cube-UR10-Long-Suction-IK-Rel-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/stack/config/ur10_gripper/stack_ik_rel_env_cfg.py>`__
204188
.. |short-suction-link| replace:: `Isaac-Stack-Cube-UR10-Short-Suction-IK-Rel-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/stack/config/ur10_gripper/stack_ik_rel_env_cfg.py>`__
205189
.. |gr1_pp_waist-link| replace:: `Isaac-PickPlace-GR1T2-WaistEnabled-Abs-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/pick_place/pickplace_gr1t2_waist_enabled_env_cfg.py>`__
206190
.. |galbot_stack-link| replace:: `Isaac-Stack-Cube-Galbot-Left-Arm-Gripper-RmpFlow-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/stack/config/galbot/stack_rmp_rel_env_cfg.py>`__
207-
.. |kuka-allegro-lift-link| replace:: `Isaac-Dexsuite-Kuka-Allegro-Lift-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/dexsuite/config/kuka_allegro/dexsuite_kuka_allegro_env_cfg.py>`__
208-
.. |kuka-allegro-reorient-link| replace:: `Isaac-Dexsuite-Kuka-Allegro-Reorient-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/dexsuite/config/kuka_allegro/dexsuite_kuka_allegro_env_cfg.py>`__
191+
.. |kuka-allegro-lift-link| replace:: `Isaac-Dexsuite-Kuka-Allegro-Lift-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/dexsuite/dexsuite_kuka_allegro_env_cfg.py>`__
192+
.. |kuka-allegro-reorient-link| replace:: `Isaac-Dexsuite-Kuka-Allegro-Reorient-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/dexsuite/dexsuite_kuka_allegro_env_cfg.py>`__
209193
.. |cube-shadow-link| replace:: `Isaac-Repose-Cube-Shadow-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/shadow_hand/shadow_hand_env_cfg.py>`__
210194
.. |cube-shadow-ff-link| replace:: `Isaac-Repose-Cube-Shadow-OpenAI-FF-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/shadow_hand/shadow_hand_env_cfg.py>`__
211195
.. |cube-shadow-lstm-link| replace:: `Isaac-Repose-Cube-Shadow-OpenAI-LSTM-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/shadow_hand/shadow_hand_env_cfg.py>`__
212196
.. |cube-shadow-vis-link| replace:: `Isaac-Repose-Cube-Shadow-Vision-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/shadow_hand/shadow_hand_vision_env.py>`__
213-
214197
.. |agibot_place_mug-link| replace:: `Isaac-Place-Mug-Agibot-Left-Arm-RmpFlow-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/place/config/agibot/place_upright_mug_rmp_rel_env_cfg.py>`__
215198
.. |agibot_place_toy-link| replace:: `Isaac-Place-Toy2Box-Agibot-Right-Arm-RmpFlow-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/place/config/agibot/place_toy2box_rmp_rel_env_cfg.py>`__
216199

@@ -260,20 +243,21 @@ We provide environments for both disassembly and assembly.
260243

261244
.. attention::
262245

263-
CUDA is recommended for running the AutoMate environments with 570 drivers. If running with Nvidia driver 570 on Linux with architecture x86_64, we follow the below steps to install CUDA 12.8. This allows for computing rewards in AutoMate environments with CUDA. If you have a different operation system or architecture, please refer to the `CUDA installation page <https://developer.nvidia.com/cuda-12-8-0-download-archive>`_ for additional instruction.
246+
CUDA is required for running the AutoMate environments.
247+
Follow the below steps to install CUDA 12.8:
264248

265249
.. code-block:: bash
266250
267251
wget https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_570.86.10_linux.run
268-
sudo sh cuda_12.8.0_570.86.10_linux.run --toolkit
252+
sudo sh cuda_12.8.0_570.86.10_linux.run
269253
270254
When using conda, cuda toolkit can be installed with:
271255

272256
.. code-block:: bash
273257
274258
conda install cudatoolkit
275259
276-
With 580 drivers and CUDA 13, we are currently unable to enable CUDA for computing the rewards. The code automatically fallbacks to CPU, resulting in slightly slower performance.
260+
For addition instructions and Windows installation, please refer to the `CUDA installation page <https://developer.nvidia.com/cuda-12-8-0-download-archive>`_.
277261

278262
* |disassembly-link|: The plug starts inserted in the socket. A low-level controller lifts the plug out and moves it to a random position. This process is purely scripted and does not involve any learned policy. Therefore, it does not require policy training or evaluation. The resulting trajectories serve as demonstrations for the reverse process, i.e., learning to assemble. To run disassembly for a specific task: ``python source/isaaclab_tasks/isaaclab_tasks/direct/automate/run_disassembly_w_id.py --assembly_id=ASSEMBLY_ID --disassembly_dir=DISASSEMBLY_DIR``. All generated trajectories are saved to a local directory ``DISASSEMBLY_DIR``.
279263
* |assembly-link|: The goal is to insert the plug into the socket. You can use this environment to train a policy via reinforcement learning or evaluate a pre-trained checkpoint.
@@ -990,10 +974,6 @@ inferencing, including reading from an already trained checkpoint and disabling
990974
-
991975
- Manager Based
992976
-
993-
* - Isaac-PickPlace-G1-InspireFTP-Abs-v0
994-
-
995-
- Manager Based
996-
-
997977
* - Isaac-Stack-Cube-UR10-Long-Suction-IK-Rel-v0
998978
-
999979
- Manager Based

docs/source/refs/contributing.rst

Lines changed: 108 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Please ensure that your code is well-formatted, documented and passes all the te
5454
Large pull requests are difficult to review and may take a long time to merge.
5555

5656

57+
More details on the code style and testing can be found in the `Coding Style`_ and `Unit Testing`_ sections.
58+
59+
5760
Contributing Documentation
5861
--------------------------
5962

@@ -234,6 +237,62 @@ For documentation, we adopt the `Google Style Guide <https://sphinxcontrib-napol
234237
for docstrings. We use `Sphinx <https://www.sphinx-doc.org/en/master/>`__ for generating the documentation.
235238
Please make sure that your code is well-documented and follows the guidelines.
236239

240+
Code Structure
241+
^^^^^^^^^^^^^^
242+
243+
We follow a specific structure for the codebase. This helps in maintaining the codebase and makes it easier to
244+
understand.
245+
246+
In a Python file, we follow the following structure:
247+
248+
.. code:: python
249+
250+
# Imports: These are sorted by the pre-commit hooks.
251+
# Constants
252+
# Functions (public)
253+
# Classes (public)
254+
# _Functions (private)
255+
# _Classes (private)
256+
257+
Imports are sorted by the pre-commit hooks. Unless there is a good reason to do otherwise, please do not
258+
import the modules inside functions or classes. To deal with circular imports, we use the
259+
:obj:`typing.TYPE_CHECKING` variable. Please refer to the `Circular Imports`_ section for more details.
260+
261+
Python does not have a concept of private and public classes and functions. However, we follow the
262+
convention of prefixing the private functions and classes with an underscore.
263+
The public functions and classes are the ones that are intended to be used by the users. The private
264+
functions and classes are the ones that are intended to be used internally in that file.
265+
Irrespective of the public or private nature of the functions and classes, we follow the Style Guide
266+
for the code and make sure that the code and documentation are consistent.
267+
268+
Similarly, within Python classes, we follow the following structure:
269+
270+
.. code:: python
271+
272+
# Constants
273+
# Class variables (public or private): Must have the type hint ClassVar[type]
274+
# Dunder methods: __init__, __del__
275+
# Representation: __repr__, __str__
276+
# Properties: @property
277+
# Instance methods (public)
278+
# Class methods (public)
279+
# Static methods (public)
280+
# _Instance methods (private)
281+
# _Class methods (private)
282+
# _Static methods (private)
283+
284+
The rule of thumb is that the functions within the classes are ordered in the way a user would
285+
expect to use them. For instance, if the class contains the method :meth:`initialize`, :meth:`reset`,
286+
:meth:`update`, and :meth:`close`, then they should be listed in the order of their usage.
287+
The same applies for private functions in the class. Their order is based on the order of call inside the
288+
class.
289+
290+
.. dropdown:: Code skeleton
291+
:icon: code
292+
293+
.. literalinclude:: snippets/code_skeleton.py
294+
:language: python
295+
237296
Circular Imports
238297
^^^^^^^^^^^^^^^^
239298

@@ -411,15 +470,47 @@ We summarize the key points below:
411470

412471

413472
Unit Testing
414-
^^^^^^^^^^^^
473+
------------
415474

416475
We use `pytest <https://docs.pytest.org>`__ for unit testing.
417476
Good tests not only cover the basic functionality of the code but also the edge cases.
418477
They should be able to catch regressions and ensure that the code is working as expected.
419478
Please make sure that you add tests for your changes.
420479

480+
.. tab-set::
481+
:sync-group: os
482+
483+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
484+
:sync: linux
485+
486+
.. code-block:: bash
487+
488+
# Run all tests
489+
./isaaclab.sh --test # or "./isaaclab.sh -t"
490+
491+
# Run all tests in a particular file
492+
./isaaclab.sh -p -m pytest source/isaaclab/test/deps/test_torch.py
493+
494+
# Run a particular test
495+
./isaaclab.sh -p -m pytest source/isaaclab/test/deps/test_torch.py::test_array_slicing
496+
497+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
498+
:sync: windows
499+
500+
.. code-block:: bash
501+
502+
# Run all tests
503+
isaaclab.bat --test # or "isaaclab.bat -t"
504+
505+
# Run all tests in a particular file
506+
isaaclab.bat -p -m pytest source/isaaclab/test/deps/test_torch.py
507+
508+
# Run a particular test
509+
isaaclab.bat -p -m pytest source/isaaclab/test/deps/test_torch.py::test_array_slicing
510+
511+
421512
Tools
422-
^^^^^
513+
-----
423514

424515
We use the following tools for maintaining code quality:
425516

@@ -432,6 +523,19 @@ Please check `here <https://pre-commit.com/#install>`__ for instructions
432523
to set these up. To run over the entire repository, please execute the
433524
following command in the terminal:
434525

435-
.. code:: bash
526+
.. tab-set::
527+
:sync-group: os
528+
529+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
530+
:sync: linux
531+
532+
.. code-block:: bash
533+
534+
./isaaclab.sh --format # or "./isaaclab.sh -f"
535+
536+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
537+
:sync: windows
538+
539+
.. code-block:: bash
436540
437-
./isaaclab.sh --format # or "./isaaclab.sh -f"
541+
isaaclab.bat --format # or "isaaclab.bat -f"

0 commit comments

Comments
 (0)