Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This setup is suitable for installation on a real pib and can be used as development enviromnent. Given experience with docker this setup is recommended over using the local installation.

Alternatively to installing pib’s software using the setup script as described here, it is possible to run the software stack using Docker. For a comprehensive overview and introduction to Docker check out the official documentation.

Note: As pib requires access to the speakers, microphone, USB devices (camera) and GPIO pins (motors), Docker for Windows and macOS are not supported as they do not have hardware support.

Software Overview

The pib software stack consists of two components: The backend, found in the pib-backend repository and the frontend (called Cerebra), found in the cerebra repository.

Cerebra is a web application developed using AngularJS. The backend consists of ROS2 Humble, a Flask API for configuration management and the Tinkerforge brick daemon that provides an API layer to control the motors of pib within ROS2.

Installation

Docker can either be set up with the provided installation script (Step 1.1.1) or by installing Docker manually (Step 1.1.2). Given experience with docker, step 1.1.2 is recommended.

1.1.1 With docker setup script

The pib-backend repository contains a setup/pib-docker-setup.sh script which will automatically install the docker engine on Ubuntu, clones the necessary GitHub repositories and starts the containers.

It can be executed using:

# Using the stable version
$ bash pib-docker-setup.sh

# Using a specific nightly build
$ bash pib-docker-setup.sh -b=<pib_backend_branch> -f=<cerebra_branch>

After the execution, the pib-backend and cerebra repository can be found inside a newly created app directory found in the home directory.

1.1.2 Without docker setup script

The software can also be installed without using the provided setup script:

  1. If necessary, install the Docker Engine. Pay attention to the post-installation steps to be able to use the docker command without sudo.

  2. Clone the cerebra and pib-backend repositories.

  3. Both repositories contain a docker-compose.yaml. pib-backend supports multiple profiles:

    1. camera - include use of the camera features

    2. motors - include use of the motor control features

    3. voice_assistant- include use of the Voice Assistant features (requires Tryb)

  4. Cerebra requires that the backend containers are running, so always start them first.

1.2 Setting up the Voice Assistant

To setup the voice assistant functionality, create a password.env file in the root directory of pib-backend. This file (even if empty) is required for the containers to start. To use the voice assistant following parameters are required:

TRYB_URL_PREFIX=<base_url_tryb>
PUBLIC_API_TOKEN=<tryb_public_api_token>

1.3 Common docker commands

If not done yet, the docker containers can now be started. Start all pib-backend containers using:

$ docker compose --profile camera --profile motors --profile voice_assistant up -d

Start Cerebra using:

docker compose up -d

Note: The -d flag is optional.

For a more comprehensive overview of docker commands, check out this cheatsheet for the Docker CLI and this cheatsheet for docker-compose.

To run or stop docker containers, navigate with the terminal to either the cerebra or pib-backend directorys and run:

# start containers according to the docker-compose.yaml in the same directory
$ docker compose up

# run docker containers in detached mode (will keep running, even when closing the terminal)
$ docker compose up -d

# use profiles
$ docker compose --profile <profile_name1> --profile <profile_name2> up
# example, running the full pib-backend stack
$ docker compose --profile camera --profile motors profile voice_assistant up

# stop detached containers
$ docker compose down

# rebuild containers (e.g., after modifying the source code)
$ docker compose up --build --force-recreate

Show containers:

$ docker ps    (show running containers)
$ docker ps -a (all containers)

1.4 Final steps

After starting the docker containers for both, pib-backend and cerebra, you will be able to access Cerebra under localhost:8080 in your webbrowser of choice.

  • No labels