Unverified Commit 8d169da4 authored by Pascal Roth's avatar Pascal Roth Committed by GitHub

Fixes the line numbers of the tutorials and how-to's (#337)

# Description

Adjust the line numbers in the tutorials and how-to's to account for
latest changes in the code files.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.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
parent 8a9c362c
...@@ -17,7 +17,7 @@ This guide is accompanied by a sample script ``markers.py`` in the ``orbit/sourc ...@@ -17,7 +17,7 @@ This guide is accompanied by a sample script ``markers.py`` in the ``orbit/sourc
.. literalinclude:: ../../../source/standalone/demos/markers.py .. literalinclude:: ../../../source/standalone/demos/markers.py
:language: python :language: python
:emphasize-lines: 49-97, 113, 114-145 :emphasize-lines: 49-97, 112-113, 142-148
:linenos: :linenos:
......
.. _tutorial-interact-articulation: .. _tutorial-interact-articulation:
Interacting with an articulation Interacting with an articulation
================================ ================================
...@@ -24,7 +23,7 @@ directory. ...@@ -24,7 +23,7 @@ directory.
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:emphasize-lines: 58-69, 92-103, 103-105, 111, 125-127, 133 :emphasize-lines: 62-73, 95-108, 112-115, 120-121
:linenos: :linenos:
...@@ -50,9 +49,9 @@ an instance of the :class:`assets.Articulation` class by passing the configurati ...@@ -50,9 +49,9 @@ an instance of the :class:`assets.Articulation` class by passing the configurati
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:lines: 58-69 :lines: 62-73
:linenos: :linenos:
:lineno-start: 58 :lineno-start: 62
Running the simulation loop Running the simulation loop
...@@ -74,9 +73,9 @@ Finally, we call the :meth:`Articulation.reset` method to reset any internal buf ...@@ -74,9 +73,9 @@ Finally, we call the :meth:`Articulation.reset` method to reset any internal buf
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:lines: 92-103 :lines: 95-108
:linenos: :linenos:
:lineno-start: 92 :lineno-start: 95
Stepping the simulation Stepping the simulation
""""""""""""""""""""""" """""""""""""""""""""""
...@@ -98,9 +97,9 @@ the simulation. ...@@ -98,9 +97,9 @@ the simulation.
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:lines: 108-112 :lines: 112-115
:linenos: :linenos:
:lineno-start: 108 :lineno-start: 112
Updating the state Updating the state
...@@ -109,11 +108,11 @@ Updating the state ...@@ -109,11 +108,11 @@ Updating the state
Every articulation class contains a :class:`assets.ArticulationData` object. This stores the state of the Every articulation class contains a :class:`assets.ArticulationData` object. This stores the state of the
articulation. To update the state inside the buffer, we call the :meth:`assets.Articulation.update` method. articulation. To update the state inside the buffer, we call the :meth:`assets.Articulation.update` method.
.. literalinclude:: ../../../../source/standalone/demos/arms.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:lines: 116-117 :lines: 120-121
:linenos: :linenos:
:lineno-start: 116 :lineno-start: 120
The Code Execution The Code Execution
......
.. _tutorial-interactive-scene: .. _tutorial-interactive-scene:
Using the Interactive Scene Using the Interactive Scene
=========================== ===========================
...@@ -41,7 +40,7 @@ This tutorial corresponds to the ``create_scene.py`` script within ...@@ -41,7 +40,7 @@ This tutorial corresponds to the ``create_scene.py`` script within
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py .. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python :language: python
:emphasize-lines: 51-64, 69-71, 92-93, 100-101, 106-107, 117-119 :emphasize-lines: 55-68, 73-75, 96-97, 104-105, 110-111, 121-123
:linenos: :linenos:
...@@ -64,9 +63,9 @@ them now in the configuration class :class:`CartpoleSceneCfg` instead of manuall ...@@ -64,9 +63,9 @@ them now in the configuration class :class:`CartpoleSceneCfg` instead of manuall
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py .. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python :language: python
:lines: 51-64 :lines: 55-68
:linenos: :linenos:
:lineno-start: 51 :lineno-start: 55
The variable names in the configuration class are used as keys to access the corresponding The variable names in the configuration class are used as keys to access the corresponding
entity from the :class:`scene.InteractiveScene` object. For example, the cartpole can entity from the :class:`scene.InteractiveScene` object. For example, the cartpole can
...@@ -111,9 +110,9 @@ This will be used to clone the scene for each environment. ...@@ -111,9 +110,9 @@ This will be used to clone the scene for each environment.
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py .. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python :language: python
:lines: 117-119 :lines: 121-123
:linenos: :linenos:
:lineno-start: 117 :lineno-start: 121
Accessing scene elements Accessing scene elements
------------------------ ------------------------
...@@ -126,9 +125,9 @@ the cartpole is specified using the key ``"cartpole"`` in the configuration clas ...@@ -126,9 +125,9 @@ the cartpole is specified using the key ``"cartpole"`` in the configuration clas
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py .. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python :language: python
:lines: 69-71 :lines: 73-75
:linenos: :linenos:
:lineno-start: 69 :lineno-start: 73
Running the simulation loop Running the simulation loop
--------------------------- ---------------------------
......
.. _tutorial-add-sensors-on-robot: .. _tutorial-add-sensors-on-robot:
Adding sensors on a robot Adding sensors on a robot
========================= =========================
...@@ -38,7 +37,7 @@ The tutorial corresponds to the ``add_sensors_on_robot.py`` script in the ...@@ -38,7 +37,7 @@ The tutorial corresponds to the ``add_sensors_on_robot.py`` script in the
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:emphasize-lines: 73-96, 145-154, 172-173 :emphasize-lines: 77-100, 152-162, 176-177
:linenos: :linenos:
...@@ -86,12 +85,9 @@ and ``"front_cam"`` is the name of the prim associated with the camera sensor. ...@@ -86,12 +85,9 @@ and ``"front_cam"`` is the name of the prim associated with the camera sensor.
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:lines: 74-84 :lines: 78-88
:linenos: :linenos:
:lineno-start: 74 :lineno-start: 78
Height scanner sensor
---------------------
The height-scanner is implemented as a virtual sensor using the NVIDIA Warp ray-casting kernels. The height-scanner is implemented as a virtual sensor using the NVIDIA Warp ray-casting kernels.
Through the :class:`sensors.RayCasterCfg`, we can specify the pattern of rays to cast and the Through the :class:`sensors.RayCasterCfg`, we can specify the pattern of rays to cast and the
...@@ -112,9 +108,9 @@ The entire configuration of the height-scanner is as follows: ...@@ -112,9 +108,9 @@ The entire configuration of the height-scanner is as follows:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:lines: 85-93 :lines: 89-97
:linenos: :linenos:
:lineno-start: 85 :lineno-start: 89
Contact sensor Contact sensor
-------------- --------------
...@@ -142,9 +138,9 @@ The entire configuration of the contact sensor is as follows: ...@@ -142,9 +138,9 @@ The entire configuration of the contact sensor is as follows:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:lines: 94-96 :lines: 98-100
:linenos: :linenos:
:lineno-start: 94 :lineno-start: 98
Running the simulation loop Running the simulation loop
--------------------------- ---------------------------
...@@ -154,9 +150,9 @@ when the simulation is played, i.e., it is important to call ``sim.reset()`` aft ...@@ -154,9 +150,9 @@ when the simulation is played, i.e., it is important to call ``sim.reset()`` aft
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:lines: 172-173 :lines: 176-177
:linenos: :linenos:
:lineno-start: 173 :lineno-start: 177
Besides that, the simulation loop is similar to the previous tutorials. The sensors are updated as part Besides that, the simulation loop is similar to the previous tutorials. The sensors are updated as part
of the scene update and they internally handle the updating of their buffers based on their update of the scene update and they internally handle the updating of their buffers based on their update
...@@ -167,9 +163,9 @@ to access the data for the different sensors created in this tutorial: ...@@ -167,9 +163,9 @@ to access the data for the different sensors created in this tutorial:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:lines: 148-158 :lines: 152-162
:linenos: :linenos:
:lineno-start: 148 :lineno-start: 152
The Code Execution The Code Execution
......
...@@ -24,7 +24,7 @@ The tutorial corresponds to the ``run_diff_ik.py`` script in the ``orbit/source/ ...@@ -24,7 +24,7 @@ The tutorial corresponds to the ``run_diff_ik.py`` script in the ``orbit/source/
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:emphasize-lines: 99-101, 122-137, 156-158, 162-172 :emphasize-lines: 103-105, 126-141, 160-162, 166-176
:linenos: :linenos:
...@@ -66,9 +66,9 @@ will use the absolute pose command mode. ...@@ -66,9 +66,9 @@ will use the absolute pose command mode.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:lines: 99-101 :lines: 103-105
:linenos: :linenos:
:lineno-start: 99 :lineno-start: 103
Obtaining the robot's joint and body indices Obtaining the robot's joint and body indices
-------------------------------------------- --------------------------------------------
...@@ -96,9 +96,9 @@ this class. ...@@ -96,9 +96,9 @@ this class.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:lines: 122-137 :lines: 126-141
:linenos: :linenos:
:lineno-start: 122 :lineno-start: 126
Computing robot command Computing robot command
...@@ -114,9 +114,9 @@ the robot's base frame. ...@@ -114,9 +114,9 @@ the robot's base frame.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:lines: 156-158 :lines: 160-162
:linenos: :linenos:
:lineno-start: 156 :lineno-start: 160
We can then compute the desired joint positions using the We can then compute the desired joint positions using the
:meth:`~controllers.DifferentialIKController.compute` method. :meth:`~controllers.DifferentialIKController.compute` method.
...@@ -127,18 +127,18 @@ its value computed from the physics engine. ...@@ -127,18 +127,18 @@ its value computed from the physics engine.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:lines: 162-172 :lines: 166-176
:linenos: :linenos:
:lineno-start: 162 :lineno-start: 166
The computed joint position targets can then be applied on the robot, as done in the The computed joint position targets can then be applied on the robot, as done in the
previous tutorials. previous tutorials.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:lines: 174-176 :lines: 178-180
:linenos: :linenos:
:lineno-start: 174 :lineno-start: 178
The Code Execution The Code Execution
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment