C++ SDK for MANUS Core 2.0
Loading...
Searching...
No Matches
SDKMinimalClient

Classes

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  SDKMinimalClient
 

Enumerations

enum class  ClientReturnCode : int {
  ClientReturnCode_Success = 0 , ClientReturnCode_FailedPlatformSpecificInitialization , ClientReturnCode_FailedToResizeWindow , ClientReturnCode_FailedToInitialize ,
  ClientReturnCode_FailedToFindHosts , ClientReturnCode_FailedToConnect , ClientReturnCode_UnrecognizedStateEncountered , ClientReturnCode_FailedToShutDownSDK ,
  ClientReturnCode_FailedPlatformSpecificShutdown , ClientReturnCode_FailedToRestart , ClientReturnCode_FailedWrongTimeToGetData , ClientReturnCode_MAX_CLIENT_RETURN_CODE_SIZE ,
  ClientReturnCode_Success = 0 , ClientReturnCode_FailedPlatformSpecificInitialization , ClientReturnCode_FailedToResizeWindow , ClientReturnCode_FailedToInitialize ,
  ClientReturnCode_FailedToFindHosts , ClientReturnCode_FailedToConnect , ClientReturnCode_UnrecognizedStateEncountered , ClientReturnCode_FailedToShutDownSDK ,
  ClientReturnCode_FailedPlatformSpecificShutdown , ClientReturnCode_FailedToRestart , ClientReturnCode_FailedWrongTimeToGetData , ClientReturnCode_MAX_CLIENT_RETURN_CODE_SIZE
}
 Values that can be returned by this application. More...
 

Detailed Description


Class Documentation

◆ ClientSkeleton

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< SkeletonNodenodes
 
SkeletonNodenodes = nullptr
 

Constructor & Destructor Documentation

◆ ~ClientSkeleton()

~ClientSkeleton ( )
inline

Definition at line 41 of file SDKMinimalClient.hpp.

Member Data Documentation

◆ info

Definition at line 75 of file SDKClient.hpp.

◆ nodes [1/2]

std::vector<SkeletonNode> nodes

Definition at line 76 of file SDKClient.hpp.

◆ nodes [2/2]

SkeletonNode* nodes = nullptr

Definition at line 39 of file SDKMinimalClient.hpp.

◆ ClientSkeletonCollection

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< ClientSkeletonskeletons
 

Member Data Documentation

◆ skeletons

std::vector< ClientSkeleton > skeletons

Definition at line 83 of file SDKClient.hpp.

◆ SDKMinimalClient

class SDKMinimalClient

Definition at line 54 of file SDKMinimalClient.hpp.

Inherits SDKClientPlatformSpecific.

Public Member Functions

 SDKMinimalClient ()
 
 ~SDKMinimalClient ()
 
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 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...
 
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...
 
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...
 
void Run ()
 main loop More...
 

Static Public Member Functions

static void OnConnectedCallback (const ManusHost *const p_Host)
 
static void OnSkeletonStreamCallback (const SkeletonStreamInfo *const p_SkeletonStreamInfo)
 This gets called when the client is connected to manus core. More...
 

Protected Member Functions

ClientReturnCode ConnectLocally ()
 the client will now try to connect to manus core via the SDK. 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...
 
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...
 
- Protected Member Functions inherited from SDKClientPlatformSpecific
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 ManusVec3 CreateManusVec3 (float p_X, float p_Y, float p_Z)
 
- Static Protected Member Functions inherited from SDKClientPlatformSpecific
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_Running = true
 
std::mutex m_SkeletonMutex
 
ClientSkeletonCollectionm_NextSkeleton = nullptr
 
ClientSkeletonCollectionm_Skeleton = nullptr
 
uint32_t m_FrameCounter = 0
 

Static Protected Attributes

static SDKMinimalClients_Instance = nullptr
 
- Static Protected Attributes inherited from SDKClientPlatformSpecific
static const std::string s_SlashForFilesystemPath = "/"
 The slash character that is used in the filesystem. More...
 

Constructor & Destructor Documentation

◆ SDKMinimalClient()

Definition at line 27 of file SDKMinimalClient.cpp.

◆ ~SDKMinimalClient()

Definition at line 32 of file SDKMinimalClient.cpp.

Member Function Documentation

◆ ConnectLocally()

ClientReturnCode ConnectLocally ( )
protected

the client will now try to connect to manus core via the SDK.

Definition at line 175 of file SDKMinimalClient.cpp.

◆ CreateManusVec3()

ManusVec3 CreateManusVec3 ( float  p_X,
float  p_Y,
float  p_Z 
)
staticprotected

