C++ SDK for MANUS Core 2.0
|
Classes | |
class | SDKClientPlatformSpecific |
struct | ClientHapticSettings |
Haptic settings for a single glove. More... | |
class | ClientSkeleton |
Used to store the information about the final animated skeletons. More... | |
class | ClientSkeletonCollection |
Used to store all the final animated skeletons received from Core. More... | |
class | SDKClient |
Variables | |
constexpr unsigned int | NUMBER_OF_HANDS_SUPPORTED = 2 |
Constant expression: number of hands supported by demo. More... | |
constexpr unsigned long long int | MINIMUM_MILLISECONDS_BETWEEN_HAPTICS_COMMANDS = 20 |
Constant expression used to define the time between two possible haptics commands sent. More... | |
constexpr unsigned long long int | MILLISECONDS_BETWEEN_TEMPORARY_SKELETONS_UPDATE = 1000 |
Constant expression used to define the time between two updates of the temporary skeleton count printing. More... | |
class SDKClientPlatformSpecific |
Definition at line 18 of file ClientPlatformSpecific.hpp.
Inherited by SDKClient, and SDKMinimalClient.
Protected Member Functions | |
bool | PlatformSpecificInitialization (void) |
Initialise things only needed for this platform. More... | |
bool | PlatformSpecificShutdown (void) |
Shut down things only needed for this platform. More... | |
void | UpdateInput (void) |
Update the current keyboard state. More... | |
bool | ResizeWindow (const short int p_ConsoleWidth, const short int p_ConsoleHeight, const short int p_ConsoleScrollback) |
Resize the window, so the log messages will fit. Make sure not to enter illegal sizes in here or SetConsoleWindowInfo and SetConsoleScreenBufferSize can generate an error. This is not code directly needed for the SDK to function, but its handy for a quick and simple output for this client. More... | |
void | ApplyConsolePosition (const int p_ConsoleCurrentOffset) |
Set the current console position. This handles the platform-specific part of advancing the console position. More... | |
bool | GetKey (const int p_Key) |
Gets key's current state. True is pressed false is not pressed. More... | |
bool | GetKeyDown (const int p_Key) |
Returns true first time it is called when key is pressed. More... | |
bool | GetKeyUp (const int p_Key) |
Returns true first time it is called when key is released. More... | |
std::string | GetDocumentsDirectoryPath_UTF8 (void) |
Get the path to the user's Documents folder. The string should be in UTF-8 format. More... | |
std::ifstream | GetInputFileStream (std::string p_Path_UTF8) |
Get an input stream for the given file. The file's path should be in UTF-8 format. More... | |
std::ofstream | GetOutputFileStream (std::string p_Path_UTF8) |
Get an output stream for the given file. The file's path should be in UTF-8 format. More... | |
bool | DoesFolderOrFileExist (std::string p_Path_UTF8) |
Check if the given folder or file exists. The folder path given should be in UTF-8 format. More... | |
void | CreateFolderIfItDoesNotExist (std::string p_Path_UTF8) |
Create the given folder if it does not exist. The folder path given should be in UTF-8 format. More... | |
Static Protected Member Functions | |
static bool | CopyString (char *const p_Target, const size_t p_MaxLengthThatWillFitInTarget, const std::string &p_Source) |
Copy the given string into the given target. More... | |
static void | ClearConsole (void) |
Clear the console window. More... | |
Static Protected Attributes | |
static const std::string | s_SlashForFilesystemPath = "/" |
The slash character that is used in the filesystem. More... | |
|
protected |
Set the current console position. This handles the platform-specific part of advancing the console position.
Definition at line 469 of file ClientPlatformSpecific.cpp.
|
staticprotected |
Clear the console window.
Definition at line 475 of file ClientPlatformSpecific.cpp.
|
staticprotected |
Copy the given string into the given target.
Definition at line 403 of file ClientPlatformSpecific.cpp.
|
protected |
Create the given folder if it does not exist. The folder path given should be in UTF-8 format.
Definition at line 548 of file ClientPlatformSpecific.cpp.
|
protected |
Check if the given folder or file exists. The folder path given should be in UTF-8 format.
Definition at line 543 of file ClientPlatformSpecific.cpp.
|
protected |
Get the path to the user's Documents folder. The string should be in UTF-8 format.
Definition at line 512 of file ClientPlatformSpecific.cpp.
|
protected |
Get an input stream for the given file. The file's path should be in UTF-8 format.
Definition at line 531 of file ClientPlatformSpecific.cpp.
|
protected |
Gets key's current state. True is pressed false is not pressed.
Definition at line 497 of file ClientPlatformSpecific.cpp.
|
protected |
Returns true first time it is called when key is pressed.
Definition at line 502 of file ClientPlatformSpecific.cpp.
|
protected |
Returns true first time it is called when key is released.
Definition at line 507 of file ClientPlatformSpecific.cpp.
|
protected |
Get an output stream for the given file. The file's path should be in UTF-8 format.
Definition at line 537 of file ClientPlatformSpecific.cpp.
|
protected |
Initialise things only needed for this platform.
Definition at line 381 of file ClientPlatformSpecific.cpp.
|
protected |
Shut down things only needed for this platform.
Definition at line 390 of file ClientPlatformSpecific.cpp.
|
protected |
Resize the window, so the log messages will fit. Make sure not to enter illegal sizes in here or SetConsoleWindowInfo and SetConsoleScreenBufferSize can generate an error. This is not code directly needed for the SDK to function, but its handy for a quick and simple output for this client.
Definition at line 441 of file ClientPlatformSpecific.cpp.
|
protected |
Update the current keyboard state.
Definition at line 398 of file ClientPlatformSpecific.cpp.
|
staticprotected |
The slash character that is used in the filesystem.
Definition at line 86 of file ClientPlatformSpecific.hpp.
struct ClientHapticSettings |
Haptic settings for a single glove.
This is used to store if a specific motor on the glove should be enabled or not.
Definition at line 66 of file SDKClient.hpp.
Public Attributes | |
bool | shouldHapticFinger [NUM_FINGERS_ON_HAND] |
bool shouldHapticFinger[NUM_FINGERS_ON_HAND] |
Definition at line 68 of file SDKClient.hpp.
class ClientSkeleton |
Used to store the information about the final animated skeletons.
Definition at line 72 of file SDKClient.hpp.
Public Member Functions | |
~ClientSkeleton () | |
Public Attributes | |
SkeletonInfo | info |
std::vector< SkeletonNode > | nodes |
SkeletonNode * | nodes = nullptr |
|
inline |
Definition at line 41 of file SDKMinimalClient.hpp.
SkeletonInfo info |
Definition at line 75 of file SDKClient.hpp.
std::vector<SkeletonNode> nodes |
Definition at line 76 of file SDKClient.hpp.
SkeletonNode* nodes = nullptr |
Definition at line 39 of file SDKMinimalClient.hpp.
class ClientSkeletonCollection |
Used to store all the final animated skeletons received from Core.
Definition at line 80 of file SDKClient.hpp.
Public Attributes | |
std::vector< ClientSkeleton > | skeletons |
std::vector< ClientSkeleton > skeletons |
Definition at line 83 of file SDKClient.hpp.
class SDKClient |
Definition at line 86 of file SDKClient.hpp.
Inherits SDKClientPlatformSpecific.
Public Member Functions | |
SDKClient () | |
~SDKClient () | |
ClientReturnCode | Initialize () |
Initialize the sample console and the SDK. This function attempts to resize the console window and then proceeds to initialize the SDK's interface. More... | |
ClientReturnCode | Run () |
The main SDKClient loop. This is a simple state machine which switches between different substates. More... | |
ClientReturnCode | ShutDown () |
When you are done with the SDK, don't forget to nicely shut it down this will close all connections to the host, close any threads and clean up after itself after this is called it is expected to exit the client program. If not it needs to call initialize again. More... | |
float | RoundFloatValue (float p_Value, int p_NumDecimalsToKeep) |
Round the given float value so that it has no more than the given number of decimals. More... | |
void | AdvanceConsolePosition (short int p_Y) |
Set the position that the next log message will appear at. Using this allows us to have somewhat of a static, yet flexible layout of logging. More... | |
Static Public Member Functions | |
static void | OnConnectedCallback (const ManusHost *const p_Host) |
Gets called when the client is connects to manus core Using this callback is optional. In this sample we use this callback to change the client's state and switch to another screen. More... | |
static void | OnDisconnectedCallback (const ManusHost *const p_Host) |
Gets called when the client disconnects from manus core. This callback is optional and in the sample changes the client's state. More... | |
static void | OnSkeletonStreamCallback (const SkeletonStreamInfo *const p_Skeleton) |
This gets called when the client is connected to manus core. More... | |
static void | OnLandscapeCallback (const Landscape *const p_Landscape) |
This gets called when receiving landscape information from core. More... | |
static void | OnSystemCallback (const SystemMessage *const p_SystemMessage) |
This gets called when receiving a system message from Core. More... | |
static void | OnErgonomicsCallback (const ErgonomicsStream *const p_Ergo) |
This gets called when receiving ergonomics data from Manus Core In our sample we only save the first left and first right glove's latests ergonomics data. Ergonomics data gets generated and sent when glove data changes, this means that the stream does not always contain ALL of the devices, because some may not have had new data since the last time the ergonomics data was sent. More... | |
Protected Member Functions | |
virtual ClientReturnCode | InitializeSDK () |
Initialize the sdk, register the callbacks and set the coordinate system. This needs to be done before any of the other SDK functions can be used. More... | |
virtual ClientReturnCode | RestartSDK () |
Used to restart and initialize the SDK to make sure a new connection can be set up. This function is used by the client to shutdown the SDK and any connections it has. After that it reinitializes the SDK so that it is ready to connect to a new Manus Core. More... | |
virtual ClientReturnCode | RegisterAllCallbacks () |
Used to register the callbacks between sdk and core. Callbacks that are registered functions that get called when a certain 'event' happens, such as data coming in from Manus Core. All of these are optional, but depending on what data you require you may or may not need all of them. More... | |
virtual ClientReturnCode | PickingConnectionType () |
Overridable switch states of how the client flow is done. This is the first option screen in the client to determine how the client is going to connect to manus core it sets the m_state based on user input. More... | |
virtual ClientReturnCode | LookingForHosts () |
Simple example of the SDK looking for manus core hosts on the network and display them on screen. More... | |
virtual ClientReturnCode | NoHostsFound () |
When no available hosts are found the user can either retry or exit. More... | |
virtual ClientReturnCode | PickingHost () |
Print the found hosts and give the user the option to select one. More... | |
virtual ClientReturnCode | ConnectingToCore () |
After a connection option was selected, the client will now try to connect to manus core via the SDK. More... | |
virtual ClientReturnCode | UpdateBeforeDisplayingData () |
Some things happen before every display update, no matter what state. They happen here, such as the updating of the landscape and the generated tracker. More... | |
virtual ClientReturnCode | DisplayingData () |
Once the connections are made we loop this function it calls all the input handlers for different aspects of the SDK and then prints any relevant data of it. More... | |
virtual ClientReturnCode | DisplayingDataGlove () |
display the ergonomics data of the gloves, and handles haptic commands. More... | |
virtual ClientReturnCode | DisplayingDataSkeleton () |
virtual ClientReturnCode | DisplayingDataTracker () |
virtual ClientReturnCode | DisplayingDataTemporarySkeleton () |
virtual ClientReturnCode | DisplayingLandscapeTimeData () |
virtual ClientReturnCode | DisconnectedFromCore () |
When the SDK loses the connection with Core the user can either close the sdk or try to reconnect to a local or to a remote host. More... | |
virtual ClientReturnCode | ReconnectingToCore (int32_t p_ReconnectionTime=0, int32_t p_ReconnectionAttempts=0) |
It is called when the sdk is disconnected from Core and the user select one of the options to reconnect. More... | |
void | PrintHandErgoData (ErgonomicsData &p_ErgoData, bool p_Left) |
Prints the ergonomics data of a hand. More... | |
void | PrintErgonomicsData () |
Print the ergonomics data received from Core. More... | |
void | PrintDongleData () |
Print the ergonomics data received from Core. More... | |
void | PrintSystemMessage () |
Prints the last received system messages received from Core. More... | |
void | PrintSkeletonData () |
Prints the finalized skeleton data received from Core. Since our console cannot render this data visually in 3d (its not in the scope of this client) we only display a little bit of data of the skeletons we receive. More... | |
void | PrintTrackerData () |
Prints the tracker data Since our console cannot render this data visually in 3d (its not in the scope of this client) we only display a little bit of data of the trackers we receive. More... | |
void | PrintTrackerDataGlobal () |
Prints the tracker data without taking users into account. This shows how one can get the tracker data that is being streamed without caring about users. More... | |
void | PrintTrackerDataPerUser () |
Prints the tracker data per user, this shows how to access this data for each user. More... | |
void | PrintLandscapeTimeData () |
void | PrintSkeletonInfo () |
Prints the type of the first chain generated by the AllocateChain function, this is used for testing. More... | |
void | PrintTemporarySkeletonInfo () |
This support function gets the temporary skeletons for all sessions connected to Core and it prints the total number of temporary skeletons associated to the current session. Temporary skeletons are used for auto allocation and in the Dev Tools. More... | |
void | GetTemporarySkeletonIfModified () |
This support function checks if a temporary skeleton related to the current session has been modified and gets it. Whenever the Dev Tools saves the changes to the skeleton, it sets the boolean t_IsSkeletonModified to true for that skeleton. With callback OnSystemCallback this application can be notified when one of its temporary skeletons has been modified, so it can get it and, potentially, load it. More... | |
void | HandleHapticCommands () |
This showcases haptics support on gloves. Send haptics commands to connected gloves if specific keys were pressed. We have two ways of sending the vibration commands, based on the dongle id or based on the skeleton id. More... | |
void | HandleSkeletonCommands () |
Handles the console commands for the skeletons. More... | |
void | HandleSkeletonHapticCommands () |
This showcases haptics support on the skeletons. Send haptics commands to the gloves connected to a skeleton if specific keys were pressed. We have two ways of sending the vibration commands, based on the dongle id or based on the skeleton id. More... | |
void | HandleTemporarySkeletonCommands () |
Handles the console commands for the temporary skeletons. More... | |
void | HandleTrackerCommands () |
This support function is used to set a test tracker and add it to the landscape. More... | |
bool | SetupHandNodes (uint32_t p_SklIndex) |
This support function sets up the nodes for the skeleton hand In order to have any 3d positional/rotational information from the gloves or body, one needs to setup the skeleton on which this data should be applied. In the case of this sample we create a Hand skeleton for which we want to get the calculated result. The ID's for the nodes set here are the same IDs which are used in the OnSkeletonStreamCallback, this allows us to create the link between Manus Core's data and the data we enter here. More... | |
bool | SetupHandChains (uint32_t p_SklIndex) |
This function sets up some basic hand chains. Chains are required for a Skeleton to be able to be animated, it basically tells Manus Core which nodes belong to which body part and what data needs to be applied to which node. More... | |
void | LoadTestSkeleton () |
This function sets up a very minimalistic hand skeleton. In order to have any 3d positional/rotational information from the gloves or body, one needs to setup a skeleton on which this data can be applied. In the case of this sample we create a Hand skeleton in order to get skeleton information in the OnSkeletonStreamCallback function. This sample does not contain any 3D rendering, so we will not be applying the returned data on anything. More... | |
void | UnloadTestSkeleton () |
This support function is used to unload a skeleton from Core. More... | |
void | AllocateChains () |
This support function sets up an incomplete hand skeleton and then uses manus core to allocate chains for it. More... | |
void | BuildTemporarySkeleton () |
This support function is used for the manual allocation of the skeleton chains with means of a temporary skeleton. Temporary Skeletons can be helpful when the user wants to modify the skeletons chains or nodes more than once before retargeting, as they can be saved in core and retrieved later by the user to apply further modifications. This can be done easily with means of the Dev Tools. The current function contains an example that shows how to create a temporary skeleton, modify its chains, nodes and skeleton info, and save it into Core. This process should be used during development. After that, the final skeleton should be loaded into core for retargeting and for getting the actual data,as displayed in the LoadTestSkeleton function. More... | |
void | ClearTemporarySkeleton () |
This support function is used to clear a temporary skeleton from the temporary skeleton list, for example it can be used when the max number of temporary skeletons has been reached for a specific session. More... | |
void | ClearAllTemporarySkeletons () |
This support function is used to clear all temporary skeletons associated to the current SDK session, it can be used when the max number of temporary skeletons has been reached for the current session and we want to make room for more. More... | |
void | SaveTemporarySkeletonToFile () |
void | GetTemporarySkeletonFromFile () |
void | TestTimestamp () |
void | RemoveIndexFromTemporarySkeletonList (uint32_t p_Idx) |
![]() | |
bool | PlatformSpecificInitialization (void) |
Initialise things only needed for this platform. More... | |
bool | PlatformSpecificShutdown (void) |
Shut down things only needed for this platform. More... | |
void | UpdateInput (void) |
Update the current keyboard state. More... | |
bool | ResizeWindow (const short int p_ConsoleWidth, const short int p_ConsoleHeight, const short int p_ConsoleScrollback) |
Resize the window, so the log messages will fit. Make sure not to enter illegal sizes in here or SetConsoleWindowInfo and SetConsoleScreenBufferSize can generate an error. This is not code directly needed for the SDK to function, but its handy for a quick and simple output for this client. More... | |
void | ApplyConsolePosition (const int p_ConsoleCurrentOffset) |
Set the current console position. This handles the platform-specific part of advancing the console position. More... | |
bool | GetKey (const int p_Key) |
Gets key's current state. True is pressed false is not pressed. More... | |
bool | GetKeyDown (const int p_Key) |
Returns true first time it is called when key is pressed. More... | |
bool | GetKeyUp (const int p_Key) |
Returns true first time it is called when key is released. More... | |
std::string | GetDocumentsDirectoryPath_UTF8 (void) |
Get the path to the user's Documents folder. The string should be in UTF-8 format. More... | |
std::ifstream | GetInputFileStream (std::string p_Path_UTF8) |
Get an input stream for the given file. The file's path should be in UTF-8 format. More... | |
std::ofstream | GetOutputFileStream (std::string p_Path_UTF8) |
Get an output stream for the given file. The file's path should be in UTF-8 format. More... | |
bool | DoesFolderOrFileExist (std::string p_Path_UTF8) |
Check if the given folder or file exists. The folder path given should be in UTF-8 format. More... | |
void | CreateFolderIfItDoesNotExist (std::string p_Path_UTF8) |
Create the given folder if it does not exist. The folder path given should be in UTF-8 format. More... | |
Static Protected Member Functions | |
static NodeSetup | CreateNodeSetup (uint32_t p_Id, uint32_t p_ParentId, float p_PosX, float p_PosY, float p_PosZ, std::string p_Name) |
Skeletons are pretty extensive in their data setup so we have several support functions so we can correctly receive and parse the data, this function helps setup the data. More... | |
static ManusVec3 | CreateManusVec3 (float p_X, float p_Y, float p_Z) |
![]() | |
static bool | CopyString (char *const p_Target, const size_t p_MaxLengthThatWillFitInTarget, const std::string &p_Source) |
Copy the given string into the given target. More... | |
static void | ClearConsole (void) |
Clear the console window. More... | |
Protected Attributes | |
bool | m_RequestedExit = false |
uint32_t | m_ConsoleClearTickCount = 0 |
const short int | m_ConsoleWidth = 220 |
const short int | m_ConsoleHeight = 44 |
const short int | m_ConsoleScrollback = 500 |
int | m_ConsoleCurrentOffset = 0 |
SessionType | m_ClientType = SessionType::SessionType_CoreSDK |
ClientState | m_State = ClientState::ClientState_PickingConnectionType |
ClientState | m_PreviousState = m_State |
std::function< ClientReturnCode()> | m_CurrentInteraction = nullptr |
bool | m_ShouldConnectLocally = true |
bool | m_ShouldConnectGRPC = true |
uint32_t | m_HostToConnectTo = 0 |
uint32_t | m_NumberOfHostsFound = 0 |
uint32_t | m_SecondsToFindHosts = 2 |
int32_t | m_SecondsToAttemptReconnecting = 60 |
int32_t | m_MaxReconnectionAttempts = 10 |
uint32_t | m_SleepBetweenReconnectingAttemptsInMs = 100 |
std::unique_ptr< ManusHost[]> | m_AvailableHosts = nullptr |
std::unique_ptr< ManusHost > | m_Host |
uint32_t | m_SessionId = 0 |
bool | m_RumblingWrist [NUMBER_OF_HANDS_SUPPORTED] = { false, false } |
std::vector< uint32_t > | m_LoadedSkeletons |
std::vector< uint32_t > | m_TemporarySkeletons |
std::mutex | m_SkeletonMutex |
ClientSkeletonCollection * | m_NextSkeleton = nullptr |
ClientSkeletonCollection * | m_Skeleton = nullptr |
std::chrono::time_point< std::chrono::high_resolution_clock > | m_TimeSinceLastDisconnect |
std::chrono::time_point< std::chrono::high_resolution_clock > | m_LastTemporarySkeletonUpdate = std::chrono::high_resolution_clock::now() |
std::mutex | m_SystemMessageMutex |
std::string | m_SystemMessage = "" |
SystemMessageType | m_SystemMessageCode = SystemMessageType::SystemMessageType_Unknown |
uint32_t | m_ModifiedSkeletonIndex = UINT_MAX |
ManusTimestampInfo | m_ErgoTimestampInfo |
ErgonomicsData | m_LeftGloveErgoData |
ErgonomicsData | m_RightGloveErgoData |
ChainType | m_ChainType = ChainType::ChainType_Invalid |
bool | m_TrackerTest = false |
bool | m_TrackerDataDisplayPerUser = false |
float | m_TrackerOffset = 0.0f |
std::mutex | m_LandscapeMutex |
Landscape * | m_NewLandscape = nullptr |
Landscape * | m_Landscape = nullptr |
uint32_t | m_FirstLeftGloveID = 0 |
uint32_t | m_FirstRightGloveID = 0 |
Static Protected Attributes | |
static SDKClient * | s_Instance = nullptr |
![]() | |
static const std::string | s_SlashForFilesystemPath = "/" |
The slash character that is used in the filesystem. More... | |
SDKClient | ( | ) |
Definition at line 16 of file SDKClient.cpp.
~SDKClient | ( | ) |
Definition at line 27 of file SDKClient.cpp.
void AdvanceConsolePosition | ( | short int | p_Y | ) |
Set the position that the next log message will appear at. Using this allows us to have somewhat of a static, yet flexible layout of logging.
Definition at line 345 of file SDKClient.cpp.
|
protected |
This support function sets up an incomplete hand skeleton and then uses manus core to allocate chains for it.
Definition at line 1981 of file SDKClient.cpp.
|
protected |
This support function is used for the manual allocation of the skeleton chains with means of a temporary skeleton. Temporary Skeletons can be helpful when the user wants to modify the skeletons chains or nodes more than once before retargeting, as they can be saved in core and retrieved later by the user to apply further modifications. This can be done easily with means of the Dev Tools. The current function contains an example that shows how to create a temporary skeleton, modify its chains, nodes and skeleton info, and save it into Core. This process should be used during development. After that, the final skeleton should be loaded into core for retargeting and for getting the actual data,as displayed in the LoadTestSkeleton function.
Definition at line 2085 of file SDKClient.cpp.
|
protected |
This support function is used to clear all temporary skeletons associated to the current SDK session, it can be used when the max number of temporary skeletons has been reached for the current session and we want to make room for more.
Definition at line 2331 of file SDKClient.cpp.
|
protected |
This support function is used to clear a temporary skeleton from the temporary skeleton list, for example it can be used when the max number of temporary skeletons has been reached for a specific session.
Definition at line 2311 of file SDKClient.cpp.
|
protectedvirtual |
After a connection option was selected, the client will now try to connect to manus core via the SDK.
Definition at line 675 of file SDKClient.cpp.
|
staticprotected |
Definition at line 1733 of file SDKClient.cpp.
|
staticprotected |
Skeletons are pretty extensive in their data setup so we have several support functions so we can correctly receive and parse the data, this function helps setup the data.
p_Id | the id of the created node setup |
p_ParentId | the id of the node parent |
p_PosX | X position of the node, this is defined with respect to the global coordinate system or the local one depending on the parameter p_UseWorldCoordinates set when initializing the sdk, |
p_PosY | Y position of the node this is defined with respect to the global coordinate system or the local one depending on the parameter p_UseWorldCoordinates set when initializing the sdk, |
p_PosZ | Z position of the node this is defined with respect to the global coordinate system or the local one depending on the parameter p_UseWorldCoordinates set when initializing the sdk, |
p_Name | the name of the node setup |
Definition at line 1716 of file SDKClient.cpp.
|
protectedvirtual |
When the SDK loses the connection with Core the user can either close the sdk or try to reconnect to a local or to a remote host.
Definition at line 885 of file SDKClient.cpp.
|
protectedvirtual |
Once the connections are made we loop this function it calls all the input handlers for different aspects of the SDK and then prints any relevant data of it.
Definition at line 766 of file SDKClient.cpp.
|
protectedvirtual |
display the ergonomics data of the gloves, and handles haptic commands.
Definition at line 790 of file SDKClient.cpp.
|
protectedvirtual |
Definition at line 808 of file SDKClient.cpp.
|
protectedvirtual |
Definition at line 845 of file SDKClient.cpp.
|
protectedvirtual |
Definition at line 828 of file SDKClient.cpp.
|
protectedvirtual |
Definition at line 866 of file SDKClient.cpp.
|
protected |
Definition at line 2443 of file SDKClient.cpp.
|
protected |
This support function checks if a temporary skeleton related to the current session has been modified and gets it. Whenever the Dev Tools saves the changes to the skeleton, it sets the boolean t_IsSkeletonModified to true for that skeleton. With callback OnSystemCallback this application can be notified when one of its temporary skeletons has been modified, so it can get it and, potentially, load it.
Definition at line 1369 of file SDKClient.cpp.
|
protected |
This showcases haptics support on gloves. Send haptics commands to connected gloves if specific keys were pressed. We have two ways of sending the vibration commands, based on the dongle id or based on the skeleton id.
Definition at line 1450 of file SDKClient.cpp.
|
protected |
Handles the console commands for the skeletons.
Definition at line 1558 of file SDKClient.cpp.
|
protected |
This showcases haptics support on the skeletons. Send haptics commands to the gloves connected to a skeleton if specific keys were pressed. We have two ways of sending the vibration commands, based on the dongle id or based on the skeleton id.
Definition at line 1573 of file SDKClient.cpp.
|
protected |
Handles the console commands for the temporary skeletons.
Definition at line 1633 of file SDKClient.cpp.
|
protected |
This support function is used to set a test tracker and add it to the landscape.
Definition at line 1662 of file SDKClient.cpp.
ClientReturnCode Initialize | ( | ) |
Initialize the sample console and the SDK. This function attempts to resize the console window and then proceeds to initialize the SDK's interface.
Definition at line 34 of file SDKClient.cpp.
|
protectedvirtual |
Initialize the sdk, register the callbacks and set the coordinate system. This needs to be done before any of the other SDK functions can be used.
Definition at line 361 of file SDKClient.cpp.
|
protected |
This function sets up a very minimalistic hand skeleton. In order to have any 3d positional/rotational information from the gloves or body, one needs to setup a skeleton on which this data can be applied. In the case of this sample we create a Hand skeleton in order to get skeleton information in the OnSkeletonStreamCallback function. This sample does not contain any 3D rendering, so we will not be applying the returned data on anything.
Definition at line 1915 of file SDKClient.cpp.
|
protectedvirtual |
Simple example of the SDK looking for manus core hosts on the network and display them on screen.
Definition at line 556 of file SDKClient.cpp.
|
protectedvirtual |
When no available hosts are found the user can either retry or exit.
Definition at line 605 of file SDKClient.cpp.
|
static |
Gets called when the client is connects to manus core Using this callback is optional. In this sample we use this callback to change the client's state and switch to another screen.
Definition at line 172 of file SDKClient.cpp.
|
static |
Gets called when the client disconnects from manus core. This callback is optional and in the sample changes the client's state.
Definition at line 225 of file SDKClient.cpp.
|
static |
This gets called when receiving ergonomics data from Manus Core In our sample we only save the first left and first right glove's latests ergonomics data. Ergonomics data gets generated and sent when glove data changes, this means that the stream does not always contain ALL of the devices, because some may not have had new data since the last time the ergonomics data was sent.
p_Ergo | contains the ergonomics data for each glove connected to Core. |
Definition at line 301 of file SDKClient.cpp.
|
static |
This gets called when receiving landscape information from core.
p_Landscape | contains the new landscape from core. |
Definition at line 259 of file SDKClient.cpp.
|
static |
This gets called when the client is connected to manus core.
p_SkeletonStreamInfo | contains the meta data on how much data regarding the skeleton we need to get from the SDK. |
Definition at line 236 of file SDKClient.cpp.
|
static |
This gets called when receiving a system message from Core.
p_SystemMessage | contains the system message received from core. |
Definition at line 273 of file SDKClient.cpp.
|
protectedvirtual |
Overridable switch states of how the client flow is done. This is the first option screen in the client to determine how the client is going to connect to manus core it sets the m_state based on user input.
Definition at line 500 of file SDKClient.cpp.
|
protectedvirtual |
Print the found hosts and give the user the option to select one.
Definition at line 627 of file SDKClient.cpp.
|
protected |
Print the ergonomics data received from Core.
Definition at line 1103 of file SDKClient.cpp.
|
protected |
Print the ergonomics data received from Core.
Definition at line 1042 of file SDKClient.cpp.
|
protected |
Prints the ergonomics data of a hand.
p_ErgoData |
Definition at line 1014 of file SDKClient.cpp.
|
protected |
Definition at line 1274 of file SDKClient.cpp.
|
protected |
Prints the finalized skeleton data received from Core. Since our console cannot render this data visually in 3d (its not in the scope of this client) we only display a little bit of data of the skeletons we receive.
Definition at line 1146 of file SDKClient.cpp.
|
protected |
Prints the type of the first chain generated by the AllocateChain function, this is used for testing.
Definition at line 1287 of file SDKClient.cpp.
|
protected |
Prints the last received system messages received from Core.
Definition at line 1135 of file SDKClient.cpp.
|
protected |
This support function gets the temporary skeletons for all sessions connected to Core and it prints the total number of temporary skeletons associated to the current session. Temporary skeletons are used for auto allocation and in the Dev Tools.
Definition at line 1410 of file SDKClient.cpp.
|
protected |
Prints the tracker data Since our console cannot render this data visually in 3d (its not in the scope of this client) we only display a little bit of data of the trackers we receive.
Definition at line 1161 of file SDKClient.cpp.
|
protected |
Prints the tracker data without taking users into account. This shows how one can get the tracker data that is being streamed without caring about users.
Definition at line 1182 of file SDKClient.cpp.
|
protected |
Prints the tracker data per user, this shows how to access this data for each user.
Definition at line 1205 of file SDKClient.cpp.
|
protectedvirtual |
It is called when the sdk is disconnected from Core and the user select one of the options to reconnect.
Definition at line 954 of file SDKClient.cpp.
|
protectedvirtual |
Used to register the callbacks between sdk and core. Callbacks that are registered functions that get called when a certain 'event' happens, such as data coming in from Manus Core. All of these are optional, but depending on what data you require you may or may not need all of them.
Definition at line 433 of file SDKClient.cpp.
|
protected |
Definition at line 2546 of file SDKClient.cpp.
|
protectedvirtual |
Used to restart and initialize the SDK to make sure a new connection can be set up. This function is used by the client to shutdown the SDK and any connections it has. After that it reinitializes the SDK so that it is ready to connect to a new Manus Core.
Definition at line 411 of file SDKClient.cpp.
float RoundFloatValue | ( | float | p_Value, |
int | p_NumDecimalsToKeep | ||
) |
Round the given float value so that it has no more than the given number of decimals.
Definition at line 331 of file SDKClient.cpp.
ClientReturnCode Run | ( | ) |
The main SDKClient loop. This is a simple state machine which switches between different substates.
Definition at line 62 of file SDKClient.cpp.
|
protected |
Definition at line 2347 of file SDKClient.cpp.
|
protected |
This function sets up some basic hand chains. Chains are required for a Skeleton to be able to be animated, it basically tells Manus Core which nodes belong to which body part and what data needs to be applied to which node.
p_SklIndex | The index of the temporary skeleton on which the chains will be added. |
Definition at line 1825 of file SDKClient.cpp.
|
protected |
This support function sets up the nodes for the skeleton hand In order to have any 3d positional/rotational information from the gloves or body, one needs to setup the skeleton on which this data should be applied. In the case of this sample we create a Hand skeleton for which we want to get the calculated result. The ID's for the nodes set here are the same IDs which are used in the OnSkeletonStreamCallback, this allows us to create the link between Manus Core's data and the data we enter here.
Definition at line 1748 of file SDKClient.cpp.
ClientReturnCode ShutDown | ( | ) |
When you are done with the SDK, don't forget to nicely shut it down this will close all connections to the host, close any threads and clean up after itself after this is called it is expected to exit the client program. If not it needs to call initialize again.
Definition at line 152 of file SDKClient.cpp.
|
protected |
Definition at line 2525 of file SDKClient.cpp.
|
protected |
This support function is used to unload a skeleton from Core.
Definition at line 1961 of file SDKClient.cpp.
|
protectedvirtual |
Some things happen before every display update, no matter what state. They happen here, such as the updating of the landscape and the generated tracker.
Definition at line 717 of file SDKClient.cpp.
|
protected |
Definition at line 204 of file SDKClient.hpp.
|
protected |
Definition at line 233 of file SDKClient.hpp.
|
protected |
Definition at line 185 of file SDKClient.hpp.
|
protected |
Definition at line 179 of file SDKClient.hpp.
|
protected |
Definition at line 183 of file SDKClient.hpp.
|
protected |
Definition at line 181 of file SDKClient.hpp.
|
protected |
Definition at line 182 of file SDKClient.hpp.
|
protected |
Definition at line 180 of file SDKClient.hpp.
|
protected |
Definition at line 190 of file SDKClient.hpp.
|
protected |
Definition at line 229 of file SDKClient.hpp.
|
protected |
Definition at line 243 of file SDKClient.hpp.
|
protected |
Definition at line 244 of file SDKClient.hpp.
|
protected |
Definition at line 205 of file SDKClient.hpp.
|
protected |
Definition at line 196 of file SDKClient.hpp.
|
protected |
Definition at line 241 of file SDKClient.hpp.
|
protected |
Definition at line 239 of file SDKClient.hpp.
|
protected |
Definition at line 222 of file SDKClient.hpp.
|
protected |
Definition at line 230 of file SDKClient.hpp.
|
protected |
Definition at line 212 of file SDKClient.hpp.
|
protected |
Definition at line 201 of file SDKClient.hpp.
|
protected |
Definition at line 227 of file SDKClient.hpp.
|
protected |
Definition at line 240 of file SDKClient.hpp.
|
protected |
Definition at line 217 of file SDKClient.hpp.
|
protected |
Definition at line 197 of file SDKClient.hpp.
|
protected |
Definition at line 188 of file SDKClient.hpp.
|
protected |
Definition at line 176 of file SDKClient.hpp.
|
protected |
Definition at line 231 of file SDKClient.hpp.
|
protected |
Definition at line 210 of file SDKClient.hpp.
|
protected |
Definition at line 200 of file SDKClient.hpp.
|
protected |
Definition at line 198 of file SDKClient.hpp.
|
protected |
Definition at line 208 of file SDKClient.hpp.
|
protected |
Definition at line 194 of file SDKClient.hpp.
|
protected |
Definition at line 193 of file SDKClient.hpp.
|
protected |
Definition at line 218 of file SDKClient.hpp.
|
protected |
Definition at line 215 of file SDKClient.hpp.
|
protected |
Definition at line 202 of file SDKClient.hpp.
|
protected |
Definition at line 187 of file SDKClient.hpp.
|
protected |
Definition at line 225 of file SDKClient.hpp.
|
protected |
Definition at line 226 of file SDKClient.hpp.
|
protected |
Definition at line 224 of file SDKClient.hpp.
|
protected |
Definition at line 213 of file SDKClient.hpp.
|
protected |
Definition at line 221 of file SDKClient.hpp.
|
protected |
Definition at line 236 of file SDKClient.hpp.
|
protected |
Definition at line 237 of file SDKClient.hpp.
|
protected |
Definition at line 235 of file SDKClient.hpp.
|
staticprotected |
Definition at line 174 of file SDKClient.hpp.
|
strong |
Values that can be returned by this application.
Definition at line 46 of file SDKClient.hpp.
|
strong |
The current state of the client.
Definition at line 32 of file SDKClient.hpp.
Definition at line 13 of file ClientPlatformSpecificTypes.hpp.
|
constexpr |
Constant expression used to define the time between two updates of the temporary skeleton count printing.
Definition at line 29 of file SDKClient.hpp.
|
constexpr |
Constant expression used to define the time between two possible haptics commands sent.
Definition at line 26 of file SDKClient.hpp.
|
constexpr |
Constant expression: number of hands supported by demo.
Definition at line 23 of file SDKClient.hpp.