From 1ab4410c21b3c81c9abb5e9d7928453b5d3d4e15 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Thu, 17 Nov 2022 15:23:17 +0100 Subject: [PATCH] document some parts of the layer 3 and 4 api --- .../Public/SGConnect/SGConnect.h | 36 ++--- .../SGConnectKismet/SGConnectKismetLibrary.h | 36 ++--- .../SenseGloveCore/Public/SGCore/SGAnatomy.h | 44 +++++- .../Public/SGCore/SGBasicHandModel.h | 148 +++++++++++++++++- .../Public/SGCore/SGBetaDevice.h | 55 ++++++- .../Public/SGCore/SGBuzzCommand.h | 47 +++++- .../Public/SGCore/SGCalibrationDataPoint.h | 28 +++- .../Public/SGCore/SGDeviceList.h | 54 ++++++- .../Public/SGCore/SGDeviceModel.h | 38 ++++- .../Public/SGCore/SGFingerCommand.h | 32 +++- .../Public/SGCore/SGForceFeedbackCommand.h | 44 +++++- .../Public/SGCore/SGHandInterpolator.h | 101 +++++++++++- .../SenseGloveCore/Public/SGCore/SGHandPose.h | 102 +++++++++++- .../SGCoreKismet/SGAnatomyKismetLibrary.h | 44 +++++- .../SGBasicHandModelKismetLibrary.h | 124 ++++++++++++++- .../SGCoreKismet/SGBetaDeviceKismetLibrary.h | 42 ++++- .../SGCoreKismet/SGBuzzCommandKismetLibrary.h | 28 +++- .../SGCalibrationDataPointKismetLibrary.h | 17 +- .../SGCoreKismet/SGDeviceListKismetLibrary.h | 51 +++++- .../SGCoreKismet/SGDeviceModelKismetLibrary.h | 29 +++- .../SGFingerCommandKismetLibrary.h | 22 ++- .../SGForceFeedbackCommandKismetLibrary.h | 28 +++- .../SGHandInterpolatorKismetLibrary.h | 71 ++++++++- .../SGCoreKismet/SGHandPoseKismetLibrary.h | 84 +++++++++- 24 files changed, 1221 insertions(+), 84 deletions(-) diff --git a/Source/SenseGloveConnect/Public/SGConnect/SGConnect.h b/Source/SenseGloveConnect/Public/SGConnect/SGConnect.h index 5c866a64..1b4e9a9c 100644 --- a/Source/SenseGloveConnect/Public/SGConnect/SGConnect.h +++ b/Source/SenseGloveConnect/Public/SGConnect/SGConnect.h @@ -46,32 +46,32 @@ struct SENSEGLOVECONNECT_API FSGConnect public: /** - * Begin Scanning for Sense Glove Devices and set up communications with them. - * - * @return - * -3 : An Unexpected error occured. Please try again. - * -2 : Device Scanning is already running within a different program. - * -1 : Device Scanning already being initialized (function called twice in short succession). - * 0 : Device Scanning is already running in within this program. - * 1 : Successfully started up DeviceScanning from the current program. + * Begin Scanning for Sense Glove Devices and set up communications with them. + * + * @return + * -3 : An Unexpected error occured. Please try again. + * -2 : Device Scanning is already running within a different program. + * -1 : Device Scanning already being initialized (function called twice in short succession). + * 0 : Device Scanning is already running in within this program. + * 1 : Successfully started up DeviceScanning from the current program. */ static int32 Init(); /** - * Dispose of unmanaged resources and finalize Sense Glove devices. - * - * @return - * -3 : An Unexpected error occured. Please try again. - * -2 : Not allowed to dispose of Device Scanning because this is not the program which started it. - * -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession). - * 0 : There is no deviceScanner running from any program, so disposing is skipped. - * 1 : Successfully disposed of DeviceScanner resources. - * @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern. + * Dispose of unmanaged resources and finalize Sense Glove devices. + * + * @return + * -3 : An Unexpected error occured. Please try again. + * -2 : Not allowed to dispose of Device Scanning because this is not the program which started it. + * -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession). + * 0 : There is no deviceScanner running from any program, so disposing is skipped. + * 1 : Successfully disposed of DeviceScanner resources. + * @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern. */ static int32 Dispose(); /** - * Check which version of SGConnect you are using. + * Check which version of SGConnect you are using. */ static FString GetLibraryVersion(); }; diff --git a/Source/SenseGloveConnectKismet/Public/SGConnectKismet/SGConnectKismetLibrary.h b/Source/SenseGloveConnectKismet/Public/SGConnectKismet/SGConnectKismetLibrary.h index d588ac32..2b5ec3f2 100644 --- a/Source/SenseGloveConnectKismet/Public/SGConnectKismet/SGConnectKismetLibrary.h +++ b/Source/SenseGloveConnectKismet/Public/SGConnectKismet/SGConnectKismetLibrary.h @@ -50,34 +50,34 @@ class SENSEGLOVECONNECTKISMET_API USGConnectKismetLibrary final : public USGBlue public: public: /** - * Begin Scanning for Sense Glove Devices and set up communications with them. - * - * @return - * -3 : An Unexpected error occured. Please try again. - * -2 : Device Scanning is already running within a different program. - * -1 : Device Scanning already being initialized (function called twice in short succession). - * 0 : Device Scanning is already running in within this program. - * 1 : Successfully started up DeviceScanning from the current program. + * Begin Scanning for Sense Glove Devices and set up communications with them. + * + * @return + * -3 : An Unexpected error occured. Please try again. + * -2 : Device Scanning is already running within a different program. + * -1 : Device Scanning already being initialized (function called twice in short succession). + * 0 : Device Scanning is already running in within this program. + * 1 : Successfully started up DeviceScanning from the current program. */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect") static int32 Init(); /** - * Dispose of unmanaged resources and finalize Sense Glove devices. - * - * @return - * -3 : An Unexpected error occured. Please try again. - * -2 : Not allowed to dispose of Device Scanning because this is not the program which started it. - * -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession). - * 0 : There is no deviceScanner running from any program, so disposing is skipped. - * 1 : Successfully disposed of DeviceScanner resources. - * @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern. + * Dispose of unmanaged resources and finalize Sense Glove devices. + * + * @return + * -3 : An Unexpected error occured. Please try again. + * -2 : Not allowed to dispose of Device Scanning because this is not the program which started it. + * -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession). + * 0 : There is no deviceScanner running from any program, so disposing is skipped. + * 1 : Successfully disposed of DeviceScanner resources. + * @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern. */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect") static int32 Dispose(); /** - * Check which version of SGConnect you are using. + * Check which version of SGConnect you are using. */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect") static FString GetLibraryVersion(); diff --git a/Source/SenseGloveCore/Public/SGCore/SGAnatomy.h b/Source/SenseGloveCore/Public/SGCore/SGAnatomy.h index cb968c29..5de1f9f8 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGAnatomy.h +++ b/Source/SenseGloveCore/Public/SGCore/SGAnatomy.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Hard-Coded Database that is used in calibration and in solving. + * Values herein are used to limit outputs within 'natural' ranges. */ @@ -41,33 +42,72 @@ #include "SGAnatomy.generated.h" +/** + * "Database" of anatomical values, such as joint limits. + */ USTRUCT() struct SENSEGLOVECORE_API FSGAnatomy { GENERATED_BODY() public: + /** + * Total sum of all finger flexion that would be considered "total flexion". + */ static float GetTotalFingerFlexion(); + /** + * Total sum of all finger flexion that would be considered "total extension". + */ static float GetTotalFingerExtension(); + /** + * Total sum of all thumb flexion that would be considered "total flexion". + */ static float GetTotalThumbFlexion(); + /** + * Total sum of all thumb flexion that would be considered "total extension". + */ static float GetTotalThumbExtension(); + /** + * Retrieve one of the limits of a finger joint's movement. + */ static float GetFingerJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax); + /** + * Retrieve one of the limits of a thumb joint's movement. + */ static float GetThumbJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax); + /** + * Convert a total finger flexion in radians into a 0..1 representation. + */ static float NormalizeFingerFlexion(float FlexionInRadians); + /** + * Convert a total thumb flexion in radians into a 0..1 representation. + */ static float NormalizeThumbFlexion(float FlexionInRadians); + /** + * Get Hand Angles that would make a Default (Idle) Pose. + */ static TArray> GetDefaultHandAngles(bool bRightHanded); + /** + * Get Hand Angles that would make a flat hand. + */ static TArray> GetFlatHandAngles(bool bRightHanded); + /** + * Get hand angles that would make a thumbs up. + */ static TArray> GetThumbsUpHandAngles(bool bRightHanded); + /** + * Get Hand Angles that would make a fist. + */ static TArray> GetFistHandAngles(bool bRightHanded); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h b/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h index ce7612db..7ff7e46c 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h +++ b/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * A data class containing the minimum required data for a hand's forward kinematics. + * Used in both kinematics and calibration. */ @@ -52,6 +53,9 @@ class FSGBasicHandModelImpl; +/** + * Represents data of a user's hand required for forward kinematics. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGBasicHandModel final : public UObject { @@ -62,46 +66,88 @@ public: UObject* Outer, const FSGBasicHandModelImpl& BasicHandModelImpl); public: + /** + * Basic class Constructor. + */ static USGBasicHandModel* NewBasicHandModel(UObject* Outer); + /** + * Create a new BasicHandModel with no starting rotations. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions); + /** + * Create a new BasicHandModel with no starting rotations. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray& Lengths, const TArray& StartPositions); + /** + * Create a new BasicHandModel. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ static USGBasicHandModel* NewBasicHandModel( UObject* Outer, bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); public: + /** + * Retrieve a default left or right hand model. + */ static USGBasicHandModel* Default(UObject* Outer, bool bRightHanded); + /** + * Convert a serialized HandModel back into its class representation. + */ static USGBasicHandModel* Deserialize(UObject* Outer, const FString& SerializedString); public: + /** + * Default finger lengths (based on right hand). + * + * @remarks Any missing fingers are replaced with their respective value. + */ static TArray> GetBaseFingerLengths(); + /** + * Default joint positions (based on right hand). + * + * @remarks Any missing positions are replaced with their respective value. + */ static TArray GetBaseJointPositions(); + /** + * Default joint angles (based on right hand). + * + * @remarks Any missing angles are replaced with their respective value. + */ static TArray GetBaseJointAngles(); private: @@ -116,23 +162,44 @@ private: FImplDeleter PimplDeleter; public: + /** + * Basic class Constructor. + */ USGBasicHandModel(); + /** + * Create a new BasicHandModel with no starting rotations. + */ USGBasicHandModel(bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions); + /** + * Create a new BasicHandModel with no starting rotations. + */ USGBasicHandModel(bool bRightHanded, const TArray& Lengths, const TArray& StartPositions); + /** + * Create a new BasicHandModel. + */ USGBasicHandModel(bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ USGBasicHandModel(bool bRightHanded, const TArray>& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ USGBasicHandModel(bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ USGBasicHandModel(bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); @@ -167,54 +234,133 @@ protected: FSGBasicHandModelImpl& ToBasicHandModelImpl(); public: + /** + * Whether or not this BasicHandModel was created for a left- or right hand. Used for validation. + */ bool IsRight() const; + /** + * The length of individual finger phalangers in mm, sorted per finger. Generally 5x3. + */ TArray> GetFingerLengths() const; + /** + * Retrieve the finger lengths of a specific finger in cm. + */ TArray GetFingerLengths(ESGFinger Finger) const; + /** + * Set the finger lengths of a specific finger in cm. + */ void SetFingerLengths(ESGFinger Finger, const TArray& Lengths); + + /** + * Set the finger lengths of a specific finger in cm. + */ void SetFingerLengths(uint8 Finger, const TArray& Lengths); + /** + * Get the finger ratios of all fingers. + */ TArray> GetFingerRatios() const; + /** + * Get the finger ratios of a specific finger. + */ TArray GetFingerRatios(ESGFinger Finger) const; + /** + * Starting joint positions relative to the device Origin. + */ TArray GetStartJointPositions() const; + /** + * + */ void SetStartJointPosition(ESGFinger Finger, const FVector& Position); + + /** + * + */ void SetStartJointPosition(uint8 Finger, const FVector& Position); + /** + * Starting joint rotations relative to the device Origin. + */ TArray GetStartJointRotationsQ() const; + /** + * Starting joint rotations relative to the device Origin. + */ TArray GetStartJointRotations() const; + /** + * Retrieve the start position of a specific finger. + */ FVector GetJointPosition(ESGFinger Finger) const; + /** + * Set the start position of a specific finger. + */ void SetJointPosition(const FVector& NewPosition, ESGFinger Finger); + /** + * Retrieve the start rotation of a specific finger. + */ FQuat GetJointRotationQ(ESGFinger Finger) const; + /** + * Retrieve the start rotation of a specific finger. + */ FRotator GetJointRotation(ESGFinger Finger) const; + /** + * Set the start rotation of a specific finger. + */ void SetJointRotation(const FQuat& NewRotation, ESGFinger Finger); + /** + * Set the start rotation of a specific finger. + */ void SetJointRotation(const FRotator& NewRotation, ESGFinger Finger); + /** + * Get the total lengths of fingers, in cm. + */ TArray GetTotalLengths() const; + /** + * Get the total length of a specific finger, in mm. + */ float GetTotalLength(ESGFinger Finger) const; public: + /** + * Retrieve the lengths of a specific finger, as BasicHandModel representation (L, 0, 0). + * + * @remarks Used for forwards kinematics. + */ TArray Get3DLengths(ESGFinger Finger) const; public: + /** + * Check if this BasicHandModel has the same values as another BasicHandModel. + */ bool Equals(const USGBasicHandModel* BasicHandModel) const; public: + /** + * Convert this handModel into a string notation, readable for humans. Does not include starting positions / rotations. + */ FString ToString() const; + /** + * Convert this handModel into a string notation, readable for humans. Optionally includes starting positions / rotations. + */ FString ToString(bool bLengthsOnly) const; + /** + * Serialize this HandModel into a string representation. + */ FString SGSerialize() const; }; \ No newline at end of file diff --git a/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h b/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h index 1796774d..3b228cb6 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h +++ b/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h @@ -29,7 +29,9 @@ * * @section DESCRIPTION * - * + * Represents a Sense Glove Device that has no specific class within the API. + * Used to test different iterations of the same product before integrating it into the Core API. + * Allows access to raw sensor values and commands of such a device. */ @@ -45,6 +47,9 @@ class FSGDeviceImpl; class FSGBetaDeviceImpl; +/** + * A Device that adheres to the SenseGlove communications protocol, but which has no implementation in this API. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGBetaDevice final : public USGDevice { @@ -55,14 +60,24 @@ public: static USGBetaDevice* NewBetaDevice(UObject* Outer, TSharedRef BetaDeviceImpl); +public: + /** + * Basic Class Constructor. + */ static USGBetaDevice* NewBetaDevice(UObject* Outer); + /** + * Creates a new instance of a Beta Device. + */ static USGBetaDevice* NewBetaDevice( UObject* Outer, const FString& ConstantsString, const FString& DeviceId, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion); public: + /** + * Deserialize a beta device from its basic constants string. Returns nullptr is unsuccessful. + */ static USGBetaDevice* Parse(UObject* Outer, const FString& String); private: @@ -77,8 +92,14 @@ private: FImplDeleter PimplDeleter; public: + /** + * Basic Class Constructor. + */ USGBetaDevice(); + /** + * Creates a new instance of a Beta Device. + */ USGBetaDevice(const FString& ConstantsString, const FString& DeviceId, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion); @@ -118,26 +139,56 @@ protected: virtual void SyncUProperties() override; public: + /** + * Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration. + */ virtual ESGDeviceType GetDeviceType() const override; + /** + * Get the unique identifier of this device. + */ virtual FString GetDeviceId() const override; + /** + * Retrieve this device's hardware version. + */ virtual FString GetHardwareVersion() const override; + /** + * Retrieve this device's firmware version. + */ virtual int32 GetFirmwareVersion() const override; + /** + * Retrieve this device's sub-firmware version. + */ virtual int32 GetSubFirmwareVersion() const override; public: + /** + * Retrieve the constants string for additional processing. + */ FString GetConstantsString() const; + /** + * Retrieve a raw sensor string from this Beta Device. + */ FString GetSensorData() const; + /** + * Retrieve the last command retrieved from this Beta Device. + */ FString GetLastCommand() const; public: + /** + * Send a raw string command to this device. + */ bool SendHaptics(const FString& Command) const; public: + /** + * Create a string representation of this device for reporting purposes. + */ virtual FString ToString() const override; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGBuzzCommand.h b/Source/SenseGloveCore/Public/SGCore/SGBuzzCommand.h index 1da5359e..56261f6f 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGBuzzCommand.h +++ b/Source/SenseGloveCore/Public/SGCore/SGBuzzCommand.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * Buzz motor command specific for the Sense Glove. */ @@ -47,6 +47,9 @@ class FSGBuzzCommandImpl; +/** + * A vibration command for the Sense Glove, with levels for each finger. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGBuzzCommand : public USGFingerCommand { @@ -57,15 +60,32 @@ public: static USGBuzzCommand* NewBuzzCommand(UObject* Outer, TSharedRef BuzzCommandImpl); +public: + /** + * Basic Constructor. + */ static USGBuzzCommand* NewBuzzCommand(UObject* Outer); + /** + * Create a new buzz motor command, where each finger level is contained inside an array of size 5. + */ static USGBuzzCommand* NewBuzzCommand(UObject* Outer, const TArray& BuzzLevels); - static USGBuzzCommand* NewBuzzCommand(UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + /** + * Create a new Buzz Motor command, indicating the intensity for each finger. + */ + static USGBuzzCommand* NewBuzzCommand(UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring, + int32 Pinky); + /** + * Create a new Buzz Motor command, with only one finger being activated. + */ static USGBuzzCommand* NewBuzzCommand(UObject* Outer, ESGFinger Finger, int32 BuzzLevel); public: + /** + * A command that turns off all vibration motors of the Sense Glove. + */ static USGBuzzCommand* Off(UObject* Outer); private: @@ -80,9 +100,24 @@ private: FImplDeleter PimplDeleter; public: + /** + * Basic Constructor. + */ USGBuzzCommand(); + + /** + * Create a new buzz motor command, where each finger level is contained inside an array of size 5. + */ explicit USGBuzzCommand(const TArray& BuzzLevels); + + /** + * Create a new Buzz Motor command, indicating the intensity for each finger. + */ USGBuzzCommand(int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + + /** + * Create a new Buzz Motor command, with only one finger being activated. + */ USGBuzzCommand(ESGFinger Finger, int32 BuzzLevel); public: @@ -121,7 +156,13 @@ protected: virtual void SyncUProperties() override; public: + /** + * Copy this Buzz Command into a new object. + */ USGBuzzCommand* Copy(UObject* Outer) const; + /** + * Merge this command with another, taking the maximum value between the two. + */ USGBuzzCommand* Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGCalibrationDataPoint.h b/Source/SenseGloveCore/Public/SGCore/SGCalibrationDataPoint.h index 574ff11e..aa02b2ff 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGCalibrationDataPoint.h +++ b/Source/SenseGloveCore/Public/SGCore/SGCalibrationDataPoint.h @@ -47,6 +47,9 @@ class FSGCalibrationDataPointImpl; +/** + * + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGCalibrationDataPoint final : public UObject { @@ -57,11 +60,17 @@ public: UObject* Outer, const FSGCalibrationDataPointImpl& CalibrationDataPointImpl); public: + /** + * + */ static USGCalibrationDataPoint* NewCalibrationDataPoint(UObject* Outer); + /** + * Create a new data point. + */ static USGCalibrationDataPoint* NewCalibrationDataPoint( UObject* Outer, - int32 CurrentStage,const TArray& CalibrationValues); + int32 CurrentStage, const TArray& CalibrationValues); private: struct FImpl; @@ -75,8 +84,14 @@ private: FImplDeleter PimplDeleter; public: + /** + * + */ USGCalibrationDataPoint(); + /** + * Create a new data point. + */ USGCalibrationDataPoint(int32 CurrentStage, const TArray& CalibrationValues); public: @@ -104,10 +119,19 @@ public: const FSGCalibrationDataPointImpl& ToCalibrationDataPointImpl() const; public: + /** + * Actual calibration values. + */ TArray GetCalibrationValues() const; + /** + * The Calibration stage this data point belongs to. + */ int32 GetStage() const; public: + /** + * Log Calibration values for storing on disk. + */ FString ToLogData(const FString& Delimiter = "\t") const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h b/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h index cb7819bb..67ea14ab 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h +++ b/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * Interface for SenseCom, allows the retrieval of Devices and Data, but only as. */ @@ -46,41 +46,91 @@ class USGDevice; +/** + * Interface for SenseCom, allows the retrieval of Devices and Data. + */ USTRUCT() struct SENSEGLOVECORE_API FSGDeviceList { GENERATED_BODY() public: + /** + * Retrieve the number of devices that have been detected by the SenseCom executable. + */ static int32 ActiveDevices(); + /** + * Returns true if the SenseCom program is running. + */ static bool SenseCommRunning(); + /** + * Clear the device list, and block any further attempt to add to it until ReInitialize is called. + * + * @remarks Useful if your IDE has troubles unloading dlls (cough, Unity, Cough). + */ static void Dispose(); + /** + * When you've accidentally disposed of the list before you meant to. + */ static void Reinitialize(); + /** + * Retrieve all Sense Glove Devices connected to this system. + */ static TArray GetDevices(UObject* Outer); /// TODO // THIS PROBABLY SHOULD BE REMOVED! + /** + * Retrieve a list of SGDevices of a specific class. + */ static TArray GetDevices(UObject* Outer, const TSubclassOf& DeviceType); + /** + * Retrieve a list of SGDevices of a specific type. + */ static TArray GetDevices(UObject* Outer, ESGDeviceType DeviceType); + /** + * Retrieve the latest (raw) sensor data from a specific device in our list. + */ static bool GetSensorDataString(int32 IpcIndex, const FString& IpcAddress, FString& OutString); + /** + * Send a (raw) command to a specific device in the list. + */ static bool SendHaptics(int32 IpcIndex, const FString& IpcAddress, const FString& Commands); + /** + * + */ static FString GetDeviceStringAt(int32 IpcIndex, const FString& IpcAddress, int32 Index); + /** + * Retrieve Device Address. + */ static FString GetAddress(int32 IpcIndex, const FString& IpcAddress); + /** + * Retieve this device's connectionType. + */ static ESGConnectionType GetConnectionType(int32 IpcIndex, const FString& IpcAddress); + /** + * Returns true if the device at this connection side is properly connected. + */ static bool IsConnected(int32 IpcIndex, const FString& IpcAddress); + /** + * Retrieve the device's Packets per Second Variable. + */ static int32 PacketsPerSecondReceived(int32 IpcIndex, const FString& IpcAddress); + /** + * Retrieve the device's Packets per Second sent Variable. + */ static int32 PacketsPerSecondSent(int32 IpcIndex, const FString& IpcAddress); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGDeviceModel.h b/Source/SenseGloveCore/Public/SGCore/SGDeviceModel.h index 207a8e45..654f6946 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGDeviceModel.h +++ b/Source/SenseGloveCore/Public/SGCore/SGDeviceModel.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Base class for Device Models containing the minimum amount of data gathered + * through Communications Protocol. Used for shared functionality. */ @@ -47,6 +48,9 @@ class FSGDeviceModelImpl; +/** + * Base class containing the minimum amount of data for device models. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGDeviceModel final : public UObject { @@ -57,15 +61,27 @@ public: UObject* Outer, const FSGDeviceModelImpl& DeviceModelImpl); public: + /** + * + */ static USGDeviceModel* NewDeviceModel(UObject* Outer); + /** + * + */ static USGDeviceModel* NewDeviceModel( UObject* Outer, const FString& Id, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion); public: + /** + * Parse a 32-bit integer value into a set of booleans (010010011) that indicate which (optional) functions this device has. + */ static TArray ParseFunctions(int32 Value, int32 Size); + /** + * + */ static void ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion); private: @@ -80,8 +96,14 @@ private: FImplDeleter PimplDeleter; public: + /** + * Empty constructor to be used by child classes. + */ USGDeviceModel(); + /** + * + */ USGDeviceModel(const FString& Id, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion); public: @@ -115,11 +137,23 @@ protected: FSGDeviceModelImpl& ToDeviceModelImpl(); public: + /** + * Retrieve the Unique identifier of this device. + */ FString GetDeviceId() const; + /** + * Retrieve the Hardware (sub) version of this Sense Glove Device. + */ FString GetHardwareVersion() const; + /** + * Firmware version running on the device's MicroController. (as v4.12, this is the 4). + */ int32 GetFirmwareVersion() const; + /** + * Sub firmware version running on the device's microcontroller (as v4.12, this is the 12). + */ int32 GetSubFirmwareVersion() const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGFingerCommand.h b/Source/SenseGloveCore/Public/SGCore/SGFingerCommand.h index 83bca8ff..3db8010e 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGFingerCommand.h +++ b/Source/SenseGloveCore/Public/SGCore/SGFingerCommand.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * A command for five fingers that can be sent to a Sense Glove device. */ @@ -49,8 +49,11 @@ class FSGFingerCommandImpl; class FSGForceFeedbackCommandImpl; class FSGTimedBuzzCommandImpl; +/** + * A command that contains values (levels) for five fingers. + */ UCLASS(Abstract, BlueprintType) -class SENSEGLOVECORE_API USGFingerCommand : public UObject +class SENSEGLOVECORE_API USGFingerCommand : public UObject { GENERATED_BODY() @@ -66,8 +69,14 @@ private: FImplDeleter PimplDeleter; protected: + /** + * + */ USGFingerCommand(); + /** + * + */ explicit USGFingerCommand(const TArray& InLevels); public: @@ -159,7 +168,6 @@ protected: */ void SetFingerCommandImpl(TSharedRef TimedBuzzCommandImpl); - public: /** * The cast to underlying type method. @@ -178,13 +186,29 @@ protected: virtual void SyncUProperties(); public: + /** + * + */ TArray GetLevels() const; public: + /** + * + */ int32 GetLevel(int32 Finger) const; + + /** + * + */ void SetLevel(int32 Finger, int32 Value); + /** + * Check if this command contains the same values as another. + */ bool Equals(const USGFingerCommand* FingerCommand) const; + /** + * Create a string representation of this finger command. + */ FString ToString() const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGForceFeedbackCommand.h b/Source/SenseGloveCore/Public/SGCore/SGForceFeedbackCommand.h index 6352328a..71a8bc08 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGForceFeedbackCommand.h +++ b/Source/SenseGloveCore/Public/SGCore/SGForceFeedbackCommand.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * A command for five fingers that can be sent to a Sense Glove device. */ @@ -47,6 +47,9 @@ class FSGForceFeedbackCommandImpl; +/** + * A Force-Feedback command for the Sense Glove, with levels for each finger. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGForceFeedbackCommand final : public USGFingerCommand { @@ -59,18 +62,34 @@ public: static USGForceFeedbackCommand* NewForceFeedbackCommand( UObject* Outer, TSharedRef ForceFeedbackCommandImpl); +public: + /** + * Empty constructor for internal initialization. + */ static USGForceFeedbackCommand* NewForceFeedbackCommand(UObject* Outer); + /** + * Create a new Force-Feedback Command, with levels for each finger stored in an int[5] array. + */ static USGForceFeedbackCommand* NewForceFeedbackCommand( UObject* Outer, const TArray& ForceFeedbackLevels); + /** + * Create a new Force-Feedback Command, with levels for each finger. + */ static USGForceFeedbackCommand* NewForceFeedbackCommand( UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + /** + * Create a new Force-Feedback command, with only one finger being activated. + */ static USGForceFeedbackCommand* NewForceFeedbackCommand( UObject* Outer, ESGFinger Finger, int32 BuzzLevel); public: + /** + * A command that turns off all force feedback on the Sense Glove. + */ static USGForceFeedbackCommand* Off(UObject* Outer); private: @@ -85,9 +104,24 @@ private: FImplDeleter PimplDeleter; public: + /** + * Empty constructor for internal initialization. + */ USGForceFeedbackCommand(); + + /** + * Create a new Force-Feedback Command, with levels for each finger stored in an int[5] array. + */ explicit USGForceFeedbackCommand(const TArray& ForceFeedbackLevels); + + /** + * Create a new Force-Feedback Command, with levels for each finger. + */ USGForceFeedbackCommand(int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + + /** + * Create a new Force-Feedback command, with only one finger being activated. + */ USGForceFeedbackCommand(ESGFinger Finger, int32 BuzzLevel); public: @@ -126,7 +160,13 @@ protected: virtual void SyncUProperties() override; public: + /** + * Copy this ForceFeedback Command into a new object. + */ USGForceFeedbackCommand* Copy(UObject* Outer) const; + /** + * Merge this finger command with another, taking the maximum value between the two. + */ USGForceFeedbackCommand* Merge(UObject* Outer, const USGForceFeedbackCommand* ForceFeedbackCommand) const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGHandInterpolator.h b/Source/SenseGloveCore/Public/SGCore/SGHandInterpolator.h index 257a0af3..eb8572d6 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGHandInterpolator.h +++ b/Source/SenseGloveCore/Public/SGCore/SGHandInterpolator.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Contains interpolation sets for all hand joint movements that can be + * calculated using the Sense Glove. */ @@ -52,6 +53,9 @@ class FSGHandInterpolatorImpl; +/** + * Contains interpolation sets of all joint movements that can be calculated into a HandPose. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGHandInterpolator final : public UObject { @@ -62,44 +66,80 @@ public: UObject* Outer, const FSGHandInterpolatorImpl& HandInterpolatorImpl); public: + /** + * Basic Constructor. + */ static USGHandInterpolator* NewHandInterpolator(UObject* Outer); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray>& JointInterpolations); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray& JointInterpolations); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray>& JointInterpolations, const FQuat& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray>& JointInterpolations, const FRotator& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray& JointInterpolations, const FQuat& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ static USGHandInterpolator* NewHandInterpolator( UObject* Outer, const TArray& JointInterpolations, const FRotator& CmcStartRotation); public: + /** + * Create a default instance of a left- or right handed interpolator. + */ static USGHandInterpolator* Default(UObject* Outer, const bool bRightHanded); + /** + * Convert a serialized HandInterpolator back into a class representation. + */ static USGHandInterpolator* Deserialize(UObject* Outer, const FString& SerializedString); public: + /** + * Calculate all angles of a specific finger based on an Interpolator and input angles. + */ static TArray InterpolateFingerAngles(ESGFinger Finger, const USGHandInterpolator* Interpolator, const FVector& TotalGloveAngles); + /** + * Calculate all angles of the Thumb based on an Interpolator and input angles. + */ static TArray InterpolateThumbAngles(const USGHandInterpolator* Interpolator, const FVector& TotalGloveAngles); + /** + * Calculate all hand angles based on an interpolator and total xyz angles. + */ static TArray> InterpolateHandAngles(const USGHandInterpolator* Interpolator, const TArray& TotalAngles); @@ -115,21 +155,42 @@ private: FImplDeleter PimplDeleter; public: + /** + * Basic Constructor. + */ USGHandInterpolator(); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ explicit USGHandInterpolator(const TArray>& JointInterpolations); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ explicit USGHandInterpolator(const TArray& JointInterpolations); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ USGHandInterpolator(const TArray>& JointInterpolations, const FQuat& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ USGHandInterpolator(const TArray>& JointInterpolations, const FRotator& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ USGHandInterpolator(const TArray& JointInterpolations, const FQuat& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ USGHandInterpolator(const TArray& JointInterpolations, const FRotator& CmcStartRotation); @@ -158,32 +219,68 @@ public: const FSGHandInterpolatorImpl& ToHandInterpolatorImpl() const; public: + /** + * Interpolation sets for each finger. First index indicates which finger, Second index indicates the joint movement. + */ TArray> GetJointInterpolations(UObject* Outer) const; + /** + * Starting rotation of the thumb cmc joint. + */ FQuat GetCmcStartRotationQ() const; + /** + * Starting rotation of the thumb cmc joint. + */ FRotator GetCmcStartRotation() const; public: + /** + * Calculate any finger's movement rotation, using an input value. + */ float CalculateAngle(ESGFinger Finger, int32 Movement, float Value) const; + /** + * Calculate a finger movement's rotation, using an input value. + */ float CalculateAngle(ESGFinger Finger, ESGFingerMovement Movement, float Value) const; + /** + * Calculate a thumb movement's rotation, using an input value. + */ float CalculateAngle(ESGFinger Finger, ESGThumbMovement Movement, float Value) const; public: + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ void SetInterpolation(int32 Finger, int32 Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ void SetInterpolation(ESGFinger Finger, ESGFingerMovement Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ void SetInterpolation(ESGThumbMovement Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Returns an interpolationSet + */ USGInterpolationSet* GetInterpolation(UObject* Outer, int32 Finger, int32 Movement) const; public: + /** + * Check if this handInterpolator matches another. + */ bool Equals(const USGHandInterpolator* HandInterpolator) const; public: + /** + * Serialize this HandInterpolator into a string representation. + */ FString SGSerialize() const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGHandPose.h b/Source/SenseGloveCore/Public/SGCore/SGHandPose.h index a4cb7030..c35d63d0 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGHandPose.h +++ b/Source/SenseGloveCore/Public/SGCore/SGHandPose.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Data class containing all variables to draw or analyze a virtual hand + * in different formats. */ @@ -53,6 +54,9 @@ class FSGHandPoseImpl; +/** + * Contains all variables required to draw or analyze a virtual hand. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGHandPose final : public UObject { @@ -63,6 +67,9 @@ public: UObject* Outer, const FSGHandPoseImpl& HandPoseImpl); public: + /** + * Default Constructor. + */ static USGHandPose* NewHandPose(UObject* Outer); static USGHandPose* NewHandPose( @@ -70,45 +77,87 @@ public: bool bRightHanded, const TArray>& JointPositions, const TArray>& JointRotations, const TArray>& HandAngles); + /** + * Create a new instance of HandPose. + */ static USGHandPose* NewHandPose( UObject* Outer, bool bRightHanded, const TArray>& JointPositions, const TArray>& JointRotations, const TArray>& HandAngles); + /** + * Create a new instance of HandPose. + */ static USGHandPose* NewHandPose( UObject* Outer, bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); + /** + * Create a new instance of HandPose. + */ static USGHandPose* NewHandPose( UObject* Outer, bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); public: + /** + * Deserialize a HandPose back into usable values. + */ static USGHandPose* Deserialize(UObject* Outer, const FString& SerializedString); + /** + * Generate a HandPose based on articulation angles (handAngles). + */ static USGHandPose* FromHandAngles(UObject* Outer, const TArray>& HandAngles, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generate a HandPose based on articulation angles (handAngles), with a default HandModel. + */ static USGHandPose* FromHandAngles(UObject* Outer, const TArray>& HandAngles, bool bRightHanded); + /** + * Create a new instance of a left or right handed Pose that is "idle"; in a neutral position. + */ static USGHandPose* DefaultIdle(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Create a new instance of a left or right handed Pose that is "idle"; in a neutral position. + */ static USGHandPose* DefaultIdle(UObject* Outer, bool bRightHanded); + /** + * Generates a HandPose representing an 'open hand', used in calibration to determine finger extension. + */ static USGHandPose* FlatHand(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing an 'open hand', used in calibration to determine finger extension. + */ static USGHandPose* FlatHand(UObject* Outer, bool bRightHanded); + /** + * Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction. + */ static USGHandPose* ThumbsUp(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction. + */ static USGHandPose* ThumbsUp(UObject* Outer, bool bRightHanded); + /** + * Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction. + */ static USGHandPose* Fist(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction. + */ static USGHandPose* Fist(UObject* Outer, bool bRightHanded); private: @@ -123,20 +172,35 @@ private: FImplDeleter PimplDeleter; public: + /** + * Default Constructor. + */ USGHandPose(); + /** + * Create a new instance of HandPose. + */ USGHandPose(bool bRightHanded, const TArray>& JointPositions, const TArray>& JointRotations, const TArray>& HandAngles); + /** + * Create a new instance of HandPose. + */ USGHandPose(bool bRightHanded, const TArray>& JointPositions, const TArray>& JointRotations, const TArray>& HandAngles); + /** + * Create a new instance of HandPose. + */ USGHandPose(bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); + /** + * + */ USGHandPose(bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); @@ -166,25 +230,59 @@ public: const FSGHandPoseImpl& ToHandPoseImpl() const; public: + /** + * Whether this HandPose was created to be a right- or left hand. + */ bool IsRight() const; + /** + * Positions of all hand joints relative to the Sense Glove origin. From thumb to pinky, proximal to distal. + */ TArray> GetJointPositions() const; + /** + * Quaternion rotations of all hand joints. From thumb to pinky, proximal to distal. + */ TArray> GetJointRotationsQ() const; + /** + * Rotations of all hand joints. From thumb to pinky, proximal to distal. + */ TArray> GetJointRotations() const; + /** + * Euler representations of all possible hand angles. From thumb to pinky, proximal to distal. + */ TArray> GetHandAngles() const; public: + /** + * Returns true of these two hand poses are roughly equal. + */ bool Equals(const USGHandPose* HandPose) const; + /** + * Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed). + * + * @remarks Useful for animation or for detecting gestures. + */ float GetNormalizedFlexion(ESGFinger Finger, bool bClamp01 = true) const; + /** + * Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed). + * + * @remarks Useful for animation or for detecting gestures. + */ TArray GetNormalizedFlexion(bool bClamp01 = true) const; public: + /** + * + */ FString ToString(bool bShortFormat = false) const; + /** + * Serialize this HandPose into a string representation. + */ FString SGSerialize() const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGAnatomyKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGAnatomyKismetLibrary.h index 258c6a5f..58b46704 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGAnatomyKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGAnatomyKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Hard-Coded Database that is used in calibration and in solving. + * Values herein are used to limit outputs within 'natural' ranges. */ @@ -43,45 +44,84 @@ #include "SGAnatomyKismetLibrary.generated.h" +/** + * "Database" of anatomical values, such as joint limits. + */ UCLASS(meta=(ScriptName = "SesneGloveAnatomyKismetLibrary")) class SENSEGLOVECOREKISMET_API USGAnatomyKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Total sum of all finger flexion that would be considered "total flexion". + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetTotalFingerFlexion(); + /** + * Total sum of all finger flexion that would be considered "total extension". + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetTotalFingerExtension(); + /** + * Total sum of all thumb flexion that would be considered "total flexion". + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetTotalThumbFlexion(); + /** + * Total sum of all thumb flexion that would be considered "total extension". + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetTotalThumbExtension(); + /** + * Retrieve one of the limits of a finger joint's movement. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetFingerJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax); + /** + * Retrieve one of the limits of a thumb joint's movement. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float GetThumbJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax); + /** + * Convert a total finger flexion in radians into a 0..1 representation. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float NormalizeFingerFlexion(float FlexionInRadians); + /** + * Convert a total thumb flexion in radians into a 0..1 representation. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static float NormalizeThumbFlexion(float FlexionInRadians); + /** + * Get Hand Angles that would make a Default (Idle) Pose. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static TArray GetDefaultHandAngles(bool bRightHanded); + /** + * Get Hand Angles that would make a flat hand. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static TArray GetFlatHandAngles(bool bRightHanded); + /** + * Get hand angles that would make a thumbs up. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static TArray GetThumbsUpHandAngles(bool bRightHanded); + /** + * Get Hand Angles that would make a fist. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Anatomy") static TArray GetFistHandAngles(bool bRightHanded); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h index 215afb82..d4a8173a 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * A data class containing the minimum required data for a hand's forward kinematics. + * Used in both kinematics and calibration. */ @@ -43,16 +44,25 @@ class USGBasicHandModel; +/** + * Represents data of a user's hand required for forward kinematics. + */ UCLASS(meta=(ScriptName = "SesneGloveBasicHandModelKismetLibrary")) class SENSEGLOVECOREKISMET_API USGBasicHandModelKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Basic class Constructor. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) static USGBasicHandModel* MakeBasicHandModel(UObject* WorldContextObject); + /** + * Create a new BasicHandModel with no starting rotations. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Basic Hand Model", Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) @@ -60,6 +70,9 @@ public: UObject* WorldContextObject, bool bRightHanded, const TArray& Lengths, const TArray& StartPositions); + /** + * Create a new BasicHandModel. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Basic Hand Model", Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) @@ -68,6 +81,9 @@ public: bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Create a new BasicHandModel. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Basic Hand Model", Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) @@ -76,114 +92,212 @@ public: bool bRightHanded, const TArray& Lengths, const TArray& StartPositions, const TArray& StartRotations); + /** + * Retrieve a default left or right hand model. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) static USGBasicHandModel* Default(UObject* WorldContextObject, bool bRightHanded); + /** + * Convert a serialized HandModel back into its class representation. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model", meta=(WorldContext="WorldContextObject")) static USGBasicHandModel* Deserialize(UObject* WorldContextObject, const FString& SerializedString); + /** + * Default finger lengths (based on right hand). + * + * @remarks Any missing fingers are replaced with their respective value. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetBaseFingerLengths(); + /** + * Default joint positions (based on right hand). + * + * @remarks Any missing positions are replaced with their respective value. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetBaseJointPositions(); + /** + * Default joint angles (based on right hand). + * + * @remarks Any missing angles are replaced with their respective value. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetBaseJointAngles(); + /** + * Whether or not this BasicHandModel was created for a left- or right hand. Used for validation. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static bool IsRight(const USGBasicHandModel* BasicHandModel); + /** + * The length of individual finger phalangers in mm, sorted per finger. Generally 5x3. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetFingerLengths(const USGBasicHandModel* BasicHandModel); + /** + * Retrieve the finger lengths of a specific finger in cm. + */ UFUNCTION(BlueprintPure, DisplayName="Get Finger Lengths", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetFingerLengths_F(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Set the finger lengths of a specific finger in cm. + */ UFUNCTION(BlueprintCallable, DisplayName="Set Finger Lengths", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetFingerLengths_ESGFinger_F_L(UPARAM(ref) USGBasicHandModel* BasicHandModel, ESGFinger Finger, - const TArray& Lengths); + const TArray& Lengths); + /** + * Set the finger lengths of a specific finger in cm. + */ UFUNCTION(BlueprintCallable, DisplayName="Set Finger Lengths", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetFingerLengths_uint8_F_L(UPARAM(ref) USGBasicHandModel* BasicHandModel, uint8 Finger, - const TArray& Lengths); + const TArray& Lengths); + /** + * Get the finger ratios of all fingers. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") TArray GetFingerRatios(const USGBasicHandModel* BasicHandModel) const; + /** + * Get the finger ratios of a specific finger. + */ UFUNCTION(BlueprintPure, DisplayName="Get Finger Ratios", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetFingerRatios_F(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Starting joint positions relative to the device Origin. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetStartJointPositions(const USGBasicHandModel* BasicHandModel); + /** + * + */ UFUNCTION(BlueprintCallable, DisplayName="Set Start Joint Position", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetStartJointPosition_ESGFinger_F_P(UPARAM(ref) USGBasicHandModel* BasicHandModel, ESGFinger Finger, - const FVector& Position); + const FVector& Position); + /** + * + */ UFUNCTION(BlueprintPure, DisplayName="Set Start Joint Position", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetStartJointPosition_uint8_F_P(UPARAM(ref) USGBasicHandModel* BasicHandModel, uint8 Finger, - const FVector& Position); + const FVector& Position); + /** + * Starting joint rotations relative to the device Origin. + */ UFUNCTION(BlueprintPure, DisplayName="Get Start Joint Rotations", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetStartJointRotations_TArrayFQuat(const USGBasicHandModel* BasicHandModel); + /** + * Starting joint rotations relative to the device Origin. + */ UFUNCTION(BlueprintPure, DisplayName="Get Start Joint Rotations", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetStartJointRotations_TArrayFRotator(const USGBasicHandModel* BasicHandModel); + /** + * Retrieve the start position of a specific finger. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FVector GetJointPosition(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Set the start position of a specific finger. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetJointPosition(UPARAM(ref) USGBasicHandModel* BasicHandModel, const FVector& NewPosition, ESGFinger Finger); + /** + * Retrieve the start rotation of a specific finger. + */ UFUNCTION(BlueprintPure, DisplayName="Get Joint Rotation", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FQuat GetJointRotation_FQuat(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Retrieve the start rotation of a specific finger. + */ UFUNCTION(BlueprintPure, DisplayName="Get Joint Rotation", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FRotator GetJointRotation_FRotator(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Set the start rotation of a specific finger. + */ UFUNCTION(BlueprintCallable, DisplayName="Set Joint Rotation", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetJointRotation_FQuat_NR_F( UPARAM(ref) USGBasicHandModel* BasicHandModel, const FQuat& NewRotation, ESGFinger Finger); + /** + * Set the start rotation of a specific finger. + */ UFUNCTION(BlueprintCallable, DisplayName="Set Joint Rotation", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static void SetJointRotation_FRotator_NR_F( UPARAM(ref) USGBasicHandModel* BasicHandModel, const FRotator& NewRotation, ESGFinger Finger); + /** + * Get the total lengths of fingers, in cm. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray GetTotalLengths(const USGBasicHandModel* BasicHandModel); + /** + * Get the total length of a specific finger, in mm. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static float GetTotalLength(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Retrieve the lengths of a specific finger, as BasicHandModel representation (L, 0, 0). + * + * @remarks Used for forwards kinematics. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static TArray Get3DLengths(const USGBasicHandModel* BasicHandModel, ESGFinger Finger); + /** + * Check if this BasicHandModel has the same values as another BasicHandModel. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static bool Equals(const USGBasicHandModel* A, const USGBasicHandModel* B); + /** + * Convert this handModel into a string notation, readable for humans. Does not include starting positions / rotations. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FString ToString(const USGBasicHandModel* BasicHandModel); + /** + * Convert this handModel into a string notation, readable for humans. Optionally includes starting positions / rotations. + */ UFUNCTION(BlueprintPure, DisplayName="To String", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FString ToString_bLO(const USGBasicHandModel* BasicHandModel, bool bLengthsOnly); + /** + * Serialize this HandModel into a string representation. + */ UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Kinematics | Basic Hand Model") static FString SGSerialize(const USGBasicHandModel* BasicHandModel); }; \ No newline at end of file diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h index e36da2ba..190b4dea 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h @@ -29,7 +29,9 @@ * * @section DESCRIPTION * - * + * Represents a Sense Glove Device that has no specific class within the API. + * Used to test different iterations of the same product before integrating it into the Core API. + * Allows access to raw sensor values and commands of such a device. */ @@ -42,42 +44,78 @@ class USGBetaDevice; +/** + * A Device that adheres to the SenseGlove communications protocol, but which has no implementation in this API. + */ UCLASS(meta=(ScriptName = "SesneGloveBetaDeviceKismetLibrary")) class SENSEGLOVECOREKISMET_API USGBetaDeviceKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Deserialize a beta device from its basic constants string. Returns nullptr is unsuccessful. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Beta Device", meta=(WorldContext="WorldContextObject")) static USGBetaDevice* Parse(UObject* WorldContextObject, const FString& String); + /** + * Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static ESGDeviceType GetDeviceType(const USGBetaDevice* BetaDevice); + /** + * Get the unique identifier of this device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString GetDeviceId(const USGBetaDevice* BetaDevice); + /** + * Retrieve this device's hardware version. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString GetHardwareVersion(const USGBetaDevice* BetaDevice); + /** + * Retrieve this device's firmware version. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static int32 GetFirmwareVersion(const USGBetaDevice* BetaDevice); + /** + * Retrieve this device's sub-firmware version. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static int32 GetSubFirmwareVersion(const USGBetaDevice* BetaDevice); + /** + * Retrieve the constants string for additional processing. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString GetConstantsString(const USGBetaDevice* BetaDevice); + /** + * Retrieve a raw sensor string from this Beta Device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString GetSensorData(const USGBetaDevice* BetaDevice); + /** + * Retrieve the last command retrieved from this Beta Device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString GetLastCommand(const USGBetaDevice* BetaDevice); + /** + * Send a raw string command to this device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static bool SendHaptics(const USGBetaDevice* BetaDevice, const FString& Command); + /** + * Create a string representation of this device for reporting purposes. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device") static FString ToString(const USGBetaDevice* BetaDevice); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBuzzCommandKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBuzzCommandKismetLibrary.h index 1833e4fb..54041959 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBuzzCommandKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBuzzCommandKismetLibrary.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * Buzz motor command specific for the Sense Glove. */ @@ -42,38 +42,62 @@ class USGBuzzCommand; +/** + * A vibration command for the Sense Glove, with levels for each finger. + */ UCLASS(meta=(ScriptName = "SesneGloveBuzzCommandKismetLibrary")) class SENSEGLOVECOREKISMET_API USGBuzzCommandKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Basic Constructor. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* MakeBuzzCommand(UObject* WorldContextObject); + /** + * Create a new buzz motor command, where each finger level is contained inside an array of size 5. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Buzz Command", Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* MakeBuzzCommand_BL(UObject* WorldContextObject, const TArray& BuzzLevels); + /** + * Create a new Buzz Motor command, indicating the intensity for each finger. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Buzz Command", Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* MakeBuzzCommand_T_I_M_R_P(UObject* WorldContextObject, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + /** + * Create a new Buzz Motor command, with only one finger being activated. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Buzz Command", Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* MakeBuzzCommand_F_BL(UObject* WorldContextObject, ESGFinger Finger, int32 BuzzLevel); + /** + * A command that turns off all vibration motors of the Sense Glove. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* Off(UObject* WorldContextObject); + /** + * Copy this Buzz Command into a new object. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* Copy(UObject* WorldContextObject, const USGBuzzCommand* BuzzCommand); + /** + * Merge this command with another, taking the maximum value between the two. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Buzz Command", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* Merge(UObject* WorldContextObject, const USGBuzzCommand* A, const USGBuzzCommand* B); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGCalibrationDataPointKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGCalibrationDataPointKismetLibrary.h index 2c0f3f32..4d0da0ba 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGCalibrationDataPointKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGCalibrationDataPointKismetLibrary.h @@ -47,22 +47,37 @@ class SENSEGLOVECOREKISMET_API USGCalibrationDataPointKismetLibrary final : publ GENERATED_BODY() public: + /** + * + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Calibraion Data Point", meta=(WorldContext="WorldContextObject")) static USGCalibrationDataPoint* MakeCalibrationDataPoint(UObject* WorldContextObject); + /** + * Create a new data point. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Calibration Data Point", Category="SenseGlove | Core | Calibration | Calibraion Data Point", meta=(WorldContext="WorldContextObject")) static USGCalibrationDataPoint* MakeCalibrationDataPoint_CS_CV( UObject* WorldContextObject, int32 CurrentStage, const TArray& CalibrationValues); + /** + * Actual calibration values. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Calibraion Data Point") static TArray GetCalibrationValues(const USGCalibrationDataPoint* CalibrationDataPoint); + /** + * The Calibration stage this data point belongs to. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Calibraion Data Point") static int32 GetStage(const USGCalibrationDataPoint* CalibrationDataPoint); + /** + * Log Calibration values for storing on disk. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Calibraion Data Point") static FString ToLogData(const USGCalibrationDataPoint* CalibrationDataPoint, const FString& Delimiter = "\t"); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h index 59d26932..89dec9b6 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * Interface for SenseCom, allows the retrieval of Devices and Data, but only as. */ @@ -46,57 +46,104 @@ class USGDevice; +/** + * Interface for SenseCom, allows the retrieval of Devices and Data. + */ UCLASS(meta=(ScriptName = "SesneGloveDeviceListKismetLibrary")) class SENSEGLOVECOREKISMET_API USGDeviceListKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Retrieve the number of devices that have been detected by the SenseCom executable. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static int32 ActiveDevices(); + /** + * Returns true if the SenseCom program is running. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static bool SenseCommRunning(); + /** + * Clear the device list, and block any further attempt to add to it until ReInitialize is called. + * + * @remarks Useful if your IDE has troubles unloading dlls (cough, Unity, Cough). + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static void Dispose(); + /** + * When you've accidentally disposed of the list before you meant to. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static void Reinitialize(); + /** + * Retrieve all Sense Glove Devices connected to this system. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List", meta=(WorldContext="WorldContextObject")) static TArray GetDevices(UObject* WorldContextObject); + /** + * Retrieve a list of SGDevices of a specific class. + */ UFUNCTION(BlueprintCallable, DisplayName="Get Devices", Category="SenseGlove | Core | Device List", meta=(WorldContext="WorldContextObject")) static TArray GetDevices_TSubclassOfUSGDevice_DT(UObject* WorldContextObject, const TSubclassOf& DeviceType); + /** + * Retrieve a list of SGDevices of a specific type. + */ UFUNCTION(BlueprintCallable, DisplayName="Get Devices", Category="SenseGlove | Core | Device List", meta=(WorldContext="WorldContextObject")) static TArray GetDevices_ESGDeviceType_DT(UObject* WorldContextObject, ESGDeviceType DeviceType); + /** + * Retrieve the latest (raw) sensor data from a specific device in our list. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static bool GetSensorDataString(int32 IpcIndex, const FString& IpcAddress, FString& OutString); + /** + * Send a (raw) command to a specific device in the list. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static bool SendHaptics(int32 IpcIndex, const FString& IpcAddress, const FString& Commands); UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static FString GetDeviceStringAt(int32 IpcIndex, const FString& IpcAddress, int32 Index); + /** + * Retrieve Device Address. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static FString GetAddress(int32 IpcIndex, const FString& IpcAddress); + /** + * Retieve this device's connectionType. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static ESGConnectionType GetConnectionType(int32 IpcIndex, const FString& IpcAddress); + /** + * Returns true if the device at this connection side is properly connected. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static bool IsConnected(int32 IpcIndex, const FString& IpcAddress); + /** + * Retrieve the device's Packets per Second Variable. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static int32 PacketsPerSecondReceived(int32 IpcIndex, const FString& IpcAddress); + /** + * Retrieve the device's Packets per Second sent Variable. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List") static int32 PacketsPerSecondSent(int32 IpcIndex, const FString& IpcAddress); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceModelKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceModelKismetLibrary.h index 8d7ba07b..3bdf6135 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceModelKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceModelKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Base class for Device Models containing the minimum amount of data gathered + * through Communications Protocol. Used for shared functionality. */ @@ -45,36 +46,60 @@ class USGDeviceModel; +/** + * Base class containing the minimum amount of data for device models. + */ UCLASS(meta=(ScriptName = "SesneGloveDeviceModelKismetLibrary")) class SENSEGLOVECOREKISMET_API USGDeviceModelKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Empty constructor to be used by child classes. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device Model", meta=(WorldContext="WorldContextObject")) static USGDeviceModel* MakeDeviceModel(UObject* WorldContextObject); + /** + * + */ UFUNCTION(BlueprintCallable, DisplayName="Make Device Model", Category="SenseGlove | Core | Device Model", meta=(WorldContext="WorldContextObject")) static USGDeviceModel* MakeDeviceModel_I_HV_FV_SFV( UObject* WorldContextObject, const FString& Id, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion); + /** + * Parse a 32-bit integer value into a set of booleans (010010011) that indicate which (optional) functions this device has. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device Model") static TArray ParseFunctions(int32 Value, int32 Size); UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device Model") static void ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion); + /** + * Retrieve the Unique identifier of this device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Device Model") static FString GetDeviceId(const USGDeviceModel* DeviceModel); + /** + * Retrieve the Hardware (sub) version of this Sense Glove Device. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Device Model") static FString GetHardwareVersion(const USGDeviceModel* DeviceModel); + /** + * Firmware version running on the device's MicroController. (as v4.12, this is the 4). + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Device Model") static int32 GetFirmwareVersion(const USGDeviceModel* DeviceModel); + /** + * Sub firmware version running on the device's microcontroller (as v4.12, this is the 12). + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Device Model") static int32 GetSubFirmwareVersion(const USGDeviceModel* DeviceModel); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGFingerCommandKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGFingerCommandKismetLibrary.h index 2ac5a50a..682d3068 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGFingerCommandKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGFingerCommandKismetLibrary.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * A command for five fingers that can be sent to a Sense Glove device. */ @@ -41,24 +41,42 @@ class USGFingerCommand; +/** + * A command that contains values (levels) for five fingers. + */ UCLASS(meta=(ScriptName = "SesneGloveFingerCommandKismetLibrary")) class SENSEGLOVECOREKISMET_API USGFingerCommandKismetLibrary : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Finger Command") static TArray GetLevels(const USGFingerCommand* FingerCommand); + /** + * + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Finger Command") static int32 GetLevel(const USGFingerCommand* FingerCommand, int32 Finger); + /** + * + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Finger Command") static void SetLevel(USGFingerCommand* FingerCommand, int32 Finger, int32 Value); + /** + * Check if this command contains the same values as another. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Finger Command") static bool Equals(const USGFingerCommand* A, const USGFingerCommand* B); + /** + * Create a string representation of this finger command. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Finger Command") static FString ToString(const USGFingerCommand* FingerCommand); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGForceFeedbackCommandKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGForceFeedbackCommandKismetLibrary.h index 454c6382..edbe8662 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGForceFeedbackCommandKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGForceFeedbackCommandKismetLibrary.h @@ -29,7 +29,7 @@ * * @section DESCRIPTION * - * + * A command for five fingers that can be sent to a Sense Glove device. */ @@ -42,45 +42,69 @@ class USGForceFeedbackCommand; +/** + * A Force-Feedback command for the Sense Glove, with levels for each finger. + */ UCLASS(meta=(ScriptName = "SesneGloveForceFeedbackCommandKismetLibrary")) class SENSEGLOVECOREKISMET_API USGForceFeedbackCommandKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Empty constructor for internal initialization. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* MakeForceFeedbackCommand(UObject* WorldContextObject); + /** + * Create a new Force-Feedback Command, with levels for each finger stored in an int[5] array. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Force Feedback Command", Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* MakeForceFeedbackCommand_FFL( UObject* WorldContextObject, const TArray& ForceFeedbackLevels); + /** + * Create a new Force-Feedback Command, with levels for each finger. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Force Feedback Command", Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* MakeForceFeedbackCommand_T_I_M_R_P( UObject* WorldContextObject, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky); + /** + * Create a new Force-Feedback command, with only one finger being activated. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Force Feedback Command", Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* MakeForceFeedbackCommand_F_BL( UObject* WorldContextObject, ESGFinger Finger, int32 BuzzLevel); + /** + * A command that turns off all force feedback on the Sense Glove. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* Off(UObject* WorldContextObject); + /** + * Copy this ForceFeedback Command into a new object. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* Copy(UObject* WorldContextObject, const USGForceFeedbackCommand* ForceFeedbackCommand); + /** + * Merge this finger command with another, taking the maximum value between the two. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Force Feedback Command", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* Merge(UObject* WorldContextObject, const USGForceFeedbackCommand* A, const USGForceFeedbackCommand* B); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandInterpolatorKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandInterpolatorKismetLibrary.h index b0b5423c..985632f9 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandInterpolatorKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandInterpolatorKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Contains interpolation sets for all hand joint movements that can be + * calculated using the Sense Glove. */ @@ -44,109 +45,175 @@ class USGHandInterpolator; +/** + * Contains interpolation sets of all joint movements that can be calculated into a HandPose. + */ UCLASS(meta=(ScriptName = "SesneGloveHandInterpolatorKismetLibrary")) class SENSEGLOVECOREKISMET_API USGHandInterpolatorKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Basic Constructor. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* MakeHandInterpolator(UObject* WorldContextObject); + /** + * Create a new basic HandInterpolator without a starting rotation. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Hand Interpolator", Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* MakeHandInterpolator_JI( UObject* WorldContextObject, const TArray& JointInterpolations); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Hand Interpolator", Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* MakeHandInterpolator_JI_FQuat_CSR( UObject* WorldContextObject, const TArray& JointInterpolations, const FQuat& CmcStartRotation); + /** + * Create a new basic HandInterpolator with a starting rotation. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Hand Interpolator", Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* MakeHandInterpolator_JI_FRotator_CSR( UObject* WorldContextObject, const TArray& JointInterpolations, const FRotator& CmcStartRotation); + /** + * Create a default instance of a left- or right handed interpolator. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* Default(UObject* WorldContextObject, bool bRightHanded); + /** + * Convert a serialized HandInterpolator back into a class representation. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGHandInterpolator* Deserialize(UObject* WorldContextObject, const FString& SerializedString); + /** + * Calculate all angles of a specific finger based on an Interpolator and input angles. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator") static TArray InterpolateFingerAngles(ESGFinger Finger, const USGHandInterpolator* Interpolator, const FVector& TotalGloveAngles); + /** + * Calculate all angles of the Thumb based on an Interpolator and input angles. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator") static TArray InterpolateThumbAngles(const USGHandInterpolator* Interpolator, const FVector& TotalGloveAngles); + /** + * Calculate all hand angles based on an interpolator and total xyz angles. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Hand Interpolator") static TArray InterpolateHandAngles(const USGHandInterpolator* Interpolator, const TArray& TotalAngles); + /** + * Interpolation sets for each finger. First index indicates which finger, Second index indicates the joint movement. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) TArray GetJointInterpolations( UObject* WorldContextObject, const USGHandInterpolator* HandInterpolator) const; + /** + * Starting rotation of the thumb cmc joint. + */ UFUNCTION(BlueprintPure, DisplayName="Get Cmc Start Rotation", Category="SenseGlove | Core | Kinematics | Hand Interpolator") FQuat GetCmcStartRotation_FQuat(const USGHandInterpolator* HandInterpolator) const; + /** + * Starting rotation of the thumb cmc joint. + */ UFUNCTION(BlueprintPure, DisplayName="Get Cmc Start Rotation", Category="SenseGlove | Core | Kinematics | Hand Interpolator") FRotator GetCmcStartRotation_FRotator(const USGHandInterpolator* HandInterpolator) const; + /** + * Calculate any finger's movement rotation, using an input value. + */ UFUNCTION(BlueprintPure, DisplayName="CalculateAngle", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static float CalculateAngle_F_int32_M_V(const USGHandInterpolator* HandInterpolator, ESGFinger Finger, int32 Movement, float Value); + /** + * Calculate a finger movement's rotation, using an input value. + */ UFUNCTION(BlueprintPure, DisplayName="CalculateAngle", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static float CalculateAngle_F_ESGFingerMovement_M_V(const USGHandInterpolator* HandInterpolator, ESGFinger Finger, ESGFingerMovement Movement, float Value); + /** + * Calculate a thumb movement's rotation, using an input value. + */ UFUNCTION(BlueprintPure, DisplayName="CalculateAngle", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static float CalculateAngle_F_ESGThumbMovement_M_V(const USGHandInterpolator* HandInterpolator, ESGFinger Finger, ESGThumbMovement Movement, float Value); + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ UFUNCTION(BlueprintCallable, DisplayName="SetInterpolation", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static void SetInterpolation_int32_F_int32_M_IA0_IA1_AA0_AA1( UPARAM(ref) USGHandInterpolator* HandInterpolator, int32 Finger, int32 Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ UFUNCTION(BlueprintCallable, DisplayName="SetInterpolation", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static void SetInterpolation_ESGFinger_F_ESGFingerMovement_M_IA0_IA1_AA0_AA1( UPARAM(ref) USGHandInterpolator* HandInterpolator, ESGFinger Finger, ESGFingerMovement Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Updates a particular joint movement interpolation, without changing its limits. + */ UFUNCTION(BlueprintCallable, DisplayName="SetInterpolation", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static void SetInterpolation_M_IA0_IA1_AA0_AA1( UPARAM(ref) USGHandInterpolator* HandInterpolator, ESGThumbMovement Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1); + /** + * Returns an interpolationSet + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Hand Interpolator", meta=(WorldContext="WorldContextObject")) static USGInterpolationSet* GetInterpolation( UObject* WorldContextObject, const USGHandInterpolator* HandInterpolator, int32 Finger, int32 Movement); + /** + * Check if this handInterpolator matches another. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Hand Interpolator") static bool Equals(const USGHandInterpolator* A, const USGHandInterpolator* B); + /** + * Serialize this HandInterpolator into a string representation. + */ UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Kinematics | Hand Interpolator") static FString SGSerialize(const USGHandInterpolator* HandInterpolator); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h index c5bc96af..fa63e542 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * + * Data class containing all variables to draw or analyze a virtual hand + * in different formats. */ @@ -46,15 +47,24 @@ class USGBasicHandModel; class USGHandPose; +/** + * Contains all variables required to draw or analyze a virtual hand. + */ UCLASS(meta=(ScriptName = "SesneGloveHandPoseKismetLibrary")) class SENSEGLOVECOREKISMET_API USGHandPoseKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Default Constructor. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* MakeHandPose(UObject* WorldContextObject); + /** + * Create a new instance of HandPose. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Hand Pose", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* MakeHandPose_bRH_JP_FSGQuatArray_JR_HA( @@ -62,6 +72,9 @@ public: bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); + /** + * Create a new instance of HandPose. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Hand Pose", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* MakeHandPose_bRH_JP_FSGRotatorArray_JR_HA( @@ -69,83 +82,150 @@ public: bool bRightHanded, const TArray& JointPositions, const TArray& JointRotations, const TArray& HandAngles); + /** + * Deserialize a HandPose back into usable values. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* Deserialize(UObject* WorldContextObject, const FString& SerializedString); + /** + * Generate a HandPose based on articulation angles (handAngles). + */ UFUNCTION(BlueprintCallable, DisplayName="From Hand Angles", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* FromHandAngles_HA_bRH_HD( UObject* WorldContextObject, const TArray& HandAngles, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generate a HandPose based on articulation angles (handAngles), with a default HandModel. + */ UFUNCTION(BlueprintCallable, DisplayName="From Hand Angles", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* FromHandAngles_HA_bRH(UObject* WorldContextObject, const TArray& HandAngles, bool bRightHanded); + /** + * Create a new instance of a left or right handed Pose that is "idle"; in a neutral position. + */ UFUNCTION(BlueprintCallable, DisplayName="Default Idle", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* DefaultIdle_bRH_HD(UObject* WorldContextObject, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Create a new instance of a left or right handed Pose that is "idle"; in a neutral position. + */ UFUNCTION(BlueprintCallable, DisplayName="Default Idle", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* DefaultIdle_bRH(UObject* WorldContextObject, bool bRightHanded); + /** + * Generates a HandPose representing an 'open hand', used in calibration to determine finger extension. + */ UFUNCTION(BlueprintCallable, DisplayName="Flat Hand", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* FlatHand_bRH_HD(UObject* WorldContextObject, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing an 'open hand', used in calibration to determine finger extension. + */ UFUNCTION(BlueprintCallable, DisplayName="Flat Hand", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* FlatHand_bRH(UObject* WorldContextObject, bool bRightHanded); + /** + * Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction. + */ UFUNCTION(BlueprintCallable, DisplayName="Thumbs Up", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* ThumbsUp_bRH_HD(UObject* WorldContextObject, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction. + */ UFUNCTION(BlueprintCallable, DisplayName="Thumbs Up", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* ThumbsUp_bRH(UObject* WorldContextObject, bool bRightHanded); + /** + * Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction. + */ UFUNCTION(BlueprintCallable, DisplayName="Fist", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* Fist_bRH_HD(UObject* WorldContextObject, bool bRightHanded, const USGBasicHandModel* HandDimensions); + /** + * Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction. + */ UFUNCTION(BlueprintCallable, DisplayName="Fist", Category="SenseGlove | Core | Hand Pose", meta=(WorldContext="WorldContextObject")) static USGHandPose* Fist_bRH(UObject* WorldContextObject, bool bRightHanded); + /** + * Whether this HandPose was created to be a right- or left hand. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Pose") static bool IsRight(const USGHandPose* HandPose); + /** + * Positions of all hand joints relative to the Sense Glove origin. From thumb to pinky, proximal to distal. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Pose") static TArray GetJointPositions(const USGHandPose* HandPose); + /** + * Quaternion rotations of all hand joints. From thumb to pinky, proximal to distal. + */ UFUNCTION(BlueprintPure, DisplayName="Get Joint Rotations", Category="SenseGlove | Core | Hand Pose") static TArray GetJointRotationsQ(const USGHandPose* HandPose); + /** + * Rotations of all hand joints. From thumb to pinky, proximal to distal. + */ UFUNCTION(BlueprintPure, DisplayName="Get Joint Rotations", Category="SenseGlove | Core | Hand Pose") static TArray GetJointRotations(const USGHandPose* HandPose); + /** + * Euler representations of all possible hand angles. From thumb to pinky, proximal to distal. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Pose") static TArray GetHandAngles(const USGHandPose* HandPose); + /** + * Returns true of these two hand poses are roughly equal. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Pose") static bool Equals(const USGHandPose* A, const USGHandPose* B); + /** + * Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed). + * + * @remarks Useful for animation or for detecting gestures. + */ UFUNCTION(BlueprintPure, DisplayName="Get Normalized Flexion", Category="SenseGlove | Core | Hand Pose") static float GetNormalizedFlexion_F_bC01(const USGHandPose* HandPose, ESGFinger Finger, bool bClamp01 = true); + /** + * Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed). + * + * @remarks Useful for animation or for detecting gestures. + */ UFUNCTION(BlueprintPure, DisplayName="Get Normalized Flexion", Category="SenseGlove | Core | Hand Pose") static TArray GetNormalizedFlexion_bC01(const USGHandPose* HandPose, bool bClamp01 = true); + /** + * + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Hand Pose") static FString ToString(const USGHandPose* HandPose, bool bShortFormat = false); + /** + * Serialize this HandPose into a string representation. + */ UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Hand Pose") static FString SGSerialize(const USGHandPose* HandPose); -}; \ No newline at end of file +};