ON THIS PAGE

  • Configuration
  • Reference
  • Root fields
  • Info
  • Runtime
  • Configuration

Configuration

感知应用程序由一个 TOML file 叫做 robotapp.toml的文件配置. 该文件在App的根目录中. 这里是一个示例:
Toml
1config_version = "2.0"
2
3[info]
4name = "{{{ APP_NAME }}}"
5description = "This is a generated description. Replace it with your own."
6
7[runtime]
8application = "app.py#Application"
9workdir = "/app"
10
11[runtime.runs_on]
12type = "image"
13name = "ghcr.io/luxonis/robothub-app-v2:2023.326.2033-rvc2-regular"
14
15[[configuration]]
16visual = "section"
17title = "Upload intervals"
18
19[[configuration]]
20key = "image_event_upload_interval_minutes"
21label = "Image event upload interval (minutes)"
22field = "num_range"
23step = 1
24min = 1
25max = 60
26initial_value = 1

Reference

Root fields

config_version 配置文件的格式版本. 目前, 仅支持的版本是 2.0.

Info

info 板块包含了App信息, 例如它的名字和描述.
FieldDescription
info.nameThe name of the app. Currently unused.
info.descriptionThe description of the app. Currently unused.

Runtime

runtime 部分配置应用程序的运行时环境.
FieldDescription
runtime.applicationThe name of the Python file containing the app's main logic. The path is relative to the root directory.
runtime.workdirThe working directory of the app. Defaults to /app.
runtime.permissionsThe permissions required to run the app. Defaults to [].An example:
Toml
1permissions = ["gpio", "i2c"]
runtime.runs_onThe runtime container in which the app will run.type = "image"The app will run in a container based on the specified image. The image is pulled before installation.An example:
Toml
1[runtime.runs_on]
2type = "image"
3name = "ghcr.io/luxonis/robothub-app-v2:2023.326.2033-rvc2-regular"

Configuration

configuration 定义了应用的安装时配置.Visual
TypeDescription
divider
The divider to use for the configuration section.An example:
Toml
1[[configuration]]
2visual = "divider"
section
The section to use for the configuration section.An example:
Toml
1[[configuration]]
2visual = "section"
3title = "Upload intervals"
Fields
TypeDescription
boolean
A boolean field.An example:
Toml
1[[configuration]]
2field = "boolean"
3key = "my_boolean"
4label = "Enable feature"
5initial_value = true
num_range
A number range field.An example:
Toml
1[[configuration]]
2field = "num_range"
3key = "my_num_range"
4label = "Range"
5step = 1
6min = 0
7max = 100
8initial_value = 50
choice
A choice field.An example:
Toml
1[[configuration]]
2field = "choice"
3key = "my_choice"
4label = "Choose option"
5style = "radio" # ir "dropdown"
6allow_multiple = false
7options = [
8  { key = "option1", label = "Option 1", default = true },
9  { key = "option2", label = "Option 2" }
10]
text
A text field.An example:
Toml
1[[configuration]]
2field = "text"
3key = "my_text"
4label = "Text input"
5prefix = "USD"
6initial_value = "Example"
time_range
A time range field.An example:
Toml
1[[configuration]]
2field = "time_range"
3key = "my_time_range"
4label = "Time range"
5initial_value = { from = "08:00", to = "18:00" }
roi_rect4_selector
A ROI selector on live stream field. Defined by 2 points (x0, y0) and (x1, y1).An example:
Toml
1[[configuration]]
2field = "roi_rect4_selector"
3key = "my_roi_rect4_selector"
4label = "Detection area"
5initial_value = "0,0,1,1"
roi_rect8_selector
A ROI selector on live stream field. Defined by 4 points (x0, y0), (x1, y1), (x2, y2), (x3, y3).An example:
Toml
1[[configuration]]
2field = "roi_rect8_selector"
3key = "my_roi_rect8_selector"
4label = "Detection area"
5initial_value = "0,0;1,0;0,1;1,1"