Glove device interfaces
Core interfaces
Returned by glove.device(), this object represents one configured glove. Members below cover identity, lifecycle, data and controls, capture, and calibration.
GloveDevice.name
Read the configured device name.
Type
GloveDevice.name -> str | NoneReturns
str | None.
Details
- Call conditions: SDK not closed.
Errors
ClosedHandleError.
GloveDevice.source_id
Read the runtime source identifier.
Type
GloveDevice.source_id -> strReturns
str.
Details
- Call conditions: SDK not closed.
Errors
ClosedHandleError.
GloveDevice.get_device_info()
Reads the verified device information snapshot.
Type
GloveDevice.get_device_info() -> GloveDeviceInfoReturns
GloveDeviceInfo. See DeviceInfo.
Details
- Call conditions: After the SDK is created, can be before start.
Errors
UnavailableFeatureError(identity not verified).
GloveDevice.start()
Start devices and capabilities in this object’s scope.
Type
GloveDevice.start(mode: CalibrationMode | str | None = None) -> NoneParameters
mode: CalibrationMode | str | None, defaultNone. Omission inherits the Glove-domain default.- Accepts
AUTO,MANUAL,NONE, or stringsauto,manual,none.
Returns
None.
Details
- Call conditions: When a single device needs separate control.
Errors
- Connection, identity, data stream or lifecycle errors; stop cancels active calibration.
Example
Choose MANUAL mode when the application manages Capture and Calibration. Prepare channels and subscriptions before starting; the complete example shows the subsequent workflow.
from qnbot_sdk.glove import CalibrationMode
device.start(CalibrationMode.MANUAL)Related complete Capture workflow: host_capture_calibration.py.
GloveDevice.stop()
Stop the current scope and disconnect its devices.
Type
GloveDevice.stop() -> NoneReturns
None.
Details
- The scope can be started again; stopping a device cancels active calibration.
Errors
- Connection, identity, data stream or lifecycle errors; stop cancels active calibration.
GloveDevice.close()
Close the current scope and release its resources.
Type
GloveDevice.close() -> NoneReturns
None.
Errors
ClosedHandleError.
GloveDevice.pose()
Get a read channel for raw glove poses.
Type
GloveDevice.pose() -> ReadChannel[GlovePose]Returns
ReadChannel[GlovePose]. See GlovePose. See ReadChannel[T].
Details
- Call conditions: After the SDK is created; recommended to call before start.
Errors
- Lifecycle or close errors.
See also
GloveDevice.imu()
Get a read channel for raw IMU data.
Type
GloveDevice.imu() -> ReadChannel[GloveImu]Returns
ReadChannel[GloveImu]. See GloveImu. See ReadChannel[T].
Details
- Call conditions: After the SDK is created; recommended to call before start.
Errors
- Lifecycle, close or not-supported errors.
See also
GloveDevice.emf()
Type
GloveDevice.emf() -> ReadChannel[GloveEmf]Select raw EMF I/Q acquired in pairs with hand pose. Selection establishes paired acquisition at the confirmed pose rate. Correlate source, session and pair sequence, preserving signed integral values and invalid flags. See Raw EMF.
GloveDevice.export_calibration()
Type
GloveDevice.export_calibration(destination, target: str | TargetName | None = None) -> dict[str, object]After successful target output, export the active algorithm configuration, bone configuration and calibration result to a new destination. Specify target when multiple targets exist. Export reports unavailable when the current route has no valid calibration. Replay with TargetAlgorithm.calibration_key, matching target and hand side.
GloveDevice.pressure()
Read Tactile ENF Positioning Glove (VetraGlove HMP-MX) pressure.
Type
GloveDevice.pressure() -> ReadChannel[GlovePressure]Returns
ReadChannel[GlovePressure]
Details
GlovePressure.readings contains 460 raw values (0–255) in device order. A frame without pressure does not publish a sample. See the pressure example.
GloveDevice.status()
Get a read channel for device connection and recovery status.
Type
GloveDevice.status() -> ReadChannel[GloveStatus]Returns
ReadChannel[GloveStatus]. See GloveStatus. See ReadChannel[T].
Details
- Call conditions: After the SDK is created; recommended to call before start.
Errors
- Lifecycle or close errors.
See also
GloveDevice.health()
Read the health summary for the current scope.
Type
GloveDevice.health() -> HealthReturns
Details
- Call conditions: While the device is open.
Errors
ClosedHandleError.
GloveDevice.skeleton()
Enables and accesses Skeleton data.
Type
GloveDevice.skeleton() -> SkeletonReturns
Details
- Call conditions: Must be called before start.
- Call before
start(). See the returned Skeleton object.
Errors
LifecycleError, capability unavailable.
Example
device is selected but not started. on_skeleton is an application callback for skeleton data. Enable Skeleton before starting the device.
skeleton = device.skeleton()
subscription = skeleton.pose().subscribe(on_skeleton)
glove.start()
glove.run_forever()Complete example: skeleton.py.
GloveDevice.output()
Reads the dexterous hand output of the specified target.
Type
GloveDevice.output(name: str | None = None) -> ReadChannel[HandJointCommand]Parameters
name: str | None = None; when omitted, the target must be unique
Returns
ReadChannel[HandJointCommand]. See HandJointCommand. See ReadChannel[T].
Details
- Call conditions: After the SDK is created.
Errors
- Target not found or ambiguous.
Example
The device has targets named primary and backup; both callbacks are provided by the application. Subscribe before starting. The complete example includes target configuration and runtime setup.
primary = device.output(name="primary")
backup = device.output(name="backup")
first_subscription = primary.subscribe(on_primary)
second_subscription = backup.subscribe(on_backup)Complete example: multiple_outputs.py.
See also
GloveDevice.haptics()
Obtains the fingertip vibration control entry point.
Type
GloveDevice.haptics() -> StateChannel[GloveHaptics]Returns
StateChannel[GloveHaptics]. See Haptics. See StateChannel[T].
Details
- Call conditions: After a serial device is selected.
Errors
- Not supported or rejected for external or disconnected devices. Composite Glove haptic requests are ignored; see the composite guide.
GloveDevice.push_frame()
Submits one frame of hand data to the external input source.
Type
GloveDevice.push_frame(frame: ExternalGloveFrame) -> GlovePoseParameters
frame: ExternalGloveFrame, required
Returns
Details
- Call conditions: The external device has been started.
Errors
- Parameter, timestamp or lifecycle errors.
Example
device uses ExternalConnection. frames is a sequence of application-provided ExternalGloveFrame values with strictly increasing timestamps. Continue feeding frames during calibration; the complete example handles interaction and timeouts.
import time
device.start()
glove.run_background()
try:
for frame in frames:
pose = device.push_frame(frame)
print(pose.meta.timestamp)
time.sleep(0.01)
finally:
glove.request_stop()
glove.join()
glove.close()Complete example: external_input_run_background.py.
GloveDevice.create_capture_quality_session()
Creates an independent capture quality session for this verified device.
Type
GloveDevice.create_capture_quality_session() -> CaptureQualitySessionReturns
CaptureQualitySession. The SDK selects the detector from the verified device identity and hand side.
Details
- Runs independently of
CaptureSessionand only evaluates supplied hand-pose windows. - For playback, external input, or explicit model overrides, use the standalone factory
create_capture_quality_session().
Errors
UnavailableFeatureError(unsupported platform, missing detector runtime, or unverified device identity),ClosedHandleError.
GloveDevice.capture_status()
Checks whether manual capture can start.
Type
GloveDevice.capture_status(package_ids: Sequence[str], operator_id: str) -> CaptureReadinessParameters
package_ids: required sequence of algorithm package IDs; each ID must be non-empty. The sequence may be empty to use the configured built-in Skeleton for eight-gesture capture; otherwise, every ID must be a non-empty string referring to a package used in the current SDK configuration.operator_id: required, a non-empty wearer identifier used to find reusable captures.
Returns
Details
- Call conditions: The device has started and the included binding or selected packages are available. This query does not create a Capture Session.
Errors
InvalidArgumentError,WorkflowError.
Example
package_ids is empty for the included Skeleton, or contains the selected algorithm-package IDs configured in this SDK; operator_id identifies the wearer. Both values come from the application.
readiness = device.capture_status(
package_ids=package_ids,
operator_id=operator_id,
)
for stage in readiness.stages:
print(stage.stage_id, stage.state)Related complete Capture workflow: host_capture_calibration.py.
See also
GloveDevice.start_capture()
Starts manual capture.
Type
GloveDevice.start_capture(
package_ids: Sequence[str],
operator_id: str,
force: bool = False
) -> CaptureSessionParameters
package_ids: required sequence of algorithm package IDs; each ID must be non-empty. The sequence may be empty to use the configured built-in Skeleton for eight-gesture capture; otherwise, every ID must be a non-empty string referring to a package used in the current SDK configuration.operator_id: required, a non-empty wearer identifier used to find reusable captures.force: defaults toFalse, reusing available captures.Truere-completes the current plan.
Returns
Details
- Call conditions: After the device starts in
CalibrationMode.MANUAL. - See Capture for the workflow.
Errors
InvalidArgumentError,WorkflowError, lifecycle errors.
When recapture is not forced and capture requirements and samples are unchanged, complete capture reuse preserves existing compatible calibration.
Example
Start the device in MANUAL mode and provide package_ids (empty for the included Skeleton) and the actual operator_id. Continue SDK scheduling and respond to snapshot prompts after creating the session; wait for Capture to complete before Calibration.
session = device.start_capture(
package_ids=package_ids,
operator_id=operator_id,
force=False,
)
snapshot = session.snapshot()
print(snapshot.state, snapshot.next_action)Related complete Capture workflow: host_capture_calibration.py.
See also
GloveDevice.capture_progress()
Reads the current Capture progress.
Type
GloveDevice.capture_progress() -> ReadChannel[CaptureProgress]Returns
ReadChannel[CaptureProgress]. See CaptureProgress. See ReadChannel[T].
Details
- Call conditions: External interaction flow.
Errors
- Lifecycle or close errors.
Example
Use a selected device and preferably register this subscription before starting. Read prompts and counts from the current sample rather than reusing old request tokens.
def on_capture(sample):
stage = sample.value.stage
print(stage.prompt, stage.collected_sample_count,
stage.required_sample_count)
subscription = device.capture_progress().subscribe(on_capture)Complete example: external_input_run_background.py.
See also
GloveDevice.capture_control()
Get the capture interaction control object.
Type
GloveDevice.capture_control() -> CaptureControlReturns
Details
- Call conditions: External interaction flow.
Errors
- Lifecycle or control request errors.
Example
Capture interaction is configured as external, and the user has approved the current request. Submit only the latest awaiting-confirmation token and avoid submitting the same request twice.
control = device.capture_control()
from qnbot_sdk.glove import CaptureStageState
sample = device.capture_progress().latest()
if sample is not None:
stage = sample.value.stage
if (stage.state is CaptureStageState.AWAITING_CONFIRMATION
and stage.request_id is not None):
control.confirm(stage.request_id)Complete example: external_input_run_background.py.
See also
GloveDevice.calibration_status()
Views the calibration status of the specified target.
Type
GloveDevice.calibration_status(name: str | TargetName | None = None) -> CalibrationReadinessParameters
name: str | TargetName | None = None; when omitted, the target must be unique
Returns
Details
- Call conditions: After the SDK is created.
Errors
- Target not found or ambiguous.
See also
GloveDevice.start_calibration()
Starts calibration using a completed capture.
Type
GloveDevice.start_calibration(
completed_capture_session: CaptureSession,
targets: Sequence[str | TargetName | None]
) -> CalibrationSessionParameters
completed_capture_session: required; must belong to the sameSdk, be completed, and remain open.targets: required, non-empty, with no duplicates.- A name selects a configured target;
Noneselects the unique unnamed target; useTargetName.SKELETONfor Skeleton.
Returns
Details
- Call conditions: Capture completed and the Session remains open.
- The SDK owner, capture completion, and target selections are validated. See Calibration.
Errors
- Session or target validation errors.
Example
capture_session belongs to the same SDK and remains open after completion. targets contains the configured targets selected by the application. Continue scheduling until Calibration finishes, then close its session.
from qnbot_sdk.glove import CaptureSessionState
snapshot = capture_session.snapshot()
if snapshot.state is CaptureSessionState.COMPLETED:
calibration = device.start_calibration(
completed_capture_session=capture_session,
targets=targets,
)Related complete Capture workflow: host_capture_calibration.py.
See also
GloveDevice.calibration_progress()
Reads the Calibration progress of the specified target.
Type
GloveDevice.calibration_progress(
name: str | TargetName | None = None
) -> ReadChannel[CalibrationProgress]Parameters
name: str | TargetName | None = None; when omitted, the target must be unique
Returns
ReadChannel[CalibrationProgress]. See CalibrationProgress. See ReadChannel[T].
Details
- Call conditions: During calibration observation.
Errors
- Target not found or ambiguous.
Example
target_name is the name of a configured target. Register the subscription before starting to observe that target’s calibration state.
def on_calibration(sample):
job = sample.value.job
print(job.target_id, job.state)
subscription = device.calibration_progress(name=target_name).subscribe(
on_calibration
)Complete example: external_input_run_background.py.
See also