SenseGlove VRExpansion Plugin Integration Demo
A sample project demonstrating how to integrate the SenseGlove Unreal Engine Plugin into third-party OpenXR plugins such as the VRExpansionPlugin.
Compatibility
This demo is compatible with UE 5.4.
IMPORTANT NOTE: This repository contains multiple branches, each configured for specific combinations of HMDs, wrist-tracking hardware, and plugins. Not all configurations are supported in this demo. Below is a breakdown of the available branches and their configurations:
pcvr-quest:- PCVR Mode
- Quest 3 Controller
- Epic OpenXR Plugin
pcvr-vive:- PCVR Mode
- VIVE Focus 3 Wrist Tracker
- Epic OpenXR and OpenXRViveTracker Plugins
standalone-quest:- Standalone Mode (Android)
- Quest 3 Controller
- Epic OpenXR Plugin
standalone-vive:- Standalone Mode (Android)
- VIVE Focus 3 Wrist Tracker
- HTC ViveOpenXR Plugin
To adjust the wrist-tracking settings for your specific hardware, please refer to the official documentation.
If the project crashes when deployed
Quest: N/A Vive:
General Android: Make sure that bluetooth and location permissions have been given to the application If it still crashes, you can comment out line 112 in the SGBackend.cpp
How to change offsets
if you are using a device we support out of the box, you can change the offsets in BP_VRCharacter -> Controller profile and type in(or copy) the following text depending on your hardware:
"SG_HandTracking_Quest" for quest devices, both with Meta Quest Link and native on the quest "SG_ViveWristTrackers" for using the vive wrist trackers on both desktop and native using the vive wrist trackers
Changing tracking source
In BP_VRCharacter you can change hte tracking source for each hand, this is required based on the tracker you are using
Callibration
in sensegloves/maps there is a callibration scene. there is also a "BP_callibrator" in the scene. Change the target map to the one you are using
Adding more gestures
In the GraspingHandManny blueprint I have madce a simple function called "Save Hand Pose". If you press space bar while the game is running, it will save whatever pose the appropriate hand is placed at, and it is saved in a gestures data base, the one we are using can be found under Content/Senseglove with the name of "NewHnadPose", you should change the hand pose name to something else when you want to use it. It is helpful to add an event dispatcher to the blueprint "GraspingHandManny" which gets called, in the event graph, from the "On New Gesture Detected" event from the OpenXRHandPose component. This is index based, rather than name based so keep that in mind when adding more dispatchers. by default we have examples for teleport, Grab, release and Use.
VR Expansion changes
In VRExpansion plugin the following things have been changed:
Blueprint Changes
BP_VRCharacter
4 functions added: SendVibration, SendFFB, SendSqueeze, ResetHaptics. These functions get the glove instance and then send the appropriate command to the glove.
in OnPossesed added "load controller by Name" and the string variable "trackingOffset" to load the correct offsets for the tracking
GraspingHandManny
in the function "Setup finger animations" you want to replace the bit where it checks handtype with Left, you want to check the enum as string and check if it contains "left" instead. This is to accomedate for different tracking sources like "left foot"
C++ changes
Hand socket component:
You want to add the following lines as a public variable in the header file:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hand Animation")
float HandAnimationProgress = 0.0f;
in function "get blended pose snapshot" add change the line that says "double TrackLocation = 0.0f;" to " double TrackLocation = HandTargetAnimation->GetPlayLength() * HandAnimationProgress;"
In Motion Controller component:
change "if (HandType == EControllerHand::Left || HandType == EControllerHand::AnyHand || !VRSettings->bUseSeperateHandTransforms)" to "if (UEnum::GetDisplayValueAsText(HandType).ToString().Contains("Left")/HandType == EControllerHand::Left/ || HandType == EControllerHand::AnyHand || !VRSettings->bUseSeperateHandTransforms)"
and
change "else if (HandType == EControllerHand::Right)" to "else if (UEnum::GetDisplayValueAsText(HandType).ToString().Contains("Right"))//HandType == EControllerHand::Right)"
in Grip motion controller component
Change line 8346 to 8354 in the function "GetHandType(EControllerHand& Hand)" from
if (MotionSource.Compare(FName(TEXT("RightPalm"))) == 0 || MotionSource.Compare(FName(TEXT("RightWrist"))) == 0)
{
Hand = EControllerHand::Right;
}
// Could skip this and default to left now but would rather check
else if (MotionSource.Compare(FName(TEXT("LeftPalm"))) == 0 || MotionSource.Compare(FName(TEXT("LeftWrist"))) == 0)
{
Hand = EControllerHand::Left;
}
to
if (MotionSource.Compare(FName(TEXT("RightPalm"))) == 0 || MotionSource.Compare(FName(TEXT("RightWrist"))) == 0 || MotionSource.ToString().Contains("Right"))
{
Hand = EControllerHand::Right;
}
// Could skip this and default to left now but would rather check
else if (MotionSource.Compare(FName(TEXT("LeftPalm"))) == 0 || MotionSource.Compare(FName(TEXT("LeftWrist"))) == 0 || MotionSource.ToString().Contains("Left"))
{
Hand = EControllerHand::Left;
}
License
Checkout the LICENSE.md file for the usage license of this project, the SenseGlove Unreal Engine Plugin or any third-party plugins that are shipped through this repository.