C++ SDK for MANUS Core 2.0
Loading...
Searching...
No Matches
SDKMinimalClient.hpp
Go to the documentation of this file.
1#ifndef _SDK_MINIMAL_CLIENT_HPP_
2#define _SDK_MINIMAL_CLIENT_HPP_
3
4
5// Set up a Doxygen group.
12#include "ManusSDK.h"
13#include <mutex>
14#include <vector>
15
17enum class ClientReturnCode : int
18{
30
32};
33
36{
37public:
39 SkeletonNode* nodes = nullptr;
40
42 {
43 if (nodes != nullptr)delete[] nodes;
44 }
45};
46
49{
50public:
51 std::vector<ClientSkeleton> skeletons;
52};
53
55{
56public:
63 void Run();
64
65 static void OnConnectedCallback(const ManusHost* const p_Host);
66
67 static void OnSkeletonStreamCallback(const SkeletonStreamInfo* const p_SkeletonStreamInfo);
68
69protected:
70
72 bool SetupHandNodes(uint32_t p_SklIndex);
73 bool SetupHandChains(uint32_t p_SklIndex);
74 void LoadTestSkeleton();
75 NodeSetup CreateNodeSetup(uint32_t p_Id, uint32_t p_ParentId, float p_PosX, float p_PosY, float p_PosZ, std::string p_Name);
76 static ManusVec3 CreateManusVec3(float p_X, float p_Y, float p_Z);
77
79 bool m_Running = true;
80
81 std::mutex m_SkeletonMutex;
82
85
86 uint32_t m_FrameCounter = 0;
87};
88
89// Close the Doxygen group.
91#endif
Contains information for connecting to a host running Manus Core. Note that if one of these values is...
A 3D vector, used for translations.
Stores the node setup information. Each node represents a segment of the skeleton that can be animate...
Stores the information regarding the skeletons that have been added to Manus Core.
Stores the information regarding each skeleton node. The transform is defined as a local or global tr...
Stores the information sent by the skeleton stream.
SkeletonInfo info
Definition: SDKClient.hpp:75
std::vector< SkeletonNode > nodes
Definition: SDKClient.hpp:76
std::vector< ClientSkeleton > skeletons
Definition: SDKClient.hpp:83
Used to store the information about the final animated skeletons.
Definition: SDKClient.hpp:73
Used to store all the final animated skeletons received from Core.
Definition: SDKClient.hpp:81
static SDKMinimalClient * s_Instance
ClientReturnCode ShutDown()
When you are done with the SDK, don't forget to nicely shut it down this will close all connections t...
ClientSkeletonCollection * m_NextSkeleton
ClientReturnCode Initialize()
Initialize the sample console and the SDK. This function attempts to resize the console window and th...
ClientReturnCode InitializeSDK()
Initialize the sdk, register the callbacks and set the coordinate system. This needs to be done befor...
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 ani...
ClientReturnCode RegisterAllCallbacks()
Used to register the callbacks between sdk and core. Callbacks that are registered functions that get...
static void OnConnectedCallback(const ManusHost *const p_Host)
void LoadTestSkeleton()
This function sets up a very minimalistic hand skeleton. In order to have any 3d positional/rotationa...
ClientReturnCode ConnectLocally()
the client will now try to connect to manus core via the SDK.
void Run()
main loop
std::mutex m_SkeletonMutex
static ManusVec3 CreateManusVec3(float p_X, float p_Y, float p_Z)
bool SetupHandNodes(uint32_t p_SklIndex)
This support function sets up the nodes for the skeleton hand In order to have any 3d positional/rota...
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 cor...
static void OnSkeletonStreamCallback(const SkeletonStreamInfo *const p_SkeletonStreamInfo)
This gets called when the client is connected to manus core.
ClientSkeletonCollection * m_Skeleton
ClientReturnCode
Values that can be returned by this application.
@ ClientReturnCode_MAX_CLIENT_RETURN_CODE_SIZE
@ ClientReturnCode_FailedWrongTimeToGetData
@ ClientReturnCode_FailedPlatformSpecificInitialization
@ ClientReturnCode_FailedToConnect
@ ClientReturnCode_FailedToFindHosts
@ ClientReturnCode_FailedToRestart
@ ClientReturnCode_FailedToShutDownSDK
@ ClientReturnCode_UnrecognizedStateEncountered
@ ClientReturnCode_FailedToInitialize
@ ClientReturnCode_FailedToResizeWindow
@ ClientReturnCode_FailedPlatformSpecificShutdown