C++/Python SDK_Angle Manual
1. Introduction
1.1. Feature
This SDK provides access to hand joint angle data and supports different operating system environments, currently including Windows and Linux.
1.2. File Download
(Download the Angle file which is open sourced)
Windows:
Linux (ARM is supported): You can refer to the example or compile and run it yourself
1.3. HandDriver Settings
Check "Data Transmission" to turn on the data transmission.
To transmit IMU data (only supported by gloves with IMU), select the IMU option; otherwise, IMU data will not be transmitted.
The data format options—Euler, Quater, and VMC—are mutually exclusive (Select Euler for current SDK).
Select the FPS, which supports 120Hz, 90Hz, or 60Hz. The default FPS is 120Hz.
Click the "+" icon in the target address field, then enter the IP address and port number of the receiving side to enable data transmission (input 127.0.0.1 for local target).
For the SDK side, use the IP address format 0.0.0.0.
The default port number is 5555. Unless otherwise specified, use this default port. Otherwise, modify the corresponding port number in the plugin.
After configuration, click the "Apply" button to save.

2. Coordinate system and data definition
2.1. Coordinate System and Data Description
2.1.1. HandDriver2.1.2 version after 2.1.2.
Please refer to this document:Hand Model and Data Description
2.1.2. HandDriver2.1.1 version before 2.1.1
The data sent refers to the right-hand coordinate system standard, as shown in the figure below.

2.2. Data Format
The sending data is shown in the figure below and includes information such as the character name, calibration status, finger joint rotation angles, IMU quaternion data (only available when the glove is equipped with an IMU and IMU transmission is enabled) and controllers data.

2.3. The Receiving Angle
Regarding the receiving angle value, please refer to the HandDriver data page. The data on this page is consistent with the SDK receiving data.
Consistent positive and negative
Specific values are expressed as integers when displayed in HandDriver
For detailed instructions, please see here: UDEXREAL HandDriver Hand Model and Data Description

3. C++ Windows SDK
3.1. Data Structure Definition
3.1.1. Character List
Data Structure Description: Save received character data.
Parameter Description: GloverData contains information for a single character.
3.1.2. Glove Data
Data Structure Description: Save the character's name and hand data.
Parameter Description: handDatas contains the hand data for a single character.
3.1.3. Hand Data
Data Structure Description: Save the character's skeletal data and finger joint data.
Parameter Description: bones contain the glove skeletal data, while fingerJoints contain the glove finger joint data.
3.1.4. Bone Data
Data Structure Description: Save skeletal data.
Parameter Description: Used for adapting data formats for Unreal Engine; the information is currently not in use.
3.1.5. Finger Joint Data
Data Structure Description: Save the finger joint data for both hands of the character, including the hand calibration status.
Parameter Description: fingerJoint_L contains the data for the character's left hand, while fingerJoint_R contains the data for the character's right hand.
3.2. Data Calling
3.2.1. Retrieve glove data
3.2.1.1. Retrieve glove driver info
Example for retrieving device information. You can obtain other device information in a similar manner.
3.2.1.2. Retrieve Finger Joint Rotation Data from the Glove
In the GloveSDK class, there is an array gloveDataList of type GloveData, which stores data for all gloves. Access it using the index, for example: glovePtr->gloveDataList[0].handDatas.fingerJoints.fingerJoint_L[6].value (Accessed the pitch data of the second phalanx of the left hand index finger for device 0, where fingerJoint_L[6] corresponds to the image in The corresponding parameters are viewed in the data format.)。
3.3. Definition of Interface
3.3.1. Initialization
Function description: Create a Socket according to the parameters. If successful, start a thread to receive data.
Parameter description: udp_ip is the IP address for receiving data, udp_port is the port number, which can be the same as the sending HandDriver.
Return value description: Returns true if successful, false if failed.
3.3.2. Close thread
Function description: Used to close the receiving thread and clean up the Socket.
Parameter description: None.
Return value description: None.
3.3.3. Registering callback function
Function description: Used to print all data for a character to check the data status.
Parameter Description: inputGloveData is a function of type GloveData, which takes a GloveData object as input when called.
Return value description: None.
3.4. Windows Demo and Description
3.4.1. Demo project description
The HandDriver_x64_Cpp_Angleproject contains the HandDriver_x64_Cpp_Anglefolder and the HandDriver_x64_Cpp_Angle.sln file. The HandDriver_x64_Cpp_Anglefolder includes the library files, which can be copied for standalone use. The version of Visual Studio is VS2019(When using higher versions, follow the log changes), using C++14. To run the example program, open HandDriver_x64_Cpp_Angle.sln and select the x64 platform.

3.4.2. Brief introduction to code flow
Declare a function to register the callback
Create an instance of GloveSDK
Register callback function
Create a socket and check if it is successful. If successful, start receiving and parsing data
Start the print thread and print the glove_sdk data
Calling the function to print only the frame number
Waiting for input save program
Close and clean up the socket
4. C++ Linux SDK
4.1. File Directory
The Linux Cpp SDK folder contains: the folder "include" (which contains the header files required for JSON parsing), the folder "lib" (which contains the necessary JSON dynamic libraries such as libjsoncpp.so and libjsoncpp.so.27), UDEServer.h (the SDK header file), UDEServer.cxx (the implementation of methods), main.cxx (an example), build.sh (an example build file), CMakeLists.txt, and ReadMe.txt.

