BotRobotProfile bot.robot-profile@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- bot
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-043
- Schema
https://openvibe.network/contracts/bot/robot-profile.v1.json
bot.robot-profile@1 (ADR-043 decision 7): a robot profile as OpenVibe.Bot ships it (server/profiles/*.json) and serves it (GET /api/v1/profiles, /profiles/:id; validateProfile in server/profiles/index.js). The panel is a function of the profile. Capability and widget names are open strings that Bot checks against registries in code, so a new one never needs a schema change. As served, vendor, kind, description, variants and camera are null when the file leaves them out, limits carry their defaults (max_speed 1, max_turn 1, max_command_ms 300, heartbeat_ms 1000) and commands always include halt. mapping is the driver's own hardware map, open beyond driver.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
version | integer | yes |
| |
name | string | yes |
| |
vendor | string | null | |||
kind | enum |
| ||
description | string | null | |||
capabilities | array of string | yes |
| |
variants | object | null | |||
mapping | object | yes | ||
mapping.driver | enum | yes |
| |
mapping.plugin | string | |||
commands | object |
| ||
commands.drive | object |
| ||
commands.drive.axes | object | yes |
| |
commands.drive.axes.throttle | array of number |
| ||
commands.drive.axes.steer | array of number |
| ||
commands.drive.axes.x | array of number |
| ||
commands.drive.axes.y | array of number |
| ||
commands.drive.axes.rotation | array of number |
| ||
commands.ptz | object |
| ||
commands.ptz.axes | object | yes |
| |
commands.ptz.axes.pan | array of number |
| ||
commands.ptz.axes.tilt | array of number |
| ||
commands.ptz.axes.zoom | array of number |
| ||
commands.actuator | object |
| ||
commands.actuator.names | object | yes | ||
commands.say | object |
| ||
commands.say.max_chars | integer |
| ||
commands.display | object |
| ||
commands.display.modes | array of enum | yes |
| |
commands.display.faces | array of string |
| ||
commands.display.max_chars | integer |
| ||
commands.halt | object |
| ||
widgets | array of object | yes |
| |
widgets[].type | string | yes |
| |
widgets[].capability | string | |||
widgets[].label | string |
| ||
widgets[].order | integer | |||
widgets[].command | object |
| ||
widgets[].command.kind | enum | yes |
| |
widgets[].command.names | array of string |
| ||
camera | object | null | |||
limits | object |
| ||
limits.max_speed | number | |||
limits.max_turn | number | |||
limits.max_command_ms | integer |
| ||
limits.heartbeat_ms | integer |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: adeept-file
{
"id": "adeept.adr036",
"version": 1,
"name": "Adeept ADR036 4WD Smart Car",
"vendor": "Adeept",
"kind": "onboard",
"capabilities": [
"drive.differential",
"servo.pan_tilt",
"lights.rgb",
"speaker.horn",
"sensor.ultrasonic",
"battery"
],
"mapping": {
"driver": "pca9685",
"plugin": "adeept_adr036",
"wheels": "ordinary",
"i2c_bus": 1,
"address": "0x5f",
"motor_channels": [
8,
9,
10,
11,
12,
13,
14,
15
],
"servo_channels": {
"pan": 0,
"tilt": 1
},
"battery": {
"driver": "ads7830",
"address": "0x48"
},
"lights": "ws2812",
"horn": "buzzer"
},
"commands": {
"drive": {
"axes": {
"throttle": [
-1,
1
],
"steer": [
-1,
1
]
}
},
"actuator": {
"names": {
"pan": {
"type": "number",
"range": [
-1,
1
]
},
"tilt": {
"type": "number",
"range": [
-1,
1
]
},
"buzzer": {
"type": "tone",
"hz": [
220,
880
]
},
"lights": {
"type": "rgb",
"count": 8
}
}
}
},
"widgets": [
{
"type": "drive",
"capability": "drive.differential",
"label": "Drive",
"order": 1,
"command": {
"kind": "drive"
}
},
{
"type": "pan-tilt",
"capability": "servo.pan_tilt",
"label": "Pan / tilt",
"order": 2,
"command": {
"kind": "actuator",
"names": [
"pan",
"tilt"
]
}
},
{
"type": "battery",
"capability": "battery",
"label": "Battery",
"order": 3
},
{
"type": "latency",
"label": "Latency",
"order": 4
}
],
"camera": {
"transport": "whip",
"resolution": "640x480"
},
"limits": {
"max_speed": 1,
"max_turn": 1,
"max_command_ms": 300,
"heartbeat_ms": 1000
}
}Valid: sim-served
{
"id": "sim.rover",
"version": 1,
"name": "Simulated rover",
"vendor": null,
"kind": "server",
"description": null,
"capabilities": [
"drive.differential",
"camera"
],
"variants": null,
"mapping": {
"driver": "sim"
},
"commands": {
"drive": {
"axes": {
"throttle": [
-1,
1
],
"steer": [
-1,
1
]
}
},
"say": {
"max_chars": 200
},
"halt": {}
},
"widgets": [
{
"type": "drive",
"capability": "drive.differential",
"label": "Drive",
"order": 1,
"command": {
"kind": "drive"
}
},
{
"type": "camera",
"capability": "camera",
"order": 2
}
],
"camera": null,
"limits": {
"max_speed": 1,
"max_turn": 1,
"max_command_ms": 300,
"heartbeat_ms": 1000
}
}Rejected: unknown-command-kind
{
"id": "adeept.adr036",
"version": 1,
"name": "Adeept ADR036 4WD Smart Car",
"vendor": "Adeept",
"kind": "onboard",
"capabilities": [
"drive.differential",
"servo.pan_tilt",
"lights.rgb",
"speaker.horn",
"sensor.ultrasonic",
"battery"
],
"mapping": {
"driver": "pca9685",
"plugin": "adeept_adr036",
"wheels": "ordinary",
"i2c_bus": 1,
"address": "0x5f",
"motor_channels": [
8,
9,
10,
11,
12,
13,
14,
15
],
"servo_channels": {
"pan": 0,
"tilt": 1
},
"battery": {
"driver": "ads7830",
"address": "0x48"
},
"lights": "ws2812",
"horn": "buzzer"
},
"commands": {
"fly": {}
},
"widgets": [
{
"type": "drive",
"capability": "drive.differential",
"label": "Drive",
"order": 1,
"command": {
"kind": "drive"
}
},
{
"type": "pan-tilt",
"capability": "servo.pan_tilt",
"label": "Pan / tilt",
"order": 2,
"command": {
"kind": "actuator",
"names": [
"pan",
"tilt"
]
}
},
{
"type": "battery",
"capability": "battery",
"label": "Battery",
"order": 3
},
{
"type": "latency",
"label": "Latency",
"order": 4
}
],
"camera": {
"transport": "whip",
"resolution": "640x480"
},
"limits": {
"max_speed": 1,
"max_turn": 1,
"max_command_ms": 300,
"heartbeat_ms": 1000
}
}Rejected: unknown-driver
{
"id": "adeept.adr036",
"version": 1,
"name": "Adeept ADR036 4WD Smart Car",
"vendor": "Adeept",
"kind": "onboard",
"capabilities": [
"drive.differential",
"servo.pan_tilt",
"lights.rgb",
"speaker.horn",
"sensor.ultrasonic",
"battery"
],
"mapping": {
"driver": "arduino"
},
"commands": {
"drive": {
"axes": {
"throttle": [
-1,
1
],
"steer": [
-1,
1
]
}
},
"actuator": {
"names": {
"pan": {
"type": "number",
"range": [
-1,
1
]
},
"tilt": {
"type": "number",
"range": [
-1,
1
]
},
"buzzer": {
"type": "tone",
"hz": [
220,
880
]
},
"lights": {
"type": "rgb",
"count": 8
}
}
}
},
"widgets": [
{
"type": "drive",
"capability": "drive.differential",
"label": "Drive",
"order": 1,
"command": {
"kind": "drive"
}
},
{
"type": "pan-tilt",
"capability": "servo.pan_tilt",
"label": "Pan / tilt",
"order": 2,
"command": {
"kind": "actuator",
"names": [
"pan",
"tilt"
]
}
},
{
"type": "battery",
"capability": "battery",
"label": "Battery",
"order": 3
},
{
"type": "latency",
"label": "Latency",
"order": 4
}
],
"camera": {
"transport": "whip",
"resolution": "640x480"
},
"limits": {
"max_speed": 1,
"max_turn": 1,
"max_command_ms": 300,
"heartbeat_ms": 1000
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('bot.robot-profile@1', value); // { valid, errors: [{ path, message }] }