/** * @file * * @author Max Lammers * @author Mamadou Babaei * * @section LICENSE * * Copyright (c) 2020 - 2022 SenseGlove * * @section DESCRIPTION * * Contains enumerators and classes to aid in Sense Glove Deserialization. */ #pragma once #include #include #include #include #include "Platform.hpp" namespace SGCore { namespace Kinematics { class Quat; class Vect3D; }// namespace Kinematics namespace Parsing { /// Sense Glove C string Variables, enumerated for our convenience. enum class ESenseGloveCVar : uint8_t { ConstOpen = 0, Id, GloveVersion, FirmwareVersion, LeftRight, Functions, GlovePosition, GloveLengths,// all gloves have functionality up to this point. NumberOfSensors, ImuCorrection, /// Utility value used in iteration / checking lengths. AllC, }; /// Sense Glove sensor string Variables, enumerated for our convenience. enum class ESenseGloveSVar : uint8_t { RealtimeError = 0,// real-time error FingerSensors, ImuData, WatchdogError, // watchdog-error SemaphoreError,// semaphore-error /// Utility value used in iteration / checking lengths. AllS, }; }// namespace Parsing namespace SG { /// "Database" class containing Sense Glove internal variables. class SGCORE_API SenseGloveVars; class SenseGloveInfo; }// namespace SG }// namespace SGCore /// "Database" class containing Sense Glove internal variables. class SGCORE_API SGCore::SG::SenseGloveVars { public: /// Retrieve a basic ConstantsString for a Sense Glove of a specific Hardware Version. Used for debugging / unit tests. /// Returns an empty string when an invalid glove version is requested. static std::string GetStandardConstantsString(const std::string& hardwareVersion, float firmwareVersion, bool bRightHanded); /// Retrieve an example sensor string of a Sense Glove with a particular hardware- and firmware version. static std::string GetSensorString(const std::string& hardwareVersion, float firmwareVersion); /// Retrieve the starting positions of a particular Sense Glove. static std::vector GetStartPositions(const std::string& hardwareVersion, bool bRightHanded); /// Retrieve the starting rotations of a particular Sense Glove. static std::vector GetStartRotations(const std::string& hardwareVersion, bool bRightHanded); /// Retrieve the glove finger lengths of a particular Sense Glove. static std::vector> GetGloveLengths(const std::string& hardwareVersion); /// Get the number of sensors of a SenseGlove. /// /// static int32_t GetSensors(const std::string& hardwareVersion); /// Get the default IMUCorrection for the SenseGlove. /// /// /// /// static Kinematics::Quat GetImuCorrection(const std::string& hardwareVersion, int32_t firmwareVersion, int32_t subFirmwareVersion); /// Check all functionality of a SenseGlove. /// /// /// /// static std::vector GetFunctions(const std::string& hardwareVersion, int32_t firmwareVersion, int32_t subFirmwareVersion); /// Generate a custom glove info. /// /// /// /// /// static SenseGloveInfo GenerateGloveModel(const std::string& hardwareVersion, int32_t firmwareVersion, int32_t subFirmwareVersion, bool bRightHanded); /// Generate a custom glove info. /// /// /// /// /// /// static SenseGloveInfo GenerateGloveModel(const std::string& hardwareVersion, int32_t firmwareVersion, int32_t subFirmwareVersion, bool bRightHanded, const std::string& customId); public: SenseGloveVars() = delete; virtual ~SenseGloveVars() = delete; };