Haptics control
Core interfaces
Current version · 1.4.0
ExoHaptics
Configure haptic strength for the left and right sides.
Type
struct ExoHaptics {
std::optional<std::uint8_t> left;
std::optional<std::uint8_t> right;
};Details
Non-null intensities must be in the range 0…100. HapticsState inherits the read and subscription interface from ReadChannel<ExoHaptics> and adds set(const ExoHaptics&) and clear().
HapticsState::set()
Set left and right haptics; an empty value leaves that side out of this update.
Type
void HapticsState::set(const ExoHaptics& value) const;Parameters
value: left and right strength settings; each supplied strength is in 0…100.
Returns
void.
Example
device is a started exoskeleton device with haptics support. The complete example checks the capability before setting, holding, and clearing the output.
auto haptics = device.haptics();
qnbot::ExoHaptics value;
value.left = 30;
value.right = 20;
haptics.set(value);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
haptics.clear();Complete example: haptics.cpp.
See also
HapticsState::clear()
Clear haptic output.
Type
void HapticsState::clear() const;Returns
void.
See also