add more documentation

This commit is contained in:
Mamadou Babaei
2022-11-17 17:01:35 +01:00
parent b655d80f15
commit 8ef9c21926
15 changed files with 477 additions and 25 deletions
@@ -67,7 +67,7 @@ public:
public:
/**
* Basic class Constructor.
* The basic class constructor.
*/
static USGBasicHandModel* NewBasicHandModel(UObject* Outer);
@@ -163,7 +163,7 @@ private:
public:
/**
* Basic class Constructor.
* The basic class constructor.
*/
USGBasicHandModel();
@@ -62,7 +62,7 @@ public:
public:
/**
* Basic Class Constructor.
* The basic class constructor.
*/
static USGBetaDevice* NewBetaDevice(UObject* Outer);
@@ -93,7 +93,7 @@ private:
public:
/**
* Basic Class Constructor.
* The basic class constructor.
*/
USGBetaDevice();
@@ -62,7 +62,7 @@ public:
public:
/**
* Basic Constructor.
* The basic constructor.
*/
static USGBuzzCommand* NewBuzzCommand(UObject* Outer);
@@ -101,7 +101,7 @@ private:
public:
/**
* Basic Constructor.
* The basic constructor.
*/
USGBuzzCommand();
@@ -67,7 +67,7 @@ public:
public:
/**
* Basic Constructor.
* The basic constructor.
*/
static USGHandInterpolator* NewHandInterpolator(UObject* Outer);
@@ -156,7 +156,7 @@ private:
public:
/**
* Basic Constructor.
* The basic constructor.
*/
USGHandInterpolator();
@@ -68,7 +68,7 @@ public:
public:
/**
* Default Constructor.
* The default constructor.
*/
static USGHandPose* NewHandPose(UObject* Outer);
@@ -173,7 +173,7 @@ private:
public:
/**
* Default Constructor.
* The default constructor.
*/
USGHandPose();
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* A profile containing all the information required for HapticGloves.
*/
@@ -48,6 +48,9 @@
class FSGHandProfileImpl;
/**
* Interpolation profiles for a user's hand, compatible with all HapticGloves.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHandProfile final : public UObject
{
@@ -58,8 +61,14 @@ public:
UObject* Outer, const FSGHandProfileImpl& HandProfileImpl);
public:
/**
* The default constructor.
*/
static USGHandProfile* NewHandProfile(UObject* Outer);
/**
* Creates a new instance of a HandProfile.
*/
static USGHandProfile* NewHandProfile(
UObject* Outer,
bool bRightHanded,
@@ -67,25 +76,55 @@ public:
const USGNovaGloveHandProfile* NovaGloveHandProfile);
public:
/**
* Generate a new handProfile for either a left or right hand.
*/
static USGHandProfile* Default(UObject* Outer, bool bRightHanded);
/**
* Convert a string notation of a NovaGloveHandProfile into a new instance.
*/
static USGHandProfile* Deserialize(UObject* Outer, const FString& SerializedString);
public:
/**
* Returns the directory where HandProfiles are being stored. Does not include a '\\' at the end.
*/
static FString GetProfileDirectory();
/**
* Filename for the left hand profile.
*/
static FString GetLeftHandFileName();
/**
* Filename for the right hand profile.
*/
static FString GetRightHandFileName();
/**
* Returns the fileName of the left or right-handed profiles.
*/
static FString GetProfileFileName(bool bRightHanded);
/**
* Retrieves the latest HandProfile from disk. If this function returns false, latestProfils is equal to SGCOre::HandProfile::Default(rightHand).
*/
static bool GetLatestProfile(UObject* Outer, bool bRightHanded, USGHandProfile*& OutLatestProfile);
/**
* Stores a HandProfile on disk for other programs to access. Call this function only if your software handles calibration functions.
*/
static bool StoreProfile(const USGHandProfile* ProfileToStore);
/**
* Resets the Calibration of a specific back to default values.
*/
static bool ResetCalibration(bool bRightHanded, bool bOnDisk = true);
/**
* Resets the Calibration of both hands back to default values.
*/
static void ResetCalibration(bool bOnDisk = true);
private:
@@ -100,8 +139,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGHandProfile();
/**
* Creates a new instance of a HandProfile.
*/
USGHandProfile(bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile);
@@ -131,17 +176,35 @@ public:
const FSGHandProfileImpl& ToHandProfileImpl() const;
public:
/**
* Whether this profile was created for a left or right hand.
*/
bool IsRight() const;
/**
* Profile for SenseGloves.
*/
USGSenseGloveHandProfile* GetSenseGloveHandProfile(UObject* Outer) const;
/**
* User profile for Nova.
*/
USGNovaGloveHandProfile* GetNovaGloveHandProfile(UObject* Outer) const;
public:
/**
*
*/
bool Equals(const USGHandProfile* HandProfile) const;
/**
* Reset this profile back to its default values.
*/
void Reset();
public:
/**
* Convert this NovaGloveHandProfile into a string notation so it can be stored on disk.
*/
FString SGSerialize() const;
};
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback.
*/
@@ -55,6 +55,9 @@ class FSGSenseGloveImpl;
class USGBuzzCommand;
class USGForceFeedbackCommand;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGlove : public USGDevice
{
@@ -69,13 +72,25 @@ protected:
static USGHapticGlove* NewHapticGlove(UObject* Outer, TSharedRef<FSGHapticGloveImpl> HapticGloveImpl);
protected:
/**
*
*/
static USGHapticGlove* NewHapticGlove(UObject* Outer);
public:
/**
* Get all Haptic Gloves detected on this system.
*/
static TArray<USGHapticGlove*> GetHapticGloves(UObject* Outer);
/**
* Get the first Haptic Glove detected on this system.
*/
static bool GetGlove(UObject* Outer, USGHapticGlove*& OutGlove);
/**
* Get the first left/right Haptic Glove detected on this system.
*/
static bool GetGlove(UObject* Outer, bool bRightHanded, USGHapticGlove*& OutGlove);
private:
@@ -90,6 +105,9 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
* The basic constructor.
*/
USGHapticGlove();
public:
@@ -158,77 +176,174 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Get the DeviceType enumerator of this device; used to check if its a SenseGlove/Nova/etc.
*/
virtual ESGDeviceType GetDeviceType() const override;
/**
* Retrieve this glove's unique identifier.
*/
virtual FString GetDeviceId() const override;
/**
* Retrieve this glove's hardware (sub) version. "DK1", "DK2", etc.
*/
virtual FString GetHardwareVersion() const override;
/**
* Retrieve this device's main firmware version. v4.12 returns 4.
*/
virtual int32 GetFirmwareVersion() const override;
/**
* Retrieve this device's sub firmware version. v4.12 returns 12.
*/
virtual int32 GetSubFirmwareVersion() const override;
/**
* Returns true if this glove is made for a right hand. If false, it's a left hand.
*/
virtual bool IsRight() const;
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
virtual bool GetImuRotation(FQuat& OutImu);
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
virtual bool GetImuRotation(FRotator& OutImu);
/**
* Calculate the Hand Pose of this device, provided it has Hand Tracking available
*/
virtual bool GetHandPose(
UObject* Outer,
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose);
/**
* Calculate the HandPose of this Device, taking into account user values, but not hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile, but with a specific hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile and default hand Geometry.
*/
virtual bool GetHandPose(UObject* Outer, USGHandPose*& OutHandPose);
public:
/**
* Stops all Haptic effects if any are currently playing. Useful at the end of simulations or when resetting.
*/
virtual void StopHaptics();
/**
* Send Haptic Commands to this Glove.
*/
virtual void StopVibrations();
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGThumperCommand* ThumperCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand);
public:
/**
* Retrieve calibration values of this glove, as an array of size 5, containing x (roll), y (flexion), z (abduction) values.
*/
virtual bool GetCalibrationValues(TArray<FVector>& OutValues);
/**
* Reset Calibration range for this Device.
*/
virtual void ResetCalibrationRange();
/**
* Updates calibration values only.
*/
virtual void UpdateCalibrationRange();
/**
* Updates calibration values only.
*/
virtual void UpdateCalibrationRange(const TArray<FVector>& CalibrationValues);
/**
* Access the minimum- and maximum sensor values measured by this Haptic Glove, in this session.
*/
virtual void GetCalibrationRange(TArray<FVector>& OutMinValues,
TArray<FVector>& OutMaxValues);
/**
* Updates Calibration values and applies it to the Profile.
*/
virtual void UpdateCalibration(UObject* Outer, USGHandProfile*& OutProfile);
/**
* Apply this glove's calibration range to a handProfile.
*/
virtual void ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const;
public:
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const;
};
};
@@ -48,6 +48,9 @@
class FSGHapticGloveCalibrationCheckImpl;
/**
* An algorithm that checks whether or not our current user is running in the same calibration range as last time.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCalibrationCheck final : public UObject
{
@@ -58,32 +61,68 @@ public:
UObject* Outer, const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl);
public:
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
static USGHapticGloveCalibrationCheck* NewHapticGloveCalibrationCheck(UObject* Outer);
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
static USGHapticGloveCalibrationCheck* NewHapticGloveCalibrationCheck(
UObject* Outer, const USGSensorRange* LastCalibrationRange);
public:
/**
* SenseGlove: How far from the threshold one can be where we would still call it 'the same as before'.
*/
static float GetSenseGloveThreshold();
/**
* Nova: How far from the threshold one can be where we would still call it 'the same as before'.
*/
static float GetNovaGloveThreshold();
/**
* SenseGlove: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
static float GetSenseGloveMinFlexion();
/**
* Nova: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
static float GetNovaGloveMinFlexion();
/**
* SenseGlove: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
static float GetSenseGloveMinAbduction();
/**
* Nova: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
static float GetNovaGloveMinAbduction();
public:
/**
* Returns true if this DeviceType requires a calibration check.
*/
static bool NeedsCheck(ESGDeviceType DeviceType);
/**
* Checks if current values are operating out of the previous range. Returns -1 if all is fine. 0...4 to indicate which finger is out of bounds.
*/
static int32 OutOfBounds(const USGSensorRange* PreviousRange, const TArray<FVector>& CurrentValues,
ESGDeviceType DeviceType);
/**
* Returns true if the user has moved enough in both flexion and thumb abduction movement to be considered 'active'
*/
static bool MovedMinimum(const TArray<FVector>& CurrentRange, ESGDeviceType DeviceType);
/**
* Returns true if the current sensor values have moved roughly as much as last time.
*/
static bool MatchesLast(const TArray<FVector>& CurrentRange, const TArray<FVector>& LastRange,
ESGDeviceType DeviceType);
@@ -99,8 +138,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
USGHapticGloveCalibrationCheck();
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
explicit USGHapticGloveCalibrationCheck(const USGSensorRange* LastCalibrationRange);
public:
@@ -128,15 +173,30 @@ public:
const FSGHapticGloveCalibrationCheckImpl& ToHapticGloveCalibrationCheckImpl() const;
public:
/**
*
*/
USGSensorRange* GetLastSensorRange(UObject* Outer) const;
public:
/**
*
*/
ESGCalibrationStage GetCalibrationStage() const;
/**
* Whether this algorithm has determined if calibration is required, or not.
*/
bool ReachedConclusion() const;
public:
/**
* Reset the calibration check. so it may be used again. This does not reset the last range.
*/
void Reset();
/**
* Using the currently received Sensor Values, check if calibration is required. This function will have to be called until a conclusion can be reached.
*/
void CheckRange(const TArray<FVector>& CurrentValues, float DeltaSeconds, ESGDeviceType DeviceType);
};
};
@@ -54,7 +54,7 @@ class SENSEGLOVECOREKISMET_API USGBasicHandModelKismetLibrary final : public USG
public:
/**
* Basic class Constructor.
* The basic class constructor.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model",
meta=(WorldContext="WorldContextObject"))
@@ -52,7 +52,7 @@ class SENSEGLOVECOREKISMET_API USGBuzzCommandKismetLibrary final : public USGBlu
public:
/**
* Basic Constructor.
* The basic constructor.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Buzz Command",
meta=(WorldContext="WorldContextObject"))
@@ -55,7 +55,7 @@ class SENSEGLOVECOREKISMET_API USGHandInterpolatorKismetLibrary final : public U
public:
/**
* Basic Constructor.
* The basic constructor.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator",
meta=(WorldContext="WorldContextObject"))
@@ -57,7 +57,7 @@ class SENSEGLOVECOREKISMET_API USGHandPoseKismetLibrary final : public USGBluepr
public:
/**
* Default Constructor.
* The default constructor.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject"))
static USGHandPose* MakeHandPose(UObject* WorldContextObject);
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* A profile containing all the information required for HapticGloves.
*/
@@ -43,15 +43,24 @@ class USGHandProfile;
class USGNovaGloveHandProfile;
class USGSenseGloveHandProfile;
/**
* Interpolation profiles for a user's hand, compatible with all HapticGloves.
*/
UCLASS(meta=(ScriptName = "SesneGloveHandProfileKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHandProfileKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* The default constructor.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile", meta=(WorldContext="WorldContextObject"))
static USGHandProfile* MakeHandProfile(UObject* WorldContextObject);
/**
* Creates a new instance of a HandProfile.
*/
UFUNCTION(BlueprintPure, DisplayName="Make Hand Profile", Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static USGHandProfile* MakeHandProfile_bRH_SGHP_NGHP(
@@ -60,49 +69,88 @@ public:
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile);
/**
* Generate a new handProfile for either a left or right hand.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static USGHandProfile* Default(UObject* WorldContextObject, bool bRightHanded);
/**
* Convert a string notation of a NovaGloveHandProfile into a new instance.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static USGHandProfile* Deserialize(UObject* WorldContextObject, const FString& SerializedString);
/**
* Returns the directory where HandProfiles are being stored. Does not include a '\\' at the end.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static FString GetProfileDirectory();
/**
* Filename for the left hand profile.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static FString GetLeftHandFileName();
/**
* Filename for the right hand profile.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static FString GetRightHandFileName();
/**
* Returns the fileName of the left or right-handed profiles.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static FString GetProfileFileName(bool bRightHanded);
/**
* Retrieves the latest HandProfile from disk. If this function returns false, latestProfils is equal to SGCOre::HandProfile::Default(rightHand).
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static bool GetLatestProfile(
UObject* WorldContextObject,
bool bRightHanded, USGHandProfile*& OutLatestProfile);
/**
* Stores a HandProfile on disk for other programs to access. Call this function only if your software handles calibration functions.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static bool StoreProfile(const USGHandProfile* ProfileToStore);
/**
* Resets the Calibration of a specific back to default values.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static bool ResetCalibration_bRightHanded_bOnDisk(bool bRightHanded, bool bOnDisk = true);
/**
* Resets the Calibration of both hands back to default values.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Profile")
static void ResetCalibration_bObDisk(bool bOnDisk = true);
/**
* Whether this profile was created for a left or right hand.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static bool IsRight(const USGHandProfile* HandProfile);
/**
* Profile for SenseGloves.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static USGSenseGloveHandProfile* GetSenseGloveHandProfile(UObject* WorldContextObject,
const USGHandProfile* HandProfile);
/**
* User profile for Nova.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile",
meta=(WorldContext="WorldContextObject"))
static USGNovaGloveHandProfile* GetNovaGloveHandProfile(UObject* WorldContextObject,
@@ -111,9 +159,15 @@ public:
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Profile")
static bool Equals(const USGHandProfile* A, const USGHandProfile* B);
/**
* Reset this profile back to its default values.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Profile")
static void Reset(UPARAM(ref) USGHandProfile* HandProfile);
/**
* Convert this NovaGloveHandProfile into a string notation so it can be stored on disk.
*/
UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Hand Profile")
static FString SGSerialize(const USGHandProfile* HandProfile);
};
};
@@ -44,69 +44,123 @@ class USGHapticGlove;
class USGHapticGloveCalibrationCheck;
class USGSensorRange;
/**
* An algorithm that checks whether or not our current user is running in the same calibration range as last time.
*/
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCalibrationCheckKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveCalibrationCheckKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check",
meta=(WorldContext="WorldContextObject"))
static USGHapticGloveCalibrationCheck* MakeHapticGloveCalibrationCheck(UObject* WorldContextObject);
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
UFUNCTION(BlueprintCallable, DisplayName="Make Haptic Glove Calibration Check",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check",
meta=(WorldContext="WorldContextObject"))
static USGHapticGloveCalibrationCheck* MakeHapticGloveCalibrationCheck_LCR(
UObject* WorldContextObject, const USGSensorRange* LastCalibrationRange);
/**
* SenseGlove: How far from the threshold one can be where we would still call it 'the same as before'.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetSenseGloveThreshold();
/**
* Nova: How far from the threshold one can be where we would still call it 'the same as before'.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetNovaGloveThreshold();
/**
* SenseGlove: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetSenseGloveMinFlexion();
/**
* Nova: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetNovaGloveMinFlexion();
/**
* SenseGlove: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetSenseGloveMinAbduction();
/**
* Nova: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static float GetNovaGloveMinAbduction();
/**
* Returns true if this DeviceType requires a calibration check.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static bool NeedsCheck(ESGDeviceType DeviceType);
/**
* Checks if current values are operating out of the previous range. Returns -1 if all is fine. 0...4 to indicate which finger is out of bounds.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static int32 OutOfBounds(const USGSensorRange* PreviousRange, const TArray<FVector>& CurrentValues,
ESGDeviceType DeviceType);
/**
* Returns true if the user has moved enough in both flexion and thumb abduction movement to be considered 'active'
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static bool MovedMinimum(const TArray<FVector>& CurrentRange, ESGDeviceType DeviceType);
/**
* Returns true if the current sensor values have moved roughly as much as last time.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static bool MatchesLast(const TArray<FVector>& CurrentRange, const TArray<FVector>& LastRange,
ESGDeviceType DeviceType);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check",
meta=(WorldContext="WorldContextObject"))
static USGSensorRange* GetLastSensorRange(UObject* WorldContextObject,
const USGHapticGloveCalibrationCheck* HapticGloveCalibrationCheck);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static ESGCalibrationStage GetCalibrationStage(const USGHapticGloveCalibrationCheck* HapticGloveCalibrationCheck);
/**
* Whether this algorithm has determined if calibration is required, or not.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static bool ReachedConclusion(const USGHapticGloveCalibrationCheck* HapticGloveCalibrationCheck);
/**
* Reset the calibration check. so it may be used again. This does not reset the last range.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static void Reset(UPARAM(ref) USGHapticGloveCalibrationCheck* HapticGloveCalibrationCheck);
/**
* Using the currently received Sensor Values, check if calibration is required. This function will have to be called until a conclusion can be reached.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Check")
static void CheckRange(USGHapticGloveCalibrationCheck* HapticGloveCalibrationCheck,
const TArray<FVector>& CurrentValues, float DeltaSeconds, ESGDeviceType DeviceType);
};
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback.
*/
@@ -48,48 +48,87 @@ class USGHandProfile;
class USGHapticGlove;
class USGThumperCommand;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveKismetLibrary : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
/**
* Get all Haptic Gloves detected on this system.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static TArray<USGHapticGlove*> GetHapticGloves(UObject* WorldContextObject);
/**
* Get the first Haptic Glove detected on this system.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Glove", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetGlove_OutG(UObject* WorldContextObject, USGHapticGlove*& OutGlove);
/**
* Get the first left/right Haptic Glove detected on this system.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Glove", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetGlove_bRH_OutG(UObject* WorldContextObject, bool bRightHanded,
USGHapticGlove*& OutGlove);
/**
* Get the DeviceType enumerator of this device; used to check if its a SenseGlove/Nova/etc.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static ESGDeviceType GetDeviceType(const USGHapticGlove* HapticGlove);
/**
* Retrieve this glove's unique identifier.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static FString GetDeviceId(const USGHapticGlove* HapticGlove);
/**
* Retrieve this glove's hardware (sub) version. "DK1", "DK2", etc.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static FString GetHardwareVersion(const USGHapticGlove* HapticGlove);
/**
* Retrieve this device's main firmware version. v4.12 returns 4.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static int32 GetFirmwareVersion(const USGHapticGlove* HapticGlove);
/**
* Retrieve this device's sub firmware version. v4.12 returns 12.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static int32 GetSubFirmwareVersion(const USGHapticGlove* HapticGlove);
/**
* Returns true if this glove is made for a right hand. If false, it's a left hand.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static bool IsRight(const USGHapticGlove* HapticGlove);
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Imu Rotation", Category="SenseGlove | Core | Haptic Glove")
static bool GetImuRotation_FQuat_OutI(UPARAM(ref) USGHapticGlove* HapticGlove, FQuat& OutImu);
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Imu Rotation", Category="SenseGlove | Core | Haptic Glove")
static bool GetImuRotation_FRotator_OutI(UPARAM(ref) USGHapticGlove* HapticGlove, FRotator& OutImu);
/**
* Calculate the Hand Pose of this device, provided it has Hand Tracking available
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HG_HP_OutHP(UObject* WorldContextObject,
@@ -98,6 +137,9 @@ public:
const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose);
/**
* Calculate the HandPose of this Device, taking into account user values, but not hand geometry.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HP_OutHP(UObject* WorldContextObject,
@@ -105,6 +147,9 @@ public:
const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile, but with a specific hand geometry.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HG_OutHP(UObject* WorldContextObject,
@@ -112,66 +157,116 @@ public:
const USGBasicHandModel* HandGeometry,
USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile and default hand Geometry.
*/
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_OutHP(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove,
USGHandPose*& OutHandPose);
/**
* Stops all Haptic effects if any are currently playing. Useful at the end of simulations or when resetting.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void StopHaptics(UPARAM(ref) USGHapticGlove* HapticGlove);
/**
*
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void StopVibrations(UPARAM(ref) USGHapticGlove* HapticGlove);
/**
* Send Haptic Commands to this Glove.
*/
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_FFC(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Send Haptic Commands to this Glove.
*/
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_BC(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_TC(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGThumperCommand* ThumperCommand);
/**
* Send Haptic Commands to this Glove.
*/
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_FFC_BC(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_FFC_BC_TC(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand);
/**
* Retrieve calibration values of this glove, as an array of size 5, containing x (roll), y (flexion), z (abduction) values.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static bool GetCalibrationValues(UPARAM(ref) USGHapticGlove* HapticGlove, TArray<FVector>& OutValues);
/**
* Reset Calibration range for this Device.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void ResetCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove);
/**
* Updates calibration values only.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void UpdateCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove);
/**
* Updates calibration values only.
*/
UFUNCTION(BlueprintCallable, DisplayName="Update Calibration", Category="SenseGlove | Core | Haptic Glove")
static void UpdateCalibrationRange_CV(UPARAM(ref) USGHapticGlove* HapticGlove,
const TArray<FVector>& CalibrationValues);
/**
* Access the minimum- and maximum sensor values measured by this Haptic Glove, in this session.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void GetCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove,
TArray<FVector>& OutMinValues, TArray<FVector>& OutMaxValues);
/**
* Updates Calibration values and applies it to the Profile.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static void UpdateCalibration(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove, USGHandProfile*& OutProfile);
/**
* Apply this glove's calibration range to a handProfile.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static void ApplyCalibration(UObject* WorldContextObject,
const USGHapticGlove* HapticGlove, USGHandProfile*& OutProfile);
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Haptic Glove")
static void GetWristLocation_RP_FQuat_RR_TH_OutWP_Out_WR(
const USGHapticGlove* HapticGlove,
@@ -179,6 +274,11 @@ public:
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation);
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Haptic Glove")
static void GetWristLocation_RP_FRotator_RR_TH_OutWP_OutWR(
const USGHapticGlove* HapticGlove,
@@ -186,6 +286,9 @@ public:
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation);
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Glove Location", Category="SenseGlove | Core | Haptic Glove")
static void GetGloveLocation_RP_FQuat_RR_TH_OutGP_OutGR(
const USGHapticGlove* HapticGlove,
@@ -193,10 +296,13 @@ public:
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation);
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Glove Location", Category="SenseGlove | Core | Haptic Glove")
static void GetGloveLocation_RP_FRotator_RR_TH_OutGP_OutGR(
const USGHapticGlove* HapticGlove,
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation);
};
};