This repository contains code for compiling a small c++
application to run as an interface layer between Force Dimension's sigma.7
robot and the web standard WebHID
interface. By running this application on a device connected by USB with sigma.7
, you can receive 3-axis position and force information from the robot in a standard web browser interface using javascript.
- Windows
- MSYS2 with
gcc
,ninja
(ormake
), andcmake
- Force Dimension SDK (e.g., version 3.17.1)
- ViGEmBus and ViGEmClient libraries
-
Download and install MSYS2 from the official website: MSYS2.
-
Open MSYS2 MinGW 64-bit terminal.
-
Run the following commands to install the necessary tools and libraries:
pacman -Syu # Update the package database and core system pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake git
This installs GCC, CMake, and other necessary development tools.
-
Download and install the ViGEmBus driver from: ViGEmBus Releases.
-
Download the ViGEmClient SDK from: ViGEmClient Releases.
-
After extracting the ViGEmClient SDK, copy the
include
andlib
directories to a path such asC:/MyRepos/CPP/ViGEmClient/
.
- Download and install the Force Dimension SDK (e.g., version 3.17.1) from: Force Dimension.
- After installation, locate the SDK's
include
andlib
directories, typically located inC:/Program Files/Force Dimension/sdk-3.17.1/
.
Clone this repository and navigate to the project directory:
git clone https://github.com/Neuro-Mechatronics-Interfaces/HapticHID.git HapticHID && cd HapticHID
-
Ensure that the paths in CMakeLists.txt are correctly set for your environment, especially for the ViGEmClient and Force Dimension SDK directories.
-
Create a build directory and run
cmake
to configure the project. Usemake
orninja
depending on yourcmake
configuration:
mkdir build && cd build && cmake .. && make
mkdir build && cd build && cmake .. && ninja
- Copy the
ViGEmClient.dll
anddrd64.dll
link libraries fromlib
intobuild
:
cp ../lib/drd64.dll drd64.dll && cp ../lib/ViGEmClient.dll ViGEmClient.dll
This will generate the DummyHapticHID.exe and HapticHID.exe executables in the build directory.
Both executables require ViGEmClient.dll and drd64.dll at runtime. Copy these .dll files into the build directory where the executables are located:
ViGEmClient.dll
from the ViGEmClient SDK.drd64.dll
from the Force Dimension SDK.
Run from a bash
terminal (e.g. git bash
or msys2
; not Powershell or Windows Terminal). The terminal should navigate to the build
folder in your local repository and call the executable from there.
To run DummyHapticHID
, which simulates a virtual XBOX 360 controller (and is therefore useful for testing WebHID when no sigma.7
is available) execute the following command from a terminal:
./DummyHapticHID.exe
To run HapticHID, ensure that your Force Dimension haptic device is connected, and execute the following command:
./HapticHID.exe
This program connects to the haptic device, retrieves force and position data, and maps that data to a virtual Xbox 360 controller.
- Ctrl + C: Stops the program and exits.
There is a generic HID test interface available at https://reaction-task.nml.wtf/debug/hid
.