Application configuration

This section provides an overview of the application configuration structure in TOML format and how to define each section.

Info

The Info section contains basic information about the application.

Example:

1[info]
2name = "My Application"
3description = "An example application"

toml

Runtime

The Runtime section defines the runtime environment and settings for the application.

Example:

1[runtime]
2application = "app.py#PersonDetectorApp"
3workdir = "/app"
4runs_on = { type = "hub-os", version = "2022.364.1530" }

toml

application

In the example, app.py is a path to the python file (relative to workdir). PersonDetectorApp is the name of the class that inherits from robothub.RobotHubApplication (present in app.py).

workdir

Folder in which your app is launched. Also where predefined well-known paths (e.g. frontend) are expected. Its also the folder that represents the whole application (source code).

runs_on

The runs_on property specifies the runtime environment for the application. It can be one of the following types:

  • custom: A custom environment with a specified Dockerfile.
  • image: A pre-built Docker image with a specified name.
  • A predefined environment, e.g., hub-os, hub-os_ros2_galactic, etc.

Predefined environments

EnvironmentDescription
hub-osDefault HubOS environment (Debian based)
hub-os_ros2_galacticHubOS with ROS2 Galactic
hub-os_ros2_foxyHubOS with ROS2 Foxy
hub-os_ros2_humbleHubOS with ROS2 Humble
hubosDeprecated alias for hub-os
hubos_ros2_galacticDeprecated alias for hub-os_ros2_galactic
hubos_ros2_foxyDeprecated alias for hub-os_ros2_foxy
hubos_ros2_humbleDeprecated alias for hub-os_ros2_humble

scripts and services

Define scripts and services in the Runtime section:

1[[runtime.scripts]]
2when = "pre_launch"
3path = "my_pre_launch_script.sh"
4
5[[runtime.services]]
6path = "my_service.sh"

toml

frontend

The frontend property defines settings related to the application's frontend. It's an optional section.

Example:

1[runtime.frontend]
2access = "public"
3redirectToIndex = true

toml

permissions

List the permissions required by the application in the permissions property:

1[runtime]
2# other entries here...
3permissions = ["gpio", "i2c"]

toml

requirements

List the requirements for the application in the requirements property:

1[runtime]
2# other entries here...
3requirements = ["stereo_depth"]

toml

Configuration

The Configuration section defines the application's deployment settings.

Example:

1[[configuration]]
2visual = "divider"
3
4[[configuration]]
5visual = "section"
6title = "My Section"
7
8[[configuration]]
9field = "boolean"
10key = "my_boolean"
11label = "Enable Feature"
12initial_value = true
13
14[[configuration]]
15field = "num_range"
16key = "my_num_range"
17label = "Range"
18step = 1
19min = 0
20max = 100
21initial_value = 50
22
23[[configuration]]
24field = "choice"
25key = "my_choice"
26label = "Choose Option"
27style = "radio"
28allow_multiple = false
29options = [
30  { key = "option1", label = "Option 1", default = true },
31  { key = "option2", label = "Option 2" }
32]
33
34[[configuration]]
35field = "text"
36key = "my_text"
37label = "Text Input"
38prefix = "Prefix:"
39initial_value = "Example"
40
41[[configuration]]
42field = "time_range"
43key = "my_time_range"
44label = "Time Range"
45initial_value = { from = "08:00", to = "18:00" }

toml