Definition at line 285 of file SDKMinimalClient.cpp.

◆ CreateNodeSetup()

NodeSetup CreateNodeSetup ( uint32_t  p_Id,
uint32_t  p_ParentId,
float  p_PosX,
float  p_PosY,
float  p_PosZ,
std::string  p_Name 
)
protected

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.

Parameters
p_Idthe id of the created node setup
p_ParentIdthe id of the node parent
p_PosXX 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_PosYY 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_PosZZ 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_Namethe name of the node setup
Returns
the generated node setup

Definition at line 268 of file SDKMinimalClient.cpp.

◆ Initialize()

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 39 of file SDKMinimalClient.cpp.

◆ InitializeSDK()

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.

Definition at line 57 of file SDKMinimalClient.cpp.

◆ LoadTestSkeleton()

void LoadTestSkeleton ( )
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 221 of file SDKMinimalClient.cpp.

◆ OnConnectedCallback()

static void OnConnectedCallback ( const ManusHost *const  p_Host)
static

◆ OnSkeletonStreamCallback()

void OnSkeletonStreamCallback ( const SkeletonStreamInfo *const  p_SkeletonStreamInfo)
static

This gets called when the client is connected to manus core.

Parameters
p_SkeletonStreamInfocontains the meta data on how much data regarding the skeleton we need to get from the SDK.

Definition at line 461 of file SDKMinimalClient.cpp.

◆ RegisterAllCallbacks()

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.

Definition at line 116 of file SDKMinimalClient.cpp.

◆ Run()

void Run ( )

main loop

Definition at line 130 of file SDKMinimalClient.cpp.

◆ SetupHandChains()

bool SetupHandChains ( uint32_t  p_SklIndex)
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.

Parameters
p_SklIndexThe index of the temporary skeleton on which the chains will be added.
Returns
Returns true if everything went fine, otherwise returns false.

Definition at line 376 of file SDKMinimalClient.cpp.

◆ SetupHandNodes()

bool SetupHandNodes ( uint32_t  p_SklIndex)
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 300 of file SDKMinimalClient.cpp.

◆ ShutDown()

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 97 of file SDKMinimalClient.cpp.

Member Data Documentation

◆ m_FrameCounter

uint32_t m_FrameCounter = 0
protected

Definition at line 86 of file SDKMinimalClient.hpp.

◆ m_NextSkeleton

ClientSkeletonCollection* m_NextSkeleton = nullptr
protected

Definition at line 83 of file SDKMinimalClient.hpp.

◆ m_Running

bool m_Running = true
protected

Definition at line 79 of file SDKMinimalClient.hpp.

◆ m_Skeleton

ClientSkeletonCollection* m_Skeleton = nullptr
protected

Definition at line 84 of file SDKMinimalClient.hpp.

◆ m_SkeletonMutex

std::mutex m_SkeletonMutex
protected

Definition at line 81 of file SDKMinimalClient.hpp.

◆ s_Instance

SDKMinimalClient * s_Instance = nullptr
staticprotected

Definition at line 78 of file SDKMinimalClient.hpp.

Enumeration Type Documentation

◆ ClientReturnCode

enum class ClientReturnCode : int
strong

Values that can be returned by this application.

Enumerator
ClientReturnCode_Success 
ClientReturnCode_FailedPlatformSpecificInitialization 
ClientReturnCode_FailedToResizeWindow 
ClientReturnCode_FailedToInitialize 
ClientReturnCode_FailedToFindHosts 
ClientReturnCode_FailedToConnect 
ClientReturnCode_UnrecognizedStateEncountered 
ClientReturnCode_FailedToShutDownSDK 
ClientReturnCode_FailedPlatformSpecificShutdown 
ClientReturnCode_FailedToRestart 
ClientReturnCode_FailedWrongTimeToGetData 
ClientReturnCode_MAX_CLIENT_RETURN_CODE_SIZE 
ClientReturnCode_Success 
ClientReturnCode_FailedPlatformSpecificInitialization 
ClientReturnCode_FailedToResizeWindow 
ClientReturnCode_FailedToInitialize 
ClientReturnCode_FailedToFindHosts 
ClientReturnCode_FailedToConnect 
ClientReturnCode_UnrecognizedStateEncountered 
ClientReturnCode_FailedToShutDownSDK 
ClientReturnCode_FailedPlatformSpecificShutdown 
ClientReturnCode_FailedToRestart 
ClientReturnCode_FailedWrongTimeToGetData 
ClientReturnCode_MAX_CLIENT_RETURN_CODE_SIZE 

Definition at line 17 of file SDKMinimalClient.hpp.