4.2. Data Format
Please click here for the format.
4.3. Data Calling
Include the header file UDEServer.h first and complete the initialization of the server.The method for obtaining the received list of character names is as follows:
The default port number of the server is 5555. You can obtain the current port number or set the port through below method:
Close data reception or obtain current status in server listening.
According to the specified character name, all knuckle data can be obtained with the type of vector. The names of the finger joints and the array of Euler angles can be obtained corresponding to the index order in GloveDataHeaders. The controller data can also be obtained. An array of the type float can be obtained according to the index order in ControllerHeaders, which corresponds to the controller parameters.
The corresponding entries obtained are as follows:
The rules for knuckle names are Left/Right + Thumb/Index/Middle/Ring/Pinky + 1/2/3 (joint 1/joint 2/joint 3). The order of the angle array is {pitch, yaw, roll}.
Joy X and Joy Y in the controller data correspond to joystick parameters, ranging from (-1,1) as floating numbers. All other button parameters are also set to floating numbers 0 or 1 for consistency, corresponding to untriggered or triggered.
4.4. Definition of Interface
Initialization
Function description: Socket initialization, including the required declaration and calling to create a server.
Return value description: If successful, return 0; if failed, return -1.
Set Port Number
Function description: Set the server listener port number.
Parameter description: The port number is integer type.
Get Port Number
Function description: Get the server listener port number.
Return value description: The port number is integer type.
Start server listener
Function Description: The start server listener method can obtain parameters in the loop.
Shut down server listener
Function description: Close the server listener.
Get server status
Function description: Get the current server status.
Return value description: ServerStatus enumeration parameter, 0 means NO_INIT (not initialized), 1 means READY, 2 means IN_LISTENING (listening), 3 means END (listening terminated).
Get a list of character names
Function description: Get a string list of all received character names.
Return value description: name string array.
Get knuckle data
Function description: Get the knuckle data of the specified character.
Parameter description: Character name in String type.
Return value description: Euler angle array sorted in the same order as the character index in GloveDataHeaders.
Get controller data
Function description: Get controller data for the specified character.
Parameter description: Character name in String type.
Return value description: A float array sorted in the same order as the character index in ControlHeaders.
4.5. Example
The main.cxx provides an example of calling the SDK interface within the main method to receive and print data. An executable file can be generated by running build.sh.
Start the "Terminal", enter the root folder of the SDK, run the following command:
This can generate an executable example ServerSample, which can be run in the same directory using the following command:
And then the link library libUDEServer.so of the project can be found in the folder "build".
5. Python Linux SDK
5.1. Data Format
Please click here for the format.
5.2. Data Calling
The method for obtaining the received list of character names is as follows:
The default port number of the server is 5555. You can obtain the current port number or set the port through below method:
Close data reception or obtain current status in server listening.
According to the specified character name, all knuckle data can be obtained with the type of vector. The names of the finger joints and the array of Euler angles can be obtained corresponding to the index order in GloveDataHeaders. The controller data can also be obtained. An array of the type float can be obtained according to the index order in ControllerHeaders, which corresponds to the controller parameters.
The corresponding entry examples obtained are as follows:
The rules for knuckle names are Left/Right + Thumb/Index/Middle/Ring/Pinky + 1/2/3 (joint 1/joint 2/joint 3). The order of the angle array is {pitch, yaw, roll}.
Joy X and Joy Y in the controller data correspond to joystick parameters, ranging from (-1,1) as floating numbers. All other button parameters are also set to floating numbers 0 or 1 for consistency, corresponding to untriggered or triggered.
5.3. Definition of Interface
Initialization
Function description: Socket initialization, including the required declaration and calling to create a server.
Return value description: If successful, return 0; if failed, return -1.
Set Port Number
Function description: Set the port number of server listener.
Parameter description: The port number is integer type.
Get Port Number
Function description: Get the port number of server listener.
Return value description: The port number is integer type.
Start service listener
Function description: start service listener.
Shut down server listener
Function description: Close the server listener.
Get server status
Function description: Get the current server status.
Return value description: ServerStatus enumeration parameter, 0 means NO_INIT (not initialized), 1 means READY, 2 means IN_LISTENING (listening), 3 means END (listening terminated).
Get a list of character names
Function description: Get a string list of all received character names.
Return value description: name string array.
Get knuckle data
Function description: Get the knuckle data of the specified character.
Parameter description: Character name in String type.
Return value description: Euler angle array sorted in the same order as the character index in GloveDataHeaders.
Get controller data
Function description: Get the controller data of the specified character.
Parameter description: Character name in String type.
Return value description: A float array sorted in the same order as the character index in ControlHeaders.
5.4. Example
Start "Terminal" in the directory where the .py file is located and run the following command:
Last updated