Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve whoami docs #239

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions docs/create_robots_whoami.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ 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)

```
poetry run create_rai_ws --name panda --destination-directory src/examples
```
2. Create a whoami package for Panda

2. Fill in the `src/examples/panda_whoami/description` folder with data:\
```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`\
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.

```
poetry run parse_whoami_package src/examples/panda_whoami/description src/examples/panda_whoami/description
> **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
```

> [!IMPORTANT]
Expand All @@ -31,18 +37,16 @@ poetry run parse_whoami_package src/examples/panda_whoami/description src/exampl

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:

```
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"
```shell
colcon build --symlink-install
ros2 run rai_whoami rai_whoami_node --ros-args -p robot_description_package:="panda_whoami"
```

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
Expand Down
2 changes: 2 additions & 0 deletions docs/vendors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Ollama

For installation see: https://ollama.com/

```python
from langchain_community.chat_models import ChatOllama

Expand Down