Skip to content

Commit

Permalink
README.rst: Introduce documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Gerson Fernando Budke <[email protected]>
  • Loading branch information
nandojve authored and otavio committed Nov 18, 2024
1 parent e43436d commit ad89158
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 23 deletions.
105 changes: 105 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,108 @@

Zephyr Behaviour Tree
#####################

This repository is the Zephyr Behavior Tree module.

Preparation
***********

The first step is prepare the development machine. The developer must follow the
steps at `Zephyr RTOS getting started`_. The recommendation is test using the
``native_posix`` board. In this case, the last step from procedure should try
using this command:

.. code-block:: console
cd ~/zephyrproject/zephyr
.. code-block:: console
west build -b native_posix samples/hello_world -t run
The second step is add your credentials to github. This will add necessary
permissions to clone using ssh and send changes. The github documentation can
be accessed at `Connecting to GitHub with SSH`_.

.. _Zephyr RTOS getting started:
https://docs.zephyrproject.org/latest/develop/getting_started/index.html

.. _Connecting to GitHub with SSH:
https://docs.github.com/en/authentication/connecting-to-github-with-ssh

How to clone
************

First, create your ``root`` directory, for instance:

.. code-block:: console
mkdir $HOME/zephyrbt
.. code-block:: console
cd $HOME/zephyrbt
The next step is create a ``python virtual environment`` with the ``west`` tool:

.. code-block:: console
python3 -m venv .venv
.. code-block:: console
source .venv/bin/activate
.. code-block:: console
pip install west
Then, initialize ``zephyrbt`` root folder:

.. code-block:: console
west init -m [email protected]:ossystems/zephyrbt
.. code-block:: console
west update
Make sure that all requirements are meet:

.. code-block:: console
pip install -r deps/zephyr/scripts/requirements.txt
.. code-block:: console
pip install -r zephyrbt/scripts/requirements.txt
Examples
********

* The `Minimal`_ is an example how to use the ZephyrBT without any IDE.
* The `Dynamic`_ uses their own thread and generate data and stubs from `Groot2`_ IDE.
* The ``Tutorial`` guide you step by step on ZephyrBT (comming soon).

.. _Minimal:
https://github.com/OSSystems/ZephyrBT/blob/master/samples/subsys/zephyrbt/minimal/README.rst

.. _Dynamic:
https://github.com/OSSystems/ZephyrBT/blob/master/samples/subsys/zephyrbt/dynamic/README.rst

.. _Tutorial:
https://github.com/OSSystems/ZephyrBT/blob/master/samples/subsys/zephyrbt/tutorial/README.rst

.. _Groot2:
https://www.behaviortree.dev/groot/

Tests
*****

To execute the tests just run twister pointing the TESTSUITE_ROOT to your $HOME/zephyrbt
folder.

.. code-block:: console
west twister -T zephyrbt
29 changes: 12 additions & 17 deletions samples/subsys/zephyrbt/dynamic/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ Building and Running

This application can be built and executed on ``native_posix_64`` as follows:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/zephyrbt/dynamic
:host-os: unix
:board: native_posix_64
:goals: run
:compact:
.. code-block:: console
west build -p -b native_posix_64 samples/subsys/zephyrbt/dynamic -t run
To build for another board, change "native_posix_64" above to that board's name.

Expand All @@ -30,21 +27,19 @@ Sample Output

.. code-block:: console
[2/130] Generating include/generated/version.h
-- Zephyr version: 3.6.99 (/home/gfbudke/workspace/freedom/deps/zephyr), build: v3.6.0-2217-gd3a962733227
[13/130] Generating include/lc_rs_bt.h, src/lc_rs_bt_data.c, src/lc_rs_bt_stub.c
-- Behaviour Tree: lc_rs_bt
-- Zephyr version: 4.0.99 (/home/gfbudke/Documents/Zephyr/zephyrbt/deps/zephyr), build: v4.0.0-288-g68361eacfa0d
[94/111] Generating include/modelo.h, src/modelo_data.c, src/modelo_stub.c
-- Behaviour Tree: modelo
-- Stack Size: 1024
-- Thread Priority: 0
[23/130] Generating /home/gfbudke/workspace/freedom/deps/modules/zep...s/modules/zephyrbt/samples/subsys/zephyrbt/dynamic/src/modelo_stub.c
-- Behaviour Tree: modelo
[95/111] Generating include/lc_rs_bt.h, src/lc_rs_bt_data.c, src/lc_rs_bt_stub.c
-- Behaviour Tree: lc_rs_bt
-- Stack Size: 1024
-- Thread Priority: 0
[129/130] Linking C executable zephyr/zephyr.elf
Generating files from /home/gfbudke/workspace/freedom/build/zephyr/zephyr.elf for board: native_posix
[129/130] cd /home/gfbudke/workspace/freedom/build && /home/gfbudke/workspace/freedom/build/zephyr/zephyr.exe
uart connected to pseudotty: /dev/pts/1
*** Booting Zephyr OS build v3.6.0-2217-gd3a962733227 ***
[110/111] Linking C executable zephyr/zephyr.elf
Generating files from /home/gfbudke/Documents/Zephyr/zephyrbt/zephyrbt/build/zephyr/zephyr.elf for board: native_posix
[110/111] cd /home/gfbudke/Documents/Zephyr/zephyrbt/zephyrbt/build && /home/gfbudke/Documents/Zephyr/zephyrbt/zephyrbt/build/zephyr/zephyr.exe
*** Booting Zephyr OS build v4.0.0-288-g68361eacfa0d ***
[00:00:00.000,000] <dbg> zephyrbt: zephyrbt_thread_func: tick
[00:00:00.000,000] <dbg> zephyrbt: zephyrbt_evaluate: A [control, 12]
[00:00:00.000,000] <dbg> zephyrbt: zephyrbt_evaluate: Deep: 1
Expand Down
9 changes: 3 additions & 6 deletions samples/subsys/zephyrbt/minimal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ Building and Running

This application can be built and executed on ``native_posix_64`` as follows:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/zephyrbt/minimal
:host-os: unix
:board: native_posix_64
:goals: run
:compact:
.. code-block:: console
west build -p -b native_posix_64 samples/subsys/zephyrbt/minimal -t run
To build for another board, change "native_posix_64" above to that board's name.

Expand Down
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stringcase

0 comments on commit ad89158

Please sign in to comment.