API referenceVetraGlove ProC++

Glove device interfaces

Core interfaces

Current version · 2.0.0

Returned by glove.device(), this object represents one configured glove. Members below cover identity, lifecycle, data and controls, capture, and calibration.

GloveDevice::source_id()

Read the runtime source identifier.

Type

std::string GloveDevice::source_id() const;

Returns

std::string.

Details

  • Call conditions: SDK not closed.

Errors

  • ClosedHandleError.

GloveDevice::get_device_info()

Read the verified device information snapshot.

Type

GloveDeviceInfo GloveDevice::get_device_info() const;

Details

  • Call conditions: After SDK creation, may be before start.

Errors

  • UnavailableFeatureError (identity not verified).

GloveDevice::start()

Start devices and capabilities in this object’s scope.

Type

void GloveDevice::start() const;
void GloveDevice::start(CalibrationMode mode) const;

Parameters

  • mode: CalibrationMode, default inherited domain default. Omission inherits the Glove-domain default.
  • The explicit overload accepts CalibrationMode::automatic, manual, or none.

Returns

void.

Details

  • Call conditions: When the 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.

device.start(qnbot::CalibrationMode::manual);

Related complete Capture workflow: host_capture_calibration.cpp.

GloveDevice::stop()

Stop the current scope and disconnect its devices.

Type

void GloveDevice::stop() const;

Returns

void.

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::pose()

Get a read channel for raw glove poses.

Type

ReadChannel<GlovePose> GloveDevice::pose() const;

Returns

ReadChannel<GlovePose>. See GlovePose. See ReadChannel<T>.

Details

  • Call conditions: After SDK creation.

Errors

  • Lifecycle, close, or unsupported errors.

GloveDevice::imu()

Get a read channel for raw IMU data.

Type

ReadChannel<GloveImu> GloveDevice::imu() const;

Returns

ReadChannel<GloveImu>. See GloveImu. See ReadChannel<T>.

Details

  • Call conditions: After SDK creation.

Errors

  • Lifecycle, close, or unsupported errors.

GloveDevice::emf()

Type

ReadChannel<GloveEmf> GloveDevice::emf() const;

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

Value GloveDevice::export_calibration(
    const std::string& destination,
    std::optional<std::string> target = std::nullopt) const;

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

ReadChannel<GlovePressure> GloveDevice::pressure() const;

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

ReadChannel<GloveStatus> GloveDevice::status() const;

Returns

ReadChannel<GloveStatus>. See GloveStatus. See ReadChannel<T>.

Details

  • Call conditions: After SDK creation.

Errors

  • Lifecycle, close, or unsupported errors.

GloveDevice::skeleton()

Enable and access Skeleton data.

Type

Skeleton GloveDevice::skeleton() const;

Returns

Skeleton.

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.

auto skeleton = device.skeleton();
auto subscription = skeleton.pose().subscribe(on_skeleton);
glove.start();
glove.run_forever();

Complete example: skeleton.cpp.

GloveDevice::output()

Read the dexterous hand output of the specified target.

Type

ReadChannel<HandJointCommand> GloveDevice::output() const;
ReadChannel<HandJointCommand> GloveDevice::output(const std::string& name) const;

Parameters

  • None or const std::string&

Returns

ReadChannel<HandJointCommand>. See HandJointCommand. See ReadChannel<T>.

Details

  • Call conditions: After SDK creation.

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.

auto primary = device.output("primary");
auto backup = device.output("backup");
auto first_subscription = primary.subscribe(on_primary);
auto second_subscription = backup.subscribe(on_backup);

Complete example: multiple_outputs.cpp.

GloveDevice::haptics()

Obtain the fingertip haptics control entry point.

Type

StateChannel<GloveHaptics> GloveDevice::haptics() const;

Returns

StateChannel<GloveHaptics>. See Haptics. See StateChannel<T>.

Details

  • Call conditions: After a serial device is selected.

Errors

  • Unsupported or rejected for external or disconnected devices. Composite Glove haptic requests are ignored; see the composite guide.

GloveDevice::push_frame()

Submit one frame of data to an external source.

Type

GlovePose GloveDevice::push_frame(const ExternalGloveFrame& frame) const;

Parameters

  • const ExternalGloveFrame&, required

Returns

GlovePose.

Details

  • Call conditions: External device already 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.

device.start();
glove.run_background();
for (const auto& frame : frames) {
    const auto pose = device.push_frame(frame);
    std::cout << pose.meta.timestamp << '\n';
    std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
glove.request_stop();
glove.join();
glove.close();

Complete example: external_input_run_background.cpp.

GloveDevice::create_capture_quality_session()

Creates an independent capture quality session for this verified device.

Type

CaptureQualitySession GloveDevice::create_capture_quality_session() const;

Returns

CaptureQualitySession. The SDK selects the detector from the verified device identity and hand side.

Details

  • Runs independently of CaptureSession and 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()

Check whether manual capture on this device can start.

Type

CaptureReadiness GloveDevice::capture_status(
    const std::vector<std::string>& package_ids,
    const std::string& operator_id
) const;

Parameters

  • 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.

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.

const auto readiness = device.capture_status(package_ids, operator_id);
for (const auto& stage : readiness.stages) {
    std::cout << stage.stage_id << '\n';
}

Related complete Capture workflow: host_capture_calibration.cpp.

See also

GloveDevice::start_capture()

Start manual capture on this device.

Type

CaptureSession GloveDevice::start_capture(
    const std::vector<std::string>& package_ids,
    const std::string& operator_id,
    bool force = false
) const;

Parameters

  • 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 to false, reusing available captures. true re-completes the current plan.

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.

auto session = device.start_capture(package_ids, operator_id, false);
const auto snapshot = session.snapshot();
std::cout << snapshot.next_action << '\n';

Related complete Capture workflow: host_capture_calibration.cpp.

See also

GloveDevice::capture_progress()

Read progress or control Capture.

Type

ReadChannel<CaptureProgress> GloveDevice::capture_progress() const;

Returns

ReadChannel<CaptureProgress>. See CaptureProgress. See ReadChannel<T>.

Details

  • Call conditions: External interaction flow.

Errors

  • Lifecycle or control request 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.

auto subscription = device.capture_progress().subscribe(
    [](const qnbot::Sample<qnbot::CaptureProgress>& sample) {
        const auto& stage = sample.value.stage;
        std::cout << stage.prompt << " " << stage.collected_sample_count
                  << "/" << stage.required_sample_count << '\n';
    });

Complete example: external_input_run_background.cpp.

See also

GloveDevice::capture_control()

Get the capture interaction control object.

Type

CaptureControl GloveDevice::capture_control() const;

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.

auto control = device.capture_control();
const auto sample = device.capture_progress().latest();
if (sample) {
    const auto& stage = sample->value.stage;
    if (stage.state == qnbot::CaptureStageState::awaiting_confirmation
            && stage.request_id) {
        control.confirm(*stage.request_id);
    }
}

Complete example: external_input_run_background.cpp.

See also

GloveDevice::calibration_status()

View the calibration status of the specified target.

Type

CalibrationReadiness GloveDevice::calibration_status() const;
CalibrationReadiness GloveDevice::calibration_status(const std::string& name) const;
CalibrationReadiness GloveDevice::calibration_status(TargetName name) const;

Parameters

  • None, name, or TargetName

Details

  • Call conditions: After SDK creation.

Errors

  • Target not found or ambiguous.

See also

GloveDevice::start_calibration()

Start calibration using a completed capture on this device.

Type

CalibrationSession GloveDevice::start_calibration(
    const CaptureSession& completed_capture_session,
    const std::vector<std::optional<std::string>>& targets
) const;

Parameters

  • completed_capture_session: required; must belong to the same Sdk, be completed, and remain open.
  • targets: required, non-empty, with no duplicates.
  • A name selects a configured target; std::nullopt selects the unique unnamed target; use "skeleton" for Skeleton.

Details

  • Call conditions: Capture completed and the Session is still 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.

const auto snapshot = capture_session.snapshot();
if (snapshot.state != qnbot::CaptureSessionState::completed) {
    throw std::logic_error("Capture must complete before Calibration");
}
auto calibration = device.start_calibration(capture_session, targets);

Related complete Capture workflow: host_capture_calibration.cpp.

See also

GloveDevice::calibration_progress()

Read the calibration progress of the specified target.

Type

ReadChannel<CalibrationProgress> GloveDevice::calibration_progress() const;
ReadChannel<CalibrationProgress> GloveDevice::calibration_progress(
    const std::string& name
) const;
ReadChannel<CalibrationProgress> GloveDevice::calibration_progress(TargetName name) const;

Parameters

  • None, name, or TargetName

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.

auto subscription = device.calibration_progress(target_name).subscribe(
    [](const qnbot::Sample<qnbot::CalibrationProgress>& sample) {
        std::cout << sample.value.job.target_id << '\n';
    });

Complete example: external_input_run_background.cpp.

See also