Haptics
Set and clear fingertip haptic feedback.
Current version · 1.4.0
Haptics
Read first: Device discovery & connection
Setting and clearing vibration
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:
| Event | latest() result | Notes |
|---|---|---|
set() succeeds | The new vibration setting | — |
set() or clear() fails | Unchanged | A failure publishes no new state |
clear() succeeds | std::nullopt | No additional callback sample is produced |
stop(), e-stop, or connection loss | std::nullopt | The SDK updates the state to empty |
| After reconnecting | Still std::nullopt | Not 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..100. An external connection does not support haptics; writes are
rejected. Applications should clear haptic settings that are no longer needed before stopping or
closing.