Suit Class
Enums
TSP_BUFFER_SIZE#
Name | Description |
---|
TSP_HIT_POLYGON_SIZE = 24 | |
TSP_NODE_COUNT = 12 | |
TSP_CHANNEL_COUNT = 64 | |
TSP_NODE_MODULES_COUNT = 4 | |
TSP_MOTION_DATA_BUFFER_SIZE = 10 | |
TSP_ECG_BUFFER_SIZE = 25 | |
TSP_GSR_CHANNELS_BUFFER_SIZE = 16 | |
TSP_R_CODE#
Name | Description |
---|
TSP_SUCCESS = 1 | Function execution was successful |
TSP_FAIL = 2 | Function execution failed due to unknown error |
TSP_FAIL_ARG = 3 | Wrong parameters were passed. Check for nullptr |
TSP_FAIL_SH_MEM = 4 | Could not initialize shared memory. Check teslasuit.service status. It must be running |
TSP_FAIL_QUEUE_1 = 5 | Could not send the command |
TSP_FAIL_QUEUE_2 = 6 | Could not receive the command |
TSP_FAIL_STARTED = 7 | |
TSP_FAIL_NOT_STARTED = 8 | |
TSP_FAIL_SUIT = 9 | Could not find suit with given suit_id |
TSP_FAIL_MAPPING = 10 | Incorrect mapping |
TSP_FAIL_SERVICE_0 = 11 | Deprecated |
TSP_FAIL_SERVICE_1 = 12 | OpenSCManager failed |
TSP_FAIL_SERVICE_2 = 13 | OpenService failed |
TSP_FAIL_SERVICE_3 = 14 | QueryServiceStatusEx failed |
TSP_FAIL_SERVICE_4 = 15 | Could not start the teslasuit.service, because it has been already running |
TSP_FAIL_SERVICE_5 = 16 | QueryServiceStatusEx failed |
TSP_FAIL_SERVICE_6 = 17 | Timeout when changing teslasuit.service from stopping to stopped |
TSP_FAIL_SERVICE_7 = 18 | StartService failed |
TSP_FAIL_SERVICE_8 = 19 | QueryServiceStatusEx failed |
TSP_FAIL_SERVICE_9 = 20 | Could not start teslasuit.service |
TSP_FAIL_SERVICE_10 = 21 | Could not stop teslasuit.service, because it has been already stopped |
TSP_FAIL_SERVICE_11 = 22 | Timeout when changing teslasuit.service status from stopping to stopped |
TSP_FAIL_SERVICE_12 = 23 | ControlService failed |
TSP_FAIL_MOCAP_1 = 24 | Streaming of Mocap data from Teslasuit with given ID has been already started |
TSP_FAIL_MOCAP_2 = 25 | Streaming of Mocap data from Teslasuit with given ID has been already stopped |
TSP_FAIL_ECG_1 = 26 | Streaming of ECG data from Teslasuit with given ID has been already started |
TSP_FAIL_ECG_2 = 27 | Streaming of ECG data from Teslasuit with given ID has been already stopped |
TSP_FAIL_GSR_1 = 28 | Streaming of GSR data from Teslasuit with given ID has been already started |
TSP_FAIL_GSR_2 = 29 | Streaming of GSR data from Teslasuit with given ID has been already stopped |
TSP_FAIL_CURRENT_FEEDBACK_1 = 30 | Streaming of the current feedback data from Teslasuit with given ID has been already started |
TSP_FAIL_CURRENT_FEEDBACK_2 = 31 | Streaming of the current feedback data from Teslasuit with given ID has been already stopped |
TSP_HAPTIC_1 = 32 | Haptic animation is playing |
TSP_UPDATE_FAIL_1 = 33 | Could not update control unit |
TSP_FAIL_CALIBRATION_1 = 34 | Haptic calibration is off |
TSP_FAIL_CALIBRATION_2 = 35 | Haptic calibration is off |
TSP_FAIL_CALIBRATION_3 = 36 | The minimum value of haptic calibration is not set |
TSP_FAIL_CALIBRATION_4 = 37 | The maximum value of haptic calibration is not set |
TSP_FAIL_CALIBRATION_5 = 38 | Sent calibration value exceed the maximum value |
TSP_FAIL_CALIBRATION_6 = 39 | Sent calibration value is less than the minimum value |
TSP_FAIL_MOCAP_3 = 40 | The function cannot be used with this version of Teslasuit hardware. The function requires hardware version 4.5.4 or higher |
TSP_SUIT_HARDWARE_VERSION#
Name | Description |
---|
TSP_HV_UNKNOWN = 0 | Unknown version of Teslasuit hardware |
TSP_HV_4_5_0_0 = 1 | Version 4.5.0.0 of Teslasuit hardware |
TSP_HV_4_5_1_0 = 2 | Version 4.5.1.0 of Teslasuit hardware |
TSP_HV_4_5_2_0 = 3 | Version 4.5.2.0 of Teslasuit hardware |
TSP_HV_4_5_3_0 = 4 | Version 4.5.3.0 of Teslasuit hardware |
TSP_HV_4_5_4_0 = 5 | Version 4.5.4.0 of Teslasuit hardware |
TSP_CONNECT_QUALITY#
Name | Description |
---|
TSP_NO_CONNECTION = 0 | There is no connection |
TSP_BAD = 1 | Connection quality is poor. Some packages were lost during ping |
TSP_GOOD = 2 | Connection quality is good. All packages were received during ping |
TSP_SUIT_SEX#
Name | Description |
---|
TSP_SEX_UNKNOWN = 0 | Unknown model of Teslasuit |
TSP_MEN = 1 | Men suit |
TSP_WOMEN = 2 | Women suit |
TSP_UNISEX = 3 | Unisex suit |
TSP_SUIT_SIZE#
Name | Description |
---|
TSP_SIZE_UNKNOWN = 0 | Unknown size of Teslasuit |
TSP_XS = 1 | XS size of Teslasuit |
TSP_S = 2 | S size of Teslasuit |
TSP_M = 3 | M size of Teslasuit |
TSP_L = 4 | L size of Teslasuit |
TSP_XL = 5 | XL size of Teslasuit |
TSP_XXL = 6 | 2XL size of Teslasuit |
TSP_SUIT_KIT#
Name | Description |
---|
TSP_KIT_UNKNOWN = 0 | Unknown kit of Teslasuit |
TSP_JACKET = 1 << 0 | Jacket is available |
TSP_TROUSES = 1 << 1 | Pants are available |
TSP_GLOVES = 1 << 2 | Gloves are available |
TSP_HIT_EVENT#
Name | Description |
---|
TSP_ENTER = 0 | Start playing |
TSP_STAY = 1 | Continue playing |
TSP_EXIT = 2 | End playing |
TSP_HIT_EVENT_NONE = 3 | NULL |
TSP_ASSET_TYPE#
Name | Description |
---|
TSP_EMPTY = 0 | Empty asset |
TSP_ANIMATION = 1 | Animation |
TSP_PRESET = 2 | Preset |
TSP_EFFECT = 3 | Effect |
TSP_SAMPLE = 4 | Sample |
TSP_FEEL = 5 | Touch |
TSP_MATERIAL = 6 | Material |
TSP_MOCAP_FREQ#
Name | Description |
---|
TSP_FPS_28 = 35 | Mocap frequency rate of 28 frames per second |
TSP_FPS_50 = 20 | Mocap frequency rate of 50 frames per second |
TSP_FPS_100 = 10 | Mocap frequency rate of 100 frames per second |
TSP_FPS_200 = 5 | Mocap frequency rate of 200 frames per second. This rate can be set only for the suits with the 4.5.4 or higher hardware versions |
TSP_ECG_FREQ#
Name | Description |
---|
TSP_ECG_FPS_5 = 200 | ECG frequency rate of 5 frames per second |
TSP_ECG_FPS_10 = 100 | ECG frequency rate of 10 frames per second |
TSP_ECG_FPS_20 = 50 | ECG frequency rate of 20 frames per second |
TSP_GSR_FREQ#
Name | Description |
---|
TSP_GSR_FPS_10 = 100 | GSR frequency rate of 10 frames per second |
TSP_GSR_FPS_20 = 50 | GSR frequency rate of 20 frames per second |
TSP_GSR_FPS_40 = 25 | GSR frequency rate of 40 frames per second |
TSP_GSR_FPS_60 = 16 | GSR frequency rate of 60 frames per second |
CALLBACK_INDEX#
Name | Description |
---|
CONNECTED = 0 | |
DISCONNECTED = 1 | |
MOCAP_DATA_UPDATE = 2 | |
MOCAP_UPDATE = 3 | |
ECG_UPDATE = 4 | |
GSR_UPDATE = 5 | |
CURRENT_FEEDBACK_UPDATE = 6 | |
NUM_CALLBACKS = 7 | |
Members
unsigned long long getId
(
)
#
Returns the ID of Teslasuit.
Return value
Teslasuit ID
String getName
(
)
#
Returns the name of Teslasuit.
Return value
Teslasuit name
String getSerial
(
)
#
Returns a serial number of Teslasuit.
Return value
Teslasuit serial number
String getSSID
(
)
#
Returns SSID of Teslasuit.
Return value
Teslasuit SSID
String getUserNetworkSSID
(
)
#
Returns SSID of the network, to which Teslasuit is connected.
Return value
SSID of a network, to which Teslasuit is connected
Suit::TSP_SUIT_HARDWARE_VERSION getHardwareVersion
(
)
#
Returns a hardware version of the connected Teslasuit.
Return value
Teslasuit hardware version, one of the
TSP_SUIT_HARDWARE_VERSION values
String getFirmwareVersion
(
)
#
Returns a firmware version of the connected Teslasuit.
Return value
Teslasuit firmware version
Suit::TSP_SUIT_SIZE getSize
(
)
#
Returns the size of Teslasuit.
Return value
Size of Teslasuit, one of the
TSP_SUIT_SIZE values
Suit::TSP_SUIT_SEX getSex
(
)
#
Returns the model of Teslasuit.
Return value
Model of Teslasuit, one of the
TSP_SUIT_SEX values
Suit::TSP_SUIT_KIT getKit
(
)
#
Returns values of the Teslasuit parts that are available for Teslasuit with given ID.
Return value
TSP_SUIT_KIT values of the Teslasuit parts that are available
Suit::suit_info getInfo
(
)
#
Suit::TSP_CONNECT_QUALITY getConnectQuality
(
)
#
Returns quality of Wi-Fi connection quality for Teslasuit.
Return value
Quality of the Wi-Fi connection of Teslasuit, one of the
TSP_CONNECT_QUALITY values
unsigned int playAsset
(
unsigned long long id
)
#
Arguments
Return value
unsigned int stopAsset
(
unsigned long long id
)
#
Arguments
unsigned int pausedAsset
(
unsigned long long assetId, bool isPaused
)
#
Arguments
- unsigned long long assetId
- bool isPaused
unsigned int loopedAsset
(
unsigned long long assetId, bool isLooped
)
#
Arguments
- unsigned long long assetId
- bool isLooped
bool isPlayingAsset
(
unsigned long long assetId
)
#
Arguments
- unsigned long long assetId
unsigned int stopAssets
(
)
#
unsigned int pausedAssets
(
bool isPaused
)
#
Arguments
Vector< unsigned long long > getPlayingAsset
(
)
#
Suit::asset_info getAssetInfo
(
unsigned long long assetId
)
#
Returns haptic asset information.
Arguments
- unsigned long long assetId - ID of a loaded asset
Return value
One of the
TSP_R_CODE values
unsigned int clearAssets
(
)
#
unsigned long long getSourceMapId
(
)
#
unsigned int removeHitMap
(
unsigned long long mapId
)
#
Arguments
unsigned int buildAssetForMap
(
unsigned long long mapId, unsigned long long assetId
)
#
Arguments
- unsigned long long mapId
- unsigned long long assetId
unsigned int getMapPolyCount
(
unsigned long long mapId, short layer
)
#
Arguments
- unsigned long long mapId
- short layer
Vector< Suit::poly_2d > getMapPolygons
(
unsigned long long mapId, short layer
)
#
Arguments
- unsigned long long mapId
- short layer
unsigned long long cachePoly
(
unsigned long long mapId, const Vector< Math::vec2 > & points
)
#
Arguments
- unsigned long long mapId
- const Vector< Math::vec2 > & points
unsigned long long cacheCircle
(
unsigned long long mapId, const Math::vec2 & center, float radius
)
#
Caches a circle shape for further processing.
Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Math::vec2 & center - Coordinates of the center of a circle
- float radius - A value of a circle radius
Return value
ID of cached shape, one of
TSP_R_CODE values
unsigned long long cachePoint
(
unsigned long long mapId, const Math::vec2 & point
)
#
Caches a point for further processing.
Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Math::vec2 & point - Coordinates of the point
Return value
ID of cached shape, one of
TSP_R_CODE values
unsigned int hapticPointHit
(
unsigned long long mapId, const Vector< Suit::point_hit > & hits
)
#
Arguments
- unsigned long long mapId
- const Vector< Suit::point_hit > & hits
unsigned int hapticCircleHit
(
unsigned long long mapId, const Vector< Suit::circle_hit > & hits
)
#
Arguments
- unsigned long long mapId
- const Vector< Suit::circle_hit > & hits
unsigned int hapticPolyHit
(
unsigned long long mapId, const Vector< Suit::poly_hit > & hits
)
#
Arguments
- unsigned long long mapId
- const Vector< Suit::poly_hit > & hits
unsigned int hapticCacheHit
(
unsigned long long mapId, const Vector< Suit::cache_hit > & hits
)
#
Arguments
- unsigned long long mapId
- const Vector< Suit::cache_hit > & hits
unsigned int updateMul
(
unsigned long long mapId, unsigned long long assetId, const Suit::mul_conf & mul
)
#
Arguments
- unsigned long long mapId
- unsigned long long assetId
- const Suit::mul_conf & mul
unsigned int mocapUpdatableStart
(
const Suit::mocap_opt & opt
)
#
Starts updatable streaming of mocap data from Teslasuit with given ID. When you use this function, all data is streamed in the TSMocapData struct. To stream data from earlier hardware versions, use
mocapStart() or
mocapStartExtended() instead. To get motion data, pass the callback that is invoked each time when the mocap data is updated. Call
mocapStop() to stop updatable streaming of mocap data.
NoticeTo use this function, the hardware version of the suit should be 4.5.4 or higher.
Arguments
- const Suit::mocap_opt & opt - Structure that stores frame rate and sensors mask of the mocap data
Return value
TSP_R_CODE value
unsigned int mocapStart
(
)
#
Starts streaming of Mocap data from Teslasuit. When you use this function, only mocap_bone_index and quat (9-axis) are streamed in the TSFifoData struct. To stream all data, use
mocapStartExtended() instead. To get motion data, pass the callback that is invoked each time that Mocap data is updated. Call
mocapStop() to stop Mocap data streaming. It is recommended to stop streaming of
extended Mocap data from the same suit before calling the function, as well as streaming of
GSR and
ECG data.
Return value
TSP_R_CODE value
unsigned int mocapStartExtended
(
)
#
Starts streaming of Mocap extended data from Teslasuit. When you use this function, all data is streamed in the TSFifoData struct. To stream only mocap_bone_index and quat (9-axis), use
mocapStart() instead. To get motion data, pass the callback that is invoked each time that Mocap data is updated. Call ts_mocap_stop_extended() to stop Mocap extended data streaming. It is recommended to stop streaming of
Mocap data from the same suit before calling the function, as well as streaming of
GSR and
ECG data.
NoticeThis function is available only for Teslasuits with hardware version 4.5.2 or earlier.
Return value
TSP_R_CODE value
unsigned int mocapStop
(
)
#
Stops streaming of Mocap data from Teslasuit.
Return value
TSP_R_CODE value
unsigned int mocapStopExtended
(
)
#
Stops streaming of mocap extended data from Teslasuit.
NoticeThis function is available only for Teslasuits with hardware version 4.5.2 or earlier.
Return value
TSP_R_CODE value
unsigned int updateMocapFreq
(
Suit::TSP_MOCAP_FREQ freq
)
#
Arguments
- Suit::TSP_MOCAP_FREQ freq -
Return value
TSP_R_CODE value
unsigned int updateMocapOptions
(
const Suit::mocap_opt & opt
)
#
Sets the frame rate and sensors mask of the mocap data streaming from Teslasuit. To use this function, the hardware version of the suit must be 4.5.4 or higher.
Arguments
- const Suit::mocap_opt & opt -
Return value
TSP_R_CODE value
unsigned int biometryStartEcg
(
)
#
Starts streaming of ECG data from Teslasuit with given ID. To get ECG data, pass the callback that is invoked each time that ECG data is updated. Call
biometryStopEcg() to stop ECG data streaming.
Return value
TSP_R_CODE value
unsigned int biometryStopEcg
(
)
#
Stops streaming of ECG data from Teslasuit.
Return value
TSP_R_CODE value
unsigned int biometryStartGsr
(
)
#
Starts streaming of GSR data from Teslasuit with given ID. To get GSR data, pass the callback that is invoked each time that GSR data is updated.
Call biometryStopGsr() to stop GSR data streaming.
Return value
TSP_R_CODE value
unsigned int biometryStopGsr
(
)
#
Stops streaming of GSR data from Teslasuit.
Return value
TSP_R_CODE value
unsigned int updateEcgFreq
(
Suit::TSP_ECG_FREQ freq
)
#
Sets frames per second rate of ECG data streaming for Teslasuit.
Arguments
- Suit::TSP_ECG_FREQ freq - ECG streaming rate
Return value
TSP_R_CODE value
unsigned int updateGsrFreq
(
Suit::TSP_GSR_FREQ freq
)
#
Sets frames per second rate of GSR data streaming for Teslasuit with given ID.
Arguments
- Suit::TSP_GSR_FREQ freq - GSR streaming rate
Return value
TSP_R_CODE value
unsigned int subCurrentFeedback
(
)
#
Creates a subscription on the current feedback callbacks. Every time a measurement is taken, the TSOnCurrentFeedbackUpdate callback occurs.
Return value
TSP_R_CODE value
unsigned int unsubCurrentFeedback
(
)
#
Deletes a subscription on the current feedback callbacks.
Return value
TSP_R_CODE value