-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleans up the how-to documentation (#325)
# Description This MR reviews the how-tos documentation and ensures they are all somewhat consistent. ## Type of change - This change requires a documentation update ## 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
- Loading branch information
Showing
8 changed files
with
198 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,75 @@ | ||
Creating Markers in Orbit | ||
========================= | ||
Creating Visualization Markers | ||
============================== | ||
|
||
In this tutorial, we will explore how to create different types of markers using a Python script. | ||
The script demonstrates the creation of markers with various shapes and visual properties. | ||
.. currentmodule:: omni.isaac.orbit | ||
|
||
Please ensure you have gone through the previous tutorials, especially creating an empty scene for a foundational understanding. | ||
Visualization markers are useful to debug the state of the environment. They can be used to visualize | ||
the frames, commands, and other information in the simulation. | ||
|
||
While Isaac Sim provides its own :mod:`omni.isaac.debug_draw` extension, it is limited to rendering only | ||
points, lines and splines. For cases, where you need to render more complex shapes, you can use the | ||
:class:`markers.VisualizationMarkers` class. | ||
|
||
The Code | ||
~~~~~~~~ | ||
This guide is accompanied by a sample script ``markers.py`` in the ``orbit/source/standalone/demos`` directory. | ||
|
||
The tutorial corresponds to the ``markers.py`` script in the ``orbit/source/standalone/demos`` directory. | ||
Let's take a look at the Python script: | ||
.. dropdown:: Code for markers.py | ||
:icon: code | ||
|
||
.. literalinclude:: ../../../source/standalone/demos/markers.py | ||
:language: python | ||
:linenos: | ||
.. literalinclude:: ../../../source/standalone/demos/markers.py | ||
:language: python | ||
:emphasize-lines: 49-97, 113, 114-145 | ||
:linenos: | ||
|
||
|
||
|
||
Configuring the markers | ||
----------------------- | ||
|
||
The Code Explained | ||
~~~~~~~~~~~~~~~~~~ | ||
The :class:`~markers.VisualizationMarkersCfg` class provides a simple interface to configure | ||
different types of markers. It takes in the following parameters: | ||
|
||
Creating and spawning markers | ||
----------------------------- | ||
- :attr:`~markers.VisualizationMarkersCfg.prim_path`: The corresponding prim path for the marker class. | ||
- :attr:`~markers.VisualizationMarkersCfg.markers`: A dictionary specifying the different marker prototypes | ||
handled by the class. The key is the name of the marker prototype and the value is its spawn configuration. | ||
|
||
The :meth:`spawn_markers` function creates different types of markers with specified configurations. | ||
For example, we include frames, arrows, cubes, spheres, cylinders, cones, and meshes. | ||
The function returns a :obj:`VisualizationMarkers` object. | ||
.. note:: | ||
|
||
In case the marker prototype specifies a configuration with physics properties, these are removed. | ||
This is because the markers are not meant to be simulated. | ||
|
||
Here we show all the different types of markers that can be configured. These range from simple shapes like | ||
cones and spheres to more complex geometries like a frame or arrows. The marker prototypes can also be | ||
configured from USD files. | ||
|
||
.. literalinclude:: ../../../source/standalone/demos/markers.py | ||
:language: python | ||
:lines: 37-84 | ||
:linenos: | ||
:lineno-start: 37 | ||
:lines: 49-97 | ||
:dedent: | ||
|
||
|
||
Main simulation logic | ||
--------------------- | ||
Drawing the markers | ||
------------------- | ||
|
||
The ``main`` function sets up the simulation context, camera view, and spawns lights into the stage. | ||
It then creates instances of the markers and places them in a grid pattern. | ||
The markers are rotated around the z-axis during the simulation for visualization purposes. | ||
To draw the markers, we call the :class:`~markers.VisualizationMarkers.visualize` method. This method takes in | ||
as arguments the pose of the markers and the corresponding marker prototypes to draw. | ||
|
||
.. literalinclude:: ../../../source/standalone/demos/markers.py | ||
:language: python | ||
:lines: 86-111 | ||
:linenos: | ||
:lineno-start: 86 | ||
:lines: 142-148 | ||
:dedent: | ||
|
||
|
||
Executing the Script | ||
~~~~~~~~~~~~~~~~~~~~ | ||
-------------------- | ||
|
||
To run the script, execute the following command: | ||
To run the accompanying script, execute the following command: | ||
|
||
.. code-block:: bash | ||
./orbit.sh -p source/standalone/demos/markers.py | ||
The simulation should start, and you can observe the different types of markers arranged in a grid pattern. | ||
To stop the simulation, close the window, press the ``STOP`` button in the UI, or use ``Ctrl+C`` in the terminal. | ||
The markers will rotating around their respective axes. Additionally every few rotations, they will | ||
roll forward on the grid. | ||
|
||
This tutorial provides a foundation for working with markers in Orbit. | ||
You can further customize markers by adjusting their configurations and exploring additional options | ||
available in the Orbit API. | ||
To stop the simulation, close the window, or use ``Ctrl+C`` in the terminal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.