From 90a19345761854201a7a59d5e1f555229a8dcbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Boczek?= Date: Wed, 25 Sep 2024 11:42:05 +0200 Subject: [PATCH 1/5] docs: improve whoami setup docs --- docs/create_robots_whoami.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/create_robots_whoami.md b/docs/create_robots_whoami.md index 6baf044d..105ecfee 100644 --- a/docs/create_robots_whoami.md +++ b/docs/create_robots_whoami.md @@ -8,19 +8,21 @@ Your robot's `whoami` package serves as a configuration package for the `rai_who ## Example (Franka Emika Panda arm) -1. Create a whoami package for Panda +1. Setup the repository using 1st and 2nd step from [Setup](../README.md#setup) -``` +2. Create a whoami package for Panda + +```shell poetry run create_rai_ws --name panda --destination-directory src/examples ``` -2. Fill in the `src/examples/panda_whoami/description` folder with data:\ +3. Fill in the `src/examples/panda_whoami/description` folder with data:\ 2.1 Save [this image](https://robodk.com/robot/img/Franka-Emika-Panda-robot.png) into `src/examples/panda_whoami/description/images`\ 2.2 Save [this document](https://github.com/user-attachments/files/16417196/Franka.Emika.Panda.robot.-.RoboDK.pdf) in `src/examples/panda_whoami/description/documentation` -3. Run the `parse_whoami_package`. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity. +4. Run the `parse_whoami_package`. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity. -``` +```shell poetry run parse_whoami_package src/examples/panda_whoami/description src/examples/panda_whoami/description ``` @@ -33,7 +35,7 @@ You can test your new `panda_whoami` package by calling `rai_whoami` services: 2. Building and sourcing the install -``` +```shell colcon build source install/setup.sh export PYTHONPATH="$(dirname $(dirname $(poetry run which python)))/lib/python$(poetry run python --version | awk '{print $2}' | cut -d. -f1,2)/site-packages:$PYTHONPATH" @@ -42,7 +44,7 @@ ros2 run rai_whoami rai_whoami_node --ros-args -p robot_description_package:="pa 2. Calling the rai_whoami services -``` +```shell ros2 service call /rai_whoami_identity_service std_srvs/srv/Trigger # ask for identity ros2 service call /rai_whoami_selfimages_service std_srvs/srv/Trigger # ask for images folder ros2 service call /rai_whoami_constitution_service std_srvs/srv/Trigger # ask for robot constitution From afada5de6a397729f941c352e82cb5f198ba47fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Boczek?= Date: Wed, 25 Sep 2024 12:01:38 +0200 Subject: [PATCH 2/5] docs: fix whoami creation command --- docs/create_robots_whoami.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/create_robots_whoami.md b/docs/create_robots_whoami.md index 105ecfee..2309ee58 100644 --- a/docs/create_robots_whoami.md +++ b/docs/create_robots_whoami.md @@ -23,7 +23,7 @@ poetry run create_rai_ws --name panda --destination-directory src/examples 4. Run the `parse_whoami_package`. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity. ```shell -poetry run parse_whoami_package src/examples/panda_whoami/description src/examples/panda_whoami/description +poetry run parse_whoami_package src/examples/panda_whoami/description ``` > [!IMPORTANT] From 12804c6d07c06d9069cde656f1e7a28f5623d3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Boczek?= Date: Wed, 25 Sep 2024 12:35:54 +0200 Subject: [PATCH 3/5] add note about cost to docs --- docs/create_robots_whoami.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/create_robots_whoami.md b/docs/create_robots_whoami.md index 2309ee58..00fa1151 100644 --- a/docs/create_robots_whoami.md +++ b/docs/create_robots_whoami.md @@ -12,9 +12,9 @@ Your robot's `whoami` package serves as a configuration package for the `rai_who 2. Create a whoami package for Panda -```shell -poetry run create_rai_ws --name panda --destination-directory src/examples -``` + ```shell + poetry run create_rai_ws --name panda --destination-directory src/examples + ``` 3. Fill in the `src/examples/panda_whoami/description` folder with data:\ 2.1 Save [this image](https://robodk.com/robot/img/Franka-Emika-Panda-robot.png) into `src/examples/panda_whoami/description/images`\ @@ -22,6 +22,9 @@ poetry run create_rai_ws --name panda --destination-directory src/examples 4. Run the `parse_whoami_package`. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity. +> **NOTE**: Vector database is created using the OpenAI API. Parsing bigger documents +> might lead to costs. Embedding model can be configured in [config.toml](../config.toml). + ```shell poetry run parse_whoami_package src/examples/panda_whoami/description ``` From f002938125cc1b2f9285f3fbf8775ff97fc99a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Boczek?= Date: Wed, 25 Sep 2024 12:47:16 +0200 Subject: [PATCH 4/5] docs(`create_robots_whoami`): simplify --- docs/create_robots_whoami.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/create_robots_whoami.md b/docs/create_robots_whoami.md index 00fa1151..61acd0ec 100644 --- a/docs/create_robots_whoami.md +++ b/docs/create_robots_whoami.md @@ -40,8 +40,6 @@ You can test your new `panda_whoami` package by calling `rai_whoami` services: ```shell colcon build -source install/setup.sh -export PYTHONPATH="$(dirname $(dirname $(poetry run which python)))/lib/python$(poetry run python --version | awk '{print $2}' | cut -d. -f1,2)/site-packages:$PYTHONPATH" ros2 run rai_whoami rai_whoami_node --ros-args -p robot_description_package:="panda_whoami" ``` From 44392f0fe3ac1ca494f87beb0f5523b1e3c7b805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Boczek?= Date: Thu, 26 Sep 2024 13:36:40 +0200 Subject: [PATCH 5/5] docs: fix vector database description --- docs/create_robots_whoami.md | 9 +++++---- docs/vendors.md | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/create_robots_whoami.md b/docs/create_robots_whoami.md index 61acd0ec..944ba74e 100644 --- a/docs/create_robots_whoami.md +++ b/docs/create_robots_whoami.md @@ -22,8 +22,9 @@ Your robot's `whoami` package serves as a configuration package for the `rai_who 4. Run the `parse_whoami_package`. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity. -> **NOTE**: Vector database is created using the OpenAI API. Parsing bigger documents -> might lead to costs. Embedding model can be configured in [config.toml](../config.toml). +> **NOTE**: By default the vector database is created using the OpenAI API. Parsing +> bigger documents might lead to costs. Embedding model can be configured in +> [config.toml](../config.toml) (`ollama` works locally, see [docs/vendors.md](./vendors.md#ollama)). ```shell poetry run parse_whoami_package src/examples/panda_whoami/description @@ -36,10 +37,10 @@ poetry run parse_whoami_package src/examples/panda_whoami/description You can test your new `panda_whoami` package by calling `rai_whoami` services: -2. Building and sourcing the install +2. Building the `rai_whoami` package and running the `rai_whoami_node` for your `Panda` robot: ```shell -colcon build +colcon build --symlink-install ros2 run rai_whoami rai_whoami_node --ros-args -p robot_description_package:="panda_whoami" ``` diff --git a/docs/vendors.md b/docs/vendors.md index 004e525d..95e38e59 100644 --- a/docs/vendors.md +++ b/docs/vendors.md @@ -2,6 +2,8 @@ ## Ollama +For installation see: https://ollama.com/ + ```python from langchain_community.chat_models import ChatOllama