Configuration reference
Fields, types, defaults and constraints for every configuration object.
Configuration reference
auto_terminal also supports automatic-policy manual updates and external-input background preparation. Services and custom UIs use external. See the runtime notes.
GloveConfig
| Field | Type | Default |
|---|---|---|
side | Side | None | Defaults to None; for serial port devices, read from the verified identity |
connection | SerialConnection | ExternalConnection | Defaults to SerialConnection() automatic discovery |
name | str | None | Defaults to None |
enabled | bool | Defaults to True |
side: Required for external inputside: an explicit value must match the device or the input frameconnection: The serial port is used for a physical gloveconnection: external is used for per-frame external inputname: When provided, it must be non-empty and distinct among enabled same-side gloves; opposite sides may share a name when selected by name and sidename: with multiple devices, explicitly naming them is recommendedenabled: WhenFalse, it does not connect, does not start, cannot be selected, and cannot serve as a target source
Wired and Receiver wireless gloves both use GloveConfig, with one declaration per glove. SerialConnection.port accepts a wired-glove or Receiver port; opposite hands on one Receiver can use the same port, and the SDK shares the connection. Do not duplicate an ordinary wired port or the same hand side on one Receiver. Both Receiver and glove identities must be verified; the wired legacy-firmware identity fallback does not apply. See Wireless glove connection.
CompositeExoGloveConfig
| Field | Type | Default |
|---|---|---|
devices | Sequence[DeviceConfig] | Required; at least one member |
connection | SerialConnection | SerialConnection() (automatic discovery) |
enabled | bool | True |
name | str | None | None |
When provided, name must be non-empty. It identifies only the outer group and is not inherited by members. Keep member connections at their defaults and configure the shared serial connection on the group. See the composite guide.
SerialConnection
| Field | Type | Default |
|---|---|---|
auto_discover | bool | Automatically becomes True when no locating field is provided |
port | str | None | Defaults to None |
serial_number | str | None | Defaults to None |
baudrate | int | None | Defaults to None, which uses the SDK default |
auto_discover: Choose exactly one of this,port, andserial_numberauto_discover: the discovery result must be unique and pass identity validationport: Specifies the serial portport: the configured identity can be used only whenGloveConfig.sideis also provided, the port is recognized as a supported wired directly connected glove, and the old firmware does not supportidserial_number: Discovers by USB serial number, always requires a valid device identity, and cannot use the old firmware fallbackbaudrate: must be an integer between 1 and 4294967295 when provided
ExternalConnection
ExternalConnection has no configuration fields, but requires GloveConfig.side.
TargetConfig
| Field | Type | Default |
|---|---|---|
type | TargetType | None | Inferred when the candidate is unique |
name | str | None | Stays omitted and is not generated from package resources |
side | Side | None | Inferred when the candidate is unique |
source | DeviceSelector | None | Inferred when the candidate is unique |
algorithms | Sequence[TargetAlgorithm] | Defaults to an empty sequence |
type: An explicit value narrows and validates the candidatestype: the currently public values areHANDandARMname: Caller-defined output instance namename: it must not be duplicated for the same target ID, and the reserved nameskeletoncannot be used as an ordinary target nameside: An explicit value must be compatible with the source and the algorithm capabilitiessource: Zero candidates or multiple candidates both cause SDK creation to failalgorithms: Executed in configuration orderalgorithms: an empty sequence means the input is passed through directly
DeviceSelector
| Field | Type | Default |
|---|---|---|
type | str | No default value |
name | str | None | Defaults to None |
side | Side | None | Defaults to None |
type: Must be a non-empty device typetype: gloves use"glove"name: Matches the device name in the configurationside: Matches the physical side of the deviceside: the combined conditions must uniquely select one enabled source
TargetAlgorithm
TargetAlgorithm.calibration_key is an optional path to a complete .qnbotkey file exported with device.export_calibration(). Replay its algorithm configuration, bone configuration and calibration result. Omitting it retains the default capture/calibration workflow.
| Field | Type | Default |
|---|---|---|
id | str | BuiltinAlgorithm | No default value |
algorithm_config_path | str | None | None |
calibration_key | str | PathLike[str] | None | None |
use_bone_config | Literal["auto"] | bool | "auto" |
id: use a non-empty package ID, orBuiltinAlgorithm.SKELETONfor the built-in Skeletonalgorithm_config_path: optional parameter override file for this target. Save it somewhere the application can read and preferably supply an absolute path. The SDK does not discover it automatically; omit the field to use the algorithm defaults.- External packages must be installed and platform-compatible;
qnbot_handpackages require ABI 2.1
Personal bone profile loading
TargetAlgorithm.use_bone_config controls personal bone profiles only, not the override file selected by algorithm_config_path.
Use create_bone_config() to measure and save a personal profile before constructing Sdk. A successful repeated measurement replaces the same wearer and hand profile by default. Use export_bone_config() to back up a saved single-hand profile. Export rejects an existing destination by default. Restore historical profiles by placing their files in the matching directory. See Personal bone profile file for QR preparation, export, and storage.
use_bone_config | Behavior |
|---|---|
"auto" (default) | Load an existing profile; use the algorithm default model when the file is missing |
True | Require a readable, valid, compatible personal profile; otherwise SDK creation fails |
False | Ignore personal profiles and use the algorithm default model |
The SDK resolves files by AlgorithmsConfig.capture.operator_id and device side, rather than taking an arbitrary bone path in GloveConfig:
<application-data-root>/glove/bone-configs/<encoded-operator_id>/left.yaml
<application-data-root>/glove/bone-configs/<encoded-operator_id>/right.yamlThe data root defaults to ~/.qnbot and can be overridden through environment variables; see Application data directory for precedence. Unsafe characters in operator_id are encoded as UTF-8 bytes using %HH; do not concatenate raw user input into a path.
Automatic mode falls back only for missing files. It does not ignore read errors or invalid YAML in existing profiles. Requiring a profile means the file must be valid; it is not a higher accuracy level. Close and recreate Sdk after changing parameter or profile files to reload them.
Use measured values and the export format supported by the selected algorithm. Keep display-model bone lengths consistent: scaling a mesh does not change SDK kinematics, and SDK parameters do not automatically rebind third-party skins. See Personal bone lengths and skin binding.
For a complete runnable example, see algorithm_configuration.py.
To adjust fingertip offsets or use personal bone profiles, see Hand model parameter configuration, which distinguishes algorithm overrides, bone profiles, and results computed from captured samples.
AlgorithmsConfig
| Field | Type | Default |
|---|---|---|
calibration | CalibrationConfig | Defaults to CalibrationConfig() |
capture | CaptureConfig | Defaults to CaptureConfig() |
calibration: Controls whether to recalculate the calibrationcapture: Controls the interaction mode, the wearer identifier, and whether an existing capture is reused
CaptureConfig
| Field | Type | Default |
|---|---|---|
interaction | CaptureInteractionMode | Defaults to AUTO_TERMINAL |
force | bool | Defaults to False |
operator_id | str | Defaults to "default" |
interaction:AUTO_TERMINALsuits a foreground terminalinteraction: GUI, remote, or no-TTY hosts useEXTERNALand handle Capture controlforce: WhenTrue, ignores reusable raw frames and samples againforce: it is not continuous capture and does not sample again on every updateoperator_id: Must be a non-empty stringoperator_id: serves as the wearer identifier, used to separately look up and save captures and calibration records for different wearers
CalibrationConfig
| Field | Type | Default |
|---|---|---|
force | bool | Defaults to False |
force: WhenTrue, recalculates the calibration using the currently available capture without forcing a new sampleforce: after it succeeds the same SDK reuses the new result on stop or reconnect; the next SDK created withforce=Truestill set recalculates again
The two force settings are not interchangeable: use CaptureConfig.force to resample raw frames, or CalibrationConfig.force to recompute calibration from the available capture.
DebugConfig
| Field | Type | Default |
|---|---|---|
modules | Sequence[DebugModule] | Defaults to empty |
detail | DebugDetail | Defaults to SUMMARY |
sample_rate | int | None | Defaults to None, and ordinary events are not sampled |
modules: Optional:TRANSPORT,DEVICE,CAPTURE,CALIBRATION,RETARGETING,OUTPUTdetail: Can only beSUMMARYorFULLdetail:FULLrecords more runtime data and produces a larger log volumesample_rate: When provided, it must be a positiveuint32sample_rate: a value of N means one record out of every N, and important events are not dropped
SdkConfig and Sdk(...)
| Field | Type | Default |
|---|---|---|
devices | Sequence[DeviceConfig] | Required in SdkConfig; omitting it in Sdk(...) is equivalent to an empty sequence |
targets | Sequence[TargetConfig] | Defaults to an empty sequence |
debug | DebugConfig | None | Defaults to None, and no Debug logs are created |
algorithms | AlgorithmsConfig | Uses the default configuration |
devices: Each item must be a public device configurationdevices: enabled gloves must have unique name-and-side identities and final source IDstargets: Each target must resolve to an enabled sourcetargets: creation fails on duplication, ambiguity, or incompatibilitydebug: When provided, enables Debug logs for that SDK instancealgorithms: Controls Capture and Calibration behavior and is not responsible for installing algorithm packages
Application data directory
When no override is set, the SDK uses ~/.qnbot as the application data root directory.
Set QNBOT_SDK_HOME before constructing Sdk to use another directory. For compatibility, the SDK still reads QNBOT_HOME when QNBOT_SDK_HOME is absent; if both exist, QNBOT_SDK_HOME wins. Calibration records are stored in <data-root>/glove/calibrations, and Debug logs in <data-root>/logs.
- Timing: it must be set before creating the
Sdk - Consistency: the CLI and the SDK should use the same value, otherwise the SDK may not find the algorithm packages the CLI installed
Terminal output and interaction
With nothing configured, the built-in terminal enables level colors only in an interactive TTY: the Error label is bold red, the Warning label is yellow, the Info label uses the terminal's default foreground color, and Success key results use green. Only level labels and key results are colored; the whole message is not colorized. Debug logs and diagnostic JSON never contain ANSI colors.
NO_COLOR keeps messages plain text; QNBOT_INTERACTIVE_CONSOLE=1 tells the SDK that the current console can receive user input; PYCHARM_HOSTED=1 is set by JetBrains and makes the JetBrains Python Run/Debug Console input-capable even when it uses a pipe.
- Coloring scope: only level labels and key results are colored, never the whole message
- Non-TTY: redirected output, pipes and other non-TTY environments behave the same as setting
NO_COLOR - Setting only
TERM: does not make the SDK treat the console as input-capable - Interaction mode: these variables do not change the configured
interactionmode; taking over the interaction still requiresCaptureConfig.interactionto beEXTERNAL, see Capture
Subscription and algorithm configuration
SubscriptionConfig
Use channel.with_config(config) to configure one subscription without changing the original channel, other subscriptions, or defaults.
from qnbot_sdk import SubscriptionConfig
pose = device.pose()
latest_subscription = pose.with_config(
SubscriptionConfig.latest(max_rate_hz=30)
).subscribe(on_pose)
fifo_subscription = pose.with_config(
SubscriptionConfig.fifo(capacity=128, max_rate_hz=30)
).subscribe(on_pose)| Field / accessor | Type | Default |
|---|---|---|
delivery | str | Factory-selected |
capacity | int | 0 for latest |
max_rate_hz | float | None | None |
- FIFO capacity must be a positive integer.
- A supplied rate must be finite and positive.
| Delivery | Behavior |
|---|---|
latest | Coalesce pending values and deliver the newest value |
fifo | Preserve published order; discard the oldest pending value on overflow |
The first available sample is delivered immediately. Delivery does not catch up after a pause.
Pacing affects application callbacks and asynchronous iteration, without reducing SDK production or algorithm computation.
Snapshot latest() and one-shot next() retain their existing behavior.
FIFO cannot recover algorithm results coalesced before publication.
Python applications may also use async for on the configured view.
TargetAlgorithm
Place the value in TargetConfig.algorithms. Use a package ID already installed through the product CLI and compatible with the SDK and platform:
from qnbot_sdk import TargetAlgorithm
algorithm = TargetAlgorithm(
id="<package-id>",
use_bone_config="auto",
algorithm_config_path="config/override.yaml",
)| Field | Type | Default |
|---|---|---|
id | str | BuiltinAlgorithm | Required |
use_bone_config | Literal["auto"] | bool | "auto" |
algorithm_config_path | str | PathLike[str] | None | None |
calibration_key | str | PathLike[str] | None | None |
- A supplied configuration path must be nonempty.
- The selected algorithm package defines configuration file contents and errors.
| Bone policy | Behavior |
|---|---|
"auto" | Adopt valid existing configuration; use algorithm defaults when absent |
True | Fail when configuration is missing or invalid |
False | Ignore existing configuration |
Relative paths resolve from the working directory when the SDK is created. Recreate the SDK after editing the file;
follow the algorithm package instructions to decide whether recalibration is required.
AlgorithmsConfig.capture.operator_id selects the current operator, default default. These options do not perform bone-length calibration.
Prepare existing bone configuration through the product calibration workflow. Auto does not ignore an existing invalid file.
To preserve the old ordinary-target behavior that ignored bone configuration, select False explicitly.
Do not provide a custom bone-file path. Replace incompatible older algorithm packages through the product CLI.
See Migration for upgrade and rollback steps.