Skip to content

Commit

Permalink
update docs: py_trees_ros_viewer (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil-Singhal-06 authored Mar 6, 2024
1 parent 4102ee6 commit 28cbf45
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions docs/how_to_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,59 @@ information of py_trees and parser:
ros2 run scenario_execution scenario_execution $(PATH_TO_SCENARIO_FILE) -t -d
Using RVIZ to trigger scenario
------------------------------
Visualize Scenario with PyTrees ROS Viewer
------------------------------------------

Before getting started, ensure that the PyQt5 version 5.14 Python library is installed. You can check PyQt5 version using the following command:

.. code-block:: bash
pip freeze | grep -i pyqt
If any PyQt5 libraries are detected, it's recommended to uninstall them to avoid conflicts:

.. code-block:: bash
pip3 uninstall PyQt5 PyQt5-Qt5 PyQt5-sip PyQtWebEngine PyQtWebEngine-Qt5
Additionally, if the default PyQtWebEngine is present, remove it using:

.. code-block:: bash
sudo apt remove python3-pyqt5.qtwebengine
Next, install PyQt and PyQtWebEngine version 5.14:

.. code-block:: bash
pip install PyQt5==5.14
pip install PyQtWebEngine==5.14
Once PyQt is set up, clone the ``py_trees_ros_viewer`` repository:

.. code-block:: bash
git clone git@github.com:splintered-reality/py_trees_ros_viewer.git
After cloning, build the package using ``colcon build`` and source the workspace.

Now, to open the viewer, execute the following command:

.. code-block:: bash
py-trees-tree-viewer --no-sandbox
Finally, in a separate terminal, run the scenario file to visualize the behavior tree.

Example:

.. code-block:: bash
ros2 launch scenario_execution scenario_launch.py scenario:=examples/example_scenario/hello_world.osc
.. figure:: images/py_tree_viewer.png
:alt: Behavior Tree Viewer


Please note that this method has been tested on Ubuntu 22.04. If you are using any other distribution, please ensure that
PyQtEngine works on your machine and render web pages correctly.
Binary file added docs/images/py_tree_viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28cbf45

Please sign in to comment.