Bone configuration
Capture & calibration
Measure, save, and export personal bone profiles without creating an Sdk or connecting a glove. This workflow is independent of motion CaptureSession and algorithm CalibrationSession. See Personal bone profile file for the workflow.
Import these Python APIs from qnbot_sdk.glove.
create_bone_config()
Select terminal QR preparation or application-controlled interaction through one entry point.
Type
create_bone_config(
*, side: Side | str, operator_id: str = "default",
service_origin: str = ...,
interaction: CaptureInteractionMode = CaptureInteractionMode.AUTO_TERMINAL,
overwrite: BoneConfigOverwritePolicy | str = BoneConfigOverwritePolicy.REPLACE_EXISTING,
) -> BoneConfigInstallResult | BoneConfigSessionParameters
| Parameter | Default and description |
|---|---|
side | Required, Side.LEFT / Side.RIGHT or "left" / "right" |
operator_id | "default", non-empty wearer identifier |
service_origin | SDK default measurement service, normally leave unchanged |
interaction | Defaults to AUTO_TERMINAL, or select EXTERNAL. import the enum from qnbot_sdk |
overwrite | Defaults to REPLACE_EXISTING for terminal mode, replacing the same wearer and hand profile after a successful save. External interaction selects its policy at session.install(), with explicit DENY available |
AUTO_TERMINAL blocks until completion, cancellation, expiry or failure, returning BoneConfigInstallResult on success and releasing its session. EXTERNAL returns an application-owned BoneConfigSession. the application presents its link, queries status and installs the result.
Example
See Hand model parameters for the full workflow. Choose the call that matches your interaction mode.
Terminal interaction
from qnbot_sdk import Side
from qnbot_sdk.glove import create_bone_config
installed = create_bone_config(side=Side.RIGHT, operator_id="operator-01")
print(installed.path)External interaction
from qnbot_sdk import CaptureInteractionMode, Side
from qnbot_sdk.glove import BoneConfigSessionStatus, create_bone_config
with create_bone_config(
side=Side.RIGHT,
operator_id="operator-01",
interaction=CaptureInteractionMode.EXTERNAL,
) as bone_config_session:
print(bone_config_session.info.phone_url)
try:
while bone_config_session.poll() is BoneConfigSessionStatus.PENDING:
pass
installed = bone_config_session.install()
print(installed.path)
except KeyboardInterrupt:
bone_config_session.cancel()
raiseThe external example prints the phone link for presentation by your application UI. poll() enforces the service polling interval and the original session expiry, and reports expiry or network errors. Install the completed result before releasing the session.
interaction accepts the CaptureInteractionMode enum. Invalid arguments fail before creating a measurement session. Run network operations on a GUI worker thread.
export_bone_config()
Read the saved single-hand profile selected by wearer identifier and side from the standard profile directory, validate it, and export it to the requested destination. Returns the destination path as a string. The operation works independently of an SDK instance, glove connection, or measurement session.
Type
export_bone_config(
path: PathLike[str] | str, *, side: Side | str,
operator_id: str = "default",
overwrite: BoneConfigOverwritePolicy | str = BoneConfigOverwritePolicy.DENY,
) -> strpath is the export destination. operator_id and side select the saved profile to back up. Overwrite policy rejects an existing destination by default. Explicitly select overwrite=BoneConfigOverwritePolicy.REPLACE_EXISTING to replace it. A missing profile, invalid single-hand YAML, or write failure produces an error. A failed export preserves an existing destination file.
Example
from qnbot_sdk import Side
from qnbot_sdk.glove import export_bone_config
exported_path = export_bone_config(
"/path/to/backup/right.yaml",
side=Side.RIGHT,
operator_id="operator-01",
)
print(exported_path)Export reads the saved source profile for the requested wearer and side, then writes to the caller's explicit destination using the chosen overwrite policy. See Hand model parameters for storage locations and historical-file restoration.
BoneConfigSession.info
Read cached local session information without a network request.
Type
BoneConfigSession.info: BoneConfigSessionInfoReturns BoneConfigSessionInfo. This is a read-only property in Python.
BoneConfigSession.poll()
Perform one bounded status query; this does not start a polling loop.
Type
BoneConfigSession.poll() -> BoneConfigSessionStatusReturns BoneConfigSessionStatus, with value PENDING or COMPLETED. Poll serially. Inside poll(), the SDK enforces info.poll_interval_seconds between queries and bounds waiting by the original session expiry. Stop polling on completion and call install(). Create a new session after expiry.
BoneConfigSession.install()
Fetch a completed measurement, validate it, and save the personal bone profile.
Type
BoneConfigSession.install(
overwrite: BoneConfigOverwritePolicy | str = BoneConfigOverwritePolicy.REPLACE_EXISTING,
) -> BoneConfigInstallResultCall after measurement completes. A successful save replaces the existing profile for the same wearer and hand by default and returns BoneConfigInstallResult. Explicitly pass overwrite=BoneConfigOverwritePolicy.DENY to report an error and preserve an existing profile. Remote cleanup is requested after a successful save. A false cleanup_confirmed preserves local success.
BoneConfigSession.cancel()
Cancel the remote measurement workflow without deleting an installed profile.
Type
BoneConfigSession.cancel() -> NoneRelease the local session after cancellation.
BoneConfigSession.close()
Stop local operations and release the handle; repeated calls are safe.
Type
BoneConfigSession.close() -> NoneOther operations raise ClosedHandleError after closing. Use with for automatic release; call cancel() first when remote cancellation is needed.
Errors and execution
Invalid arguments, mismatched side or format, an existing destination with explicit deny, an incomplete or expired session, and network or write failures cause errors. Failed installation preserves existing configuration. Network operations are synchronous; run them on a worker thread in a GUI.