add more documentation

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