Skip to content

Commit

Permalink
python example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jun 19, 2023
1 parent 7102385 commit 37f7543
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 7 deletions.
6 changes: 4 additions & 2 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.. _examples:

===============
Code examples
C++ examples
===============

The source code for all these C++ examples can be found
under `MRPT/samples <https://github.com/MRPT/mrpt/tree/develop/samples>`_.
Python examples are under `MRPT/python-examples <https://github.com/MRPT/mrpt/tree/develop/python-examples>`_.

Python examples are `here <python_examples.html>`_.


.. toctree::
:maxdepth: 1
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ MRPT
tutorials
applications
examples
python_examples
wrappers
supported-sensors
unit_testing
Expand Down
15 changes: 15 additions & 0 deletions doc/source/pymrpt_example_global_localization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _pyexample_global_localization:

====================================================
Python example: global_localization.py
====================================================

This example runs a MonteCarlo global localization
algorithm for a robot from a dataset in .rawlog format.
The adaptive particle filter algorithm has two implementations,
for 2D and 3D poses, or SE(2) or SE(3), respectively.


.. literalinclude:: ../../python-examples/global_localization.py
:language: python
:linenos:
18 changes: 18 additions & 0 deletions doc/source/pymrpt_example_hwdriver_tao_imu_usb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _pyexample_hwdriver_tao_imu_usb:

====================================================
Python example: hwdriver-tao-imu-usb.py
====================================================

This example shows how to read a Taobotics USB IMU
with the pymrpt hwdrivers module.

.. raw:: html

<iframe width="560" height="315" src="https://www.youtube.com/embed/qaaP9BmZYmo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
</iframe>


.. literalinclude:: ../../python-examples/hwdriver-tao-imu-usb.py
:language: python
:linenos:
11 changes: 11 additions & 0 deletions doc/source/pymrpt_example_lines-3d-geometry-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _pyexample_lines-3d-geometry-example:

====================================================
Python example: lines-3d-geometry-example.py
====================================================

This example illustrates some geometry functions:

.. literalinclude:: ../../python-examples/lines-3d-geometry-example.py
:language: python
:linenos:
12 changes: 12 additions & 0 deletions doc/source/pymrpt_example_rbpf_slam.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _pyexample_rbpf_slam:

====================================================
Python example: rbpf_slam.py
====================================================

This example shows how to build a metric map using
the RBPF-SLAM algorithm:

.. literalinclude:: ../../python-examples/rbpf_slam.py
:language: python
:linenos:
12 changes: 12 additions & 0 deletions doc/source/pymrpt_example_se2-poses-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _pyexample_se2-poses-example:

====================================================
Python example: se2-poses-example.py
====================================================

Example usage of SE(2) poses, for transformations
in the plane (x,y,phi):

.. literalinclude:: ../../python-examples/se2-poses-example.py
:language: python
:linenos:
12 changes: 12 additions & 0 deletions doc/source/pymrpt_example_se3-poses-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _pyexample_se3-poses-example:

====================================================
Python example: se3-poses-example.py
====================================================

Example usage of SE(3) poses, for transformations
in the space (x,y,z,yaw,pitch,roll):

.. literalinclude:: ../../python-examples/se3-poses-example.py
:language: python
:linenos:
21 changes: 21 additions & 0 deletions doc/source/python_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. _python_examples:

=================
Python examples
=================

The source code for all these Python examples can be found
under `MRPT/python-examples <https://github.com/MRPT/mrpt/tree/develop/python-examples>`_.

C++ examples are `here <examples.html>`_.


.. toctree::
:maxdepth: 1

pymrpt_example_global_localization.rst
pymrpt_example_hwdriver_tao_imu_usb.rst
pymrpt_example_lines-3d-geometry-example.rst
pymrpt_example_rbpf_slam.rst
pymrpt_example_se2-poses-example.rst
pymrpt_example_se3-poses-example.rst
2 changes: 1 addition & 1 deletion python-examples/global_localization.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# ---------------------------------------------------------------------
# Install python3-mrpt, or test with a local build with:
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with:
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH
# ---------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python-examples/hwdriver-tao-imu-usb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# ---------------------------------------------------------------------
# Install python3-mrpt, or test with a local build with:
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with:
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH
# ---------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python-examples/lines-3d-geometry-example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# ---------------------------------------------------------------------
# Install python3-mrpt, or test with a local build with:
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with:
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH
# ---------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python-examples/se2-poses-example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# ---------------------------------------------------------------------
# Install python3-mrpt, or test with a local build with:
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with:
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH
# ---------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python-examples/se3-poses-example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# ---------------------------------------------------------------------
# Install python3-mrpt, or test with a local build with:
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with:
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH
# ---------------------------------------------------------------------

Expand Down

0 comments on commit 37f7543

Please sign in to comment.