add more documentation

This commit is contained in:
Mamadou Babaei
2022-11-18 15:03:19 +01:00
parent e79138acae
commit c1dd1fa7b0
13 changed files with 297 additions and 18 deletions
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* A data class containing the minimum required data for a hand's forward kinematics. * A data class containing the minimum required data for a hand's forward
* kinematics.
* Used in both kinematics and calibration. * Used in both kinematics and calibration.
*/ */
@@ -30,7 +30,8 @@
* @section DESCRIPTION * @section DESCRIPTION
* *
* Represents a Sense Glove Device that has no specific class within the API. * 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. * 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. * Allows access to raw sensor values and commands of such a device.
*/ */
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* Interface for SenseCom, allows the retrieval of Devices and Data, but only as. * Interface for SenseCom, allows the retrieval of Devices and Data, but only
* as.
*/ */
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback. * An interface for any of our gloves that can track hand motion and/or send
* force / vibrotactile feedback.
*/ */
@@ -29,7 +29,6 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
*
*/ */
@@ -53,6 +52,9 @@
class FSGHapticGloveCalibrationSequenceImpl; class FSGHapticGloveCalibrationSequenceImpl;
class FSGHapticGloveQuickCalibrationImpl; class FSGHapticGloveQuickCalibrationImpl;
/**
* A sequence which collects data points until specific criteria have been met. It must be 'fed' an Update command from your program in order to work.
*/
UCLASS(BlueprintType) UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCalibrationSequence : public UObject class SENSEGLOVECORE_API USGHapticGloveCalibrationSequence : public UObject
{ {
@@ -66,16 +68,28 @@ public:
UObject* Outer, TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequence); UObject* Outer, TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequence);
protected: protected:
/**
*
*/
static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(UObject* Outer); static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(UObject* Outer);
public: public:
/**
* Create a new instance of a base HapitcGlove Calibration Sequence.
*/
static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence( static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(
UObject* Outer, const USGHapticGlove* LinkedGlove); UObject* Outer, const USGHapticGlove* LinkedGlove);
public: public:
/**
* The maximum buffer size for calibration points. Once calibrationPoints exceeds this value, the
*/
static int32 GetMaxDataPoints(); static int32 GetMaxDataPoints();
public: public:
/**
* Converts a calibration range taken from a Calibration sequence, and converts it into a profile. Use this if you're not actually using the sequence.
*/
static bool CompileProfile(UObject* Outer, static bool CompileProfile(UObject* Outer,
const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded, const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded,
USGHandProfile*& OutProfile); USGHandProfile*& OutProfile);
@@ -92,9 +106,15 @@ private:
FImplDeleter PimplDeleter; FImplDeleter PimplDeleter;
protected: protected:
/**
*
*/
USGHapticGloveCalibrationSequence(); USGHapticGloveCalibrationSequence();
public: public:
/**
* Create a new instance of a base HapitcGlove Calibration Sequence.
*/
explicit USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove); explicit USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove);
public: public:
@@ -172,41 +192,96 @@ protected:
virtual void SyncUProperties(); virtual void SyncUProperties();
public: public:
/**
* Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called.
*/
USGHapticGlove* GetLinkedGlove(UObject* Outer) const; USGHapticGlove* GetLinkedGlove(UObject* Outer) const;
/**
*
*/
void SetLinkedGlove(const USGHapticGlove* LinkedGlove); void SetLinkedGlove(const USGHapticGlove* LinkedGlove);
/**
* Calibration points collected during this calibration process. One is added every time the "Update()" function is called.
* Used to create a profile after the calibration finishes.
*/
TArray<USGCalibrationDataPoint*> GetCalibrationPoints(UObject* Outer) const; TArray<USGCalibrationDataPoint*> GetCalibrationPoints(UObject* Outer) const;
/**
* How much time has elapsed during this calibration sequence. Useful for logging or for automated functions.
*/
float GetElapsedTime() const; float GetElapsedTime() const;
/**
* Used to determine if the user has manually ended the sequence, to prevent us from adding any more calibration points.
*/
bool IsManuallyCompleted() const; bool IsManuallyCompleted() const;
/**
* If a sequence consists of multiple stages, this integer will show you which one is currently active.
*/
int32 GetCurrentStage() const; int32 GetCurrentStage() const;
/**
* Returns the amount of calibration points collected so far.
*/
SIZE_T GetCalibrationPointsCount() const; SIZE_T GetCalibrationPointsCount() const;
/**
* Whether or not this sequence was completed as per its own rules.
*/
bool AutoCompleted() const; bool AutoCompleted() const;
/**
* Returns true if this sequence is marked as 'complete' and can begin compiling a profile.
*/
bool Completed() const; bool Completed() const;
public: public:
/**
* Resets this calibration sequence's data, but not it's LinkedGlove.
*/
void Reset(); void Reset();
/**
*
*/
void AddDataPoint(const TArray<FVector>& CalibrationPoints); void AddDataPoint(const TArray<FVector>& CalibrationPoints);
/**
* Update this calibration sequence with new data. We use deltaSeconds to check for things like stability.
*/
void Update(float DeltaSeconds); void Update(float DeltaSeconds);
/**
* Manual confirmation of whatever step we're supposed to making at the moment.
*/
void ConfirmCurrentStep(); void ConfirmCurrentStep();
public: public:
/**
* Compile a min/max range from the data points collected by this sequence. Returns true if it's actually possible.
*/
bool CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const; bool CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const;
/**
* Compile a profile from the data points collected by this sequence. Returns true if it's actually possible.
*/
bool CompileProfile(UObject* Outer, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile) const; bool CompileProfile(UObject* Outer, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile) const;
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
bool GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const; bool GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const;
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
bool GetHandPose(UObject* Outer, bool bRightHanded, USGHandPose*& OutCurrentHandPose) const; bool GetHandPose(UObject* Outer, bool bRightHanded, USGHandPose*& OutCurrentHandPose) const;
/**
* Retrieve instructions on what to do during the current step.
*/
FString GetCurrentInstruction(const FString& NextStepKey = FString{""}) const; FString GetCurrentInstruction(const FString& NextStepKey = FString{""}) const;
}; };
@@ -50,6 +50,9 @@ class USGBuzzCommand;
class USGForceFeedbackCommand; class USGForceFeedbackCommand;
class USGTimedBuzzCommand; class USGTimedBuzzCommand;
/**
*
*/
UCLASS(BlueprintType) UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCommandBuffer final : public UObject class SENSEGLOVECORE_API USGHapticGloveCommandBuffer final : public UObject
{ {
@@ -60,13 +63,25 @@ public:
UObject* Outer, const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl); UObject* Outer, const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl);
public: public:
/**
* Create a new HapticsStream for a Haptic Glove.
*/
static USGHapticGloveCommandBuffer* NewHapticGloveCommandBuffer(UObject* Outer); static USGHapticGloveCommandBuffer* NewHapticGloveCommandBuffer(UObject* Outer);
public: public:
/**
* The base maximum amount of Force-Feedback Commands that can be in a queue.
*/
static int32 GetMaxForceFeedbackCommands(); static int32 GetMaxForceFeedbackCommands();
/**
* The base maximum amount of Vibrotactile Commands that can be in a queue.
*/
static int32 GetMaxBuzzCommands(); static int32 GetMaxBuzzCommands();
/**
* The base maximum amount of Thumper Commands that can be in a queue.
*/
static int32 GetMaxThumpCommands(); static int32 GetMaxThumpCommands();
private: private:
@@ -81,6 +96,9 @@ private:
FImplDeleter PimplDeleter; FImplDeleter PimplDeleter;
public: public:
/**
*
*/
USGHapticGloveCommandBuffer(); USGHapticGloveCommandBuffer();
public: public:
@@ -108,38 +126,83 @@ public:
const FSGHapticGloveCommandBufferImpl& ToHapticGloveCommandBufferImpl() const; const FSGHapticGloveCommandBufferImpl& ToHapticGloveCommandBufferImpl() const;
public: public:
/**
* All Force Feedback Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGForceFeedbackCommand*> GetForceFeedbackCommandsQueue(UObject* Outer) const; TArray<USGForceFeedbackCommand*> GetForceFeedbackCommandsQueue(UObject* Outer) const;
/**
* All Timed Buzz Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGTimedBuzzCommand*> GetBuzzCommandsQueue(UObject* Outer) const; TArray<USGTimedBuzzCommand*> GetBuzzCommandsQueue(UObject* Outer) const;
/**
* All Timed Thump Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGTimedThumpCommand*> GetThumperCommandsQueue(UObject* Outer) const; TArray<USGTimedThumpCommand*> GetThumperCommandsQueue(UObject* Outer) const;
public: public:
/**
* Clears only the Force-Feedback Queue.
*/
void ClearForceFeedbackCommandsQueue(); void ClearForceFeedbackCommandsQueue();
/**
* Clears all vibrations in the queue(s).
*/
void ClearVibrations(); void ClearVibrations();
/**
* Clear all ongoing effects to this stream.
*/
void Clear(); void Clear();
/**
* Add a new Force-Feedback command to the queue. Does not actually send it.
*/
void AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand); void AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Add a new vibrotactile command to the queue. Does not actually send it.
*/
void AddCommand(const USGTimedBuzzCommand* BuzzCommand); void AddCommand(const USGTimedBuzzCommand* BuzzCommand);
/**
* Add a new Thumper command to the queue. Does not actually send it. Does not work with SenseGlove, only for Nova's
*/
void AddCommand(const USGTimedThumpCommand* ThumpCommand); void AddCommand(const USGTimedThumpCommand* ThumpCommand);
/**
* Update the active commands, using a deltaSeconds since last update, in seconds. Any timedCommands that are elapsed will be removed from the list.
*/
void UpdateTimedCommands(float DeltaSeconds); void UpdateTimedCommands(float DeltaSeconds);
public: public:
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. Returns lastForceFeedbackCommand if no ForceFeedback commands are given.
*/
USGForceFeedbackCommand* GetTotalForceFeedbackLevels( USGForceFeedbackCommand* GetTotalForceFeedbackLevels(
UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const; UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const;
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue.
*/
USGForceFeedbackCommand* GetTotalForceFeedbackLevels(UObject* Outer) const; USGForceFeedbackCommand* GetTotalForceFeedbackLevels(UObject* Outer) const;
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
USGBuzzCommand* GetTotalBuzzLevels(UObject* Outer) const; USGBuzzCommand* GetTotalBuzzLevels(UObject* Outer) const;
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
USGThumperCommand* GetTotalThumperLevels(UObject* Outer) const; USGThumperCommand* GetTotalThumperLevels(UObject* Outer) const;
public: public:
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Only clears the ForceFeedback queue, and only if you want it to.
*/
void FlushHaptics(UObject* Outer, void FlushHaptics(UObject* Outer,
const USGForceFeedbackCommand* LastBrakeLevel, const USGForceFeedbackCommand* LastBrakeLevel,
USGForceFeedbackCommand*& OutForceFeedbackCommand, USGForceFeedbackCommand*& OutForceFeedbackCommand,
@@ -147,6 +210,9 @@ public:
USGThumperCommand*& OutThumperCommand, USGThumperCommand*& OutThumperCommand,
bool bClearForceFeedbackQueue = true); bool bClearForceFeedbackQueue = true);
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Also updates & clears all queues.
*/
void FlushHaptics(UObject* Outer, void FlushHaptics(UObject* Outer,
float DeltaSeconds, float DeltaSeconds,
const USGForceFeedbackCommand* LastBrakeLevel, const USGForceFeedbackCommand* LastBrakeLevel,
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* A data class containing the minimum required data for a hand's forward kinematics. * A data class containing the minimum required data for a hand's forward
* kinematics.
* Used in both kinematics and calibration. * Used in both kinematics and calibration.
*/ */
@@ -30,7 +30,8 @@
* @section DESCRIPTION * @section DESCRIPTION
* *
* Represents a Sense Glove Device that has no specific class within the API. * 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. * 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. * Allows access to raw sensor values and commands of such a device.
*/ */
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* Interface for SenseCom, allows the retrieval of Devices and Data, but only as. * Interface for SenseCom, allows the retrieval of Devices and Data, but only
* as.
*/ */
@@ -29,8 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* Data class containing all variables to draw or analyze a virtual hand * Data class containing all variables to draw or analyze a virtual hand in
* in different formats. * different formats.
*/ */
@@ -47,12 +47,18 @@ class USGHapticGlove;
class USGHapticGloveCalibrationSequence; class USGHapticGloveCalibrationSequence;
class USGSensorRange; class USGSensorRange;
/**
* A sequence which collects data points until specific criteria have been met. It must be 'fed' an Update command from your program in order to work.
*/
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCalibrationSequenceKismetLibrary")) UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCalibrationSequenceKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveCalibrationSequenceKismetLibrary final : public USGBlueprintFunctionLibrary class SENSEGLOVECOREKISMET_API USGHapticGloveCalibrationSequenceKismetLibrary final : public USGBlueprintFunctionLibrary
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/**
* Create a new instance of a base HapitcGlove Calibration Sequence.
*/
UFUNCTION(BlueprintCallable, DisplayName="Make Haptic Glove Calibration Sequence", UFUNCTION(BlueprintCallable, DisplayName="Make Haptic Glove Calibration Sequence",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
@@ -60,9 +66,15 @@ public:
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGlove* GloveToCalibrate); const USGHapticGlove* GloveToCalibrate);
/**
* The maximum buffer size for calibration points. Once calibrationPoints exceeds this value, the
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static int32 GetMaxDataPoints(); static int32 GetMaxDataPoints();
/**
* Converts a calibration range taken from a Calibration sequence, and converts it into a profile. Use this if you're not actually using the sequence.
*/
UFUNCTION(BlueprintCallable, DisplayName="CompileProfile", UFUNCTION(BlueprintCallable, DisplayName="CompileProfile",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
@@ -70,59 +82,105 @@ public:
UObject* WorldContextObject, UObject* WorldContextObject,
const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile); const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile);
/**
* Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static USGHapticGlove* GetLinkedGlove(UObject* WorldContextObject, static USGHapticGlove* GetLinkedGlove(UObject* WorldContextObject,
const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
*
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static void SetLinkedGlove(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, static void SetLinkedGlove(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
const USGHapticGlove* LinkedGlove); const USGHapticGlove* LinkedGlove);
/**
* Calibration points collected during this calibration process. One is added every time the "Update()" function is called.
* Used to create a profile after the calibration finishes.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static TArray<USGCalibrationDataPoint*> GetCalibrationPoints( static TArray<USGCalibrationDataPoint*> GetCalibrationPoints(
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static float GetElapsedTime(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static float GetElapsedTime(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Used to determine if the user has manually ended the sequence, to prevent us from adding any more calibration points.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static bool IsManuallyCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static bool IsManuallyCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* If a sequence consists of multiple stages, this integer will show you which one is currently active.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static int32 GetCurrentStage(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static int32 GetCurrentStage(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Returns the amount of calibration points collected so far.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static int64 GetCalibrationPointsCount(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static int64 GetCalibrationPointsCount(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Whether or not this sequence was completed as per its own rules.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static bool AutoCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static bool AutoCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Returns true if this sequence is marked as 'complete' and can begin compiling a profile.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static bool Completed(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static bool Completed(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Resets this calibration sequence's data, but not it's LinkedGlove.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static void Reset(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static void Reset(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
*
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static void AddDataPoint(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, static void AddDataPoint(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
const TArray<FVector>& CalibrationData); const TArray<FVector>& CalibrationData);
/**
* Update this calibration sequence with new data. We use deltaSeconds to check for things like stability.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static void Update(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, static void Update(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
float DeltaSeconds); float DeltaSeconds);
/**
* Manual confirmation of whatever step we're supposed to making at the moment.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static void ConfirmCurrentStep(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); static void ConfirmCurrentStep(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence);
/**
* Compile a min/max range from the data points collected by this sequence. Returns true if it's actually possible.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static bool CompileRange(UObject* WorldContextObject, static bool CompileRange(UObject* WorldContextObject,
const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
USGSensorRange*& OutSensorRange); USGSensorRange*& OutSensorRange);
/**
* Compile a profile from the data points collected by this sequence. Returns true if it's actually possible.
*/
UFUNCTION(BlueprintPure, DisplayName="CompileProfile", UFUNCTION(BlueprintPure, DisplayName="CompileProfile",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
@@ -131,6 +189,9 @@ public:
const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile); ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile);
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose", UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
@@ -138,6 +199,9 @@ public:
const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
USGHandPose*& OutCurrentHandPose); USGHandPose*& OutCurrentHandPose);
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose", UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose",
Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
@@ -147,6 +211,9 @@ public:
bool bRightHanded, bool bRightHanded,
USGHandPose*& OutCurrentHandPose); USGHandPose*& OutCurrentHandPose);
/**
* Retrieve instructions on what to do during the current step.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence")
static FString GetCurrentInstruction(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, static FString GetCurrentInstruction(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence,
const FString& NextStepKey = ""); const FString& NextStepKey = "");
@@ -47,71 +47,119 @@ class USGThumperCommand;
class USGTimedBuzzCommand; class USGTimedBuzzCommand;
class USGTimedThumpCommand; class USGTimedThumpCommand;
/**
*
*/
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCommandBufferKismetLibrary")) UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCommandBufferKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveCommandBufferKismetLibrary final : public USGBlueprintFunctionLibrary class SENSEGLOVECOREKISMET_API USGHapticGloveCommandBufferKismetLibrary final : public USGBlueprintFunctionLibrary
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/**
* Create a new HapticsStream for a Haptic Glove.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static USGHapticGloveCommandBuffer* MakeHapticGloveCommandBuffer(UObject* WorldContextObject); static USGHapticGloveCommandBuffer* MakeHapticGloveCommandBuffer(UObject* WorldContextObject);
/**
* The base maximum amount of Force-Feedback Commands that can be in a queue.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static int32 GetMaxForceFeedbackCommands(); static int32 GetMaxForceFeedbackCommands();
/**
* The base maximum amount of Vibrotactile Commands that can be in a queue.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static int32 GetMaxBuzzCommands(); static int32 GetMaxBuzzCommands();
/**
* The base maximum amount of Thumper Commands that can be in a queue.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static int32 GetMaxThumpCommands(); static int32 GetMaxThumpCommands();
/**
* All Force Feedback Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static TArray<USGForceFeedbackCommand*> GetForceFeedbackCommandsQueue( static TArray<USGForceFeedbackCommand*> GetForceFeedbackCommandsQueue(
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* All Timed Buzz Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static TArray<USGTimedBuzzCommand*> GetBuzzCommandsQueue( static TArray<USGTimedBuzzCommand*> GetBuzzCommandsQueue(
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* All Timed Thump Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static TArray<USGTimedThumpCommand*> GetThumperCommandsQueue( static TArray<USGTimedThumpCommand*> GetThumperCommandsQueue(
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Clears only the Force-Feedback Queue.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void ClearForceFeedbackCommandsQueue(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); static void ClearForceFeedbackCommandsQueue(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Clears all vibrations in the queue(s).
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void ClearVibrations(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); static void ClearVibrations(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Clear all ongoing effects to this stream.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void Clear(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); static void Clear(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Add a new Force-Feedback command to the queue. Does not actually send it.
*/
UFUNCTION(BlueprintCallable, DisplayName="Add Command", UFUNCTION(BlueprintCallable, DisplayName="Add Command",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void AddCommand_ForceFeedbackCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, static void AddCommand_ForceFeedbackCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer,
const USGForceFeedbackCommand* ForceFeedbackCommand); const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Add a new vibrotactile command to the queue. Does not actually send it.
*/
UFUNCTION(BlueprintCallable, DisplayName="Add Command", UFUNCTION(BlueprintCallable, DisplayName="Add Command",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void AddCommand_BuzzCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, static void AddCommand_BuzzCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer,
const USGTimedBuzzCommand* BuzzCommand); const USGTimedBuzzCommand* BuzzCommand);
/**
* Add a new Thumper command to the queue. Does not actually send it. Does not work with SenseGlove, only for Nova's
*/
UFUNCTION(BlueprintCallable, DisplayName="Add Command", UFUNCTION(BlueprintCallable, DisplayName="Add Command",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void AddCommand_ThumpCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, static void AddCommand_ThumpCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer,
const USGTimedThumpCommand* ThumpCommand); const USGTimedThumpCommand* ThumpCommand);
/**
* Update the active commands, using a deltaSeconds since last update, in seconds. Any timedCommands that are elapsed will be removed from the list.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer")
static void UpdateTimedCommands(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, static void UpdateTimedCommands(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer,
float DeltaSeconds); float DeltaSeconds);
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. Returns lastForceFeedbackCommand if no ForceFeedback commands are given.
*/
UFUNCTION(BlueprintPure, DisplayName="Get Total Force Feedback Levels", UFUNCTION(BlueprintPure, DisplayName="Get Total Force Feedback Levels",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject"))
static USGForceFeedbackCommand* GetTotalForceFeedbackLevels_LastForceFeedbackCommand( static USGForceFeedbackCommand* GetTotalForceFeedbackLevels_LastForceFeedbackCommand(
@@ -119,22 +167,34 @@ public:
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer,
const USGForceFeedbackCommand* LastForceFeedbackCommand); const USGForceFeedbackCommand* LastForceFeedbackCommand);
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static USGForceFeedbackCommand* GetTotalForceFeedbackLevels( static USGForceFeedbackCommand* GetTotalForceFeedbackLevels(
UObject* WorldContextObject, UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static USGBuzzCommand* GetTotalBuzzLevels(UObject* WorldContextObject, static USGBuzzCommand* GetTotalBuzzLevels(UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer",
meta=(WorldContext="WorldContextObject")) meta=(WorldContext="WorldContextObject"))
static USGThumperCommand* GetTotalThumperLevels(UObject* WorldContextObject, static USGThumperCommand* GetTotalThumperLevels(UObject* WorldContextObject,
const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer);
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Only clears the ForceFeedback queue, and only if you want it to.
*/
UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics", UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject"))
static void FlushHaptics_LBL_OutFFC_OutBC_OutTC_bCFFQ( static void FlushHaptics_LBL_OutFFC_OutBC_OutTC_bCFFQ(
@@ -146,6 +206,9 @@ public:
USGThumperCommand*& OutThumperCommand, USGThumperCommand*& OutThumperCommand,
bool bClearForceFeedbackQueue = true); bool bClearForceFeedbackQueue = true);
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Also updates & clears all queues.
*/
UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics", UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics",
Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject"))
static void FlushHaptics_DS_LBL_OutFFC_OutBuzzCommand_OutTC( static void FlushHaptics_DS_LBL_OutFFC_OutBuzzCommand_OutTC(
@@ -29,7 +29,8 @@
* *
* @section DESCRIPTION * @section DESCRIPTION
* *
* An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback. * An interface for any of our gloves that can track hand motion and/or send
* force / vibrotactile feedback.
*/ */