SDKC++ SDK

Haptics

Set and clear fingertip haptic feedback.

Current version · 2.0.0

Haptics

Setting and clearing vibration

Wired and Receiver wireless gloves use the same haptics APIs, with integer strengths from 0..127. See Device discovery and connection for wireless setup.

Set or clear the haptic strength of each finger through device.haptics():

auto haptics = device.haptics();
haptics.set(qnbot::Haptics{{
    {qnbot::GloveFinger::thumb, 80},
    {qnbot::GloveFinger::index, 40},
}});

if (const auto latest = haptics.latest()) {
    std::cout << latest->sequence << '\n';
}

haptics.clear();

Reading the current setting

latest() reflects the haptic setting currently saved by the SDK, not a hardware execution acknowledgement:

Eventlatest() resultNotes
set() succeedsThe new vibration setting—
set() or clear() failsUnchangedA failure publishes no new state
clear() succeedsstd::nulloptNo additional callback sample is produced
stop(), e-stop, or connection lossstd::nulloptThe SDK updates the state to empty
After reconnectingStill std::nulloptNot replayed automatically; call set() again if needed

An empty state only means that the SDK currently has no haptic setting; it does not guarantee that a disconnected device has received zero output.

Constraints and reference

For the input and return fields, see Haptics.

The strength range is 0..127. An external connection does not support haptics; writes are rejected. Applications should clear haptic settings that are no longer needed before stopping or closing.

Existing integer strengths in 0..100 remain valid without conversion. Composite Glove haptic requests are ignored; see the composite guide for supported capabilities.