Class Manus::CommunicationHub
ClassList > Manus > CommunicationHub
This class is responsible for the communication between Manus Core and the plugin. This component should not be added to the scene manually. Most of these functions are not to be accessed directly.
Classes
Type | Name |
---|---|
class | ErgonomicsEvent |
struct | ErgonomicsStream |
class | GestureEvent |
struct | Landscape |
class | LandscapeEvent |
class | RawSkeletonEvent |
class | SkeletonEvent |
class | SystemMessageEvent |
class | TrackerEvent |
Public Types
Type | Name |
---|---|
enum | State |
Public Attributes
Type | Name |
---|---|
UnityEvent | onConnectedToCore = = new UnityEvent() |
UnityEvent | onDisconnectedFromCore = = new UnityEvent() |
ErgonomicsEvent | onErgonomicsData = = new ErgonomicsEvent() |
GestureEvent | onGestureData = = new GestureEvent() |
UnityEvent | onHostsFound = = new UnityEvent() |
LandscapeEvent | onLandscapeEvent = = new LandscapeEvent() |
RawSkeletonEvent | onRawSkeletonData = = new RawSkeletonEvent() |
SkeletonEvent | onSkeletonData = = new SkeletonEvent() |
SystemMessageEvent | onSystemMessageEvent = = new SystemMessageEvent() |
TrackerEvent | onTrackerData = = new TrackerEvent() |
Public Properties
Type | Name |
---|---|
property CoreSDK.? ManusHost | currentHost |
property State | currentState |
Public Static Properties
Type | Name |
---|---|
property uint | completeSkeletonIndex |
property ErgonomicsStream | ergonomicsData |
property Landscape | landscape |
Public Functions
Type | Name |
---|---|
void | AddChain (Skeleton p_Skeleton, CoreSDK.ChainSetup p_ChainSetup) Adds a manually created chain to Manus Core skeleton. |
bool | AllocateChains (Skeleton p_Skeleton) Setup chains on skeleton. |
bool | AutoConnect () Start searching for Manus Core hosts on network. |
void | ChangeSettings (bool p_AutoConnect, bool p_ConnectGRPC, bool p_ConnectLocallyOnly) Change Manus Manager settings. |
void | ClearAllTemporarySkeletons () Removes all temporary skeletons from the temporary skeleton list. If you actually get here you've probably been messing with too many skeletons without finishing them. |
CommunicationHub () Initial setup for communication hub. |
|
void | Connect (CoreSDK.ManusHost p_Host) Connect to a specific Manus Core host. |
bool | ConnectGRPC () Connect to Manus Core via GRPC port. |
async Task< bool > | ConnectGRPCAsync () Connect to Manus Core via GRPC port asynchronously. |
bool | ConnectToHost (CoreSDK.ManusHost p_Host) Connect to Manus Core host. |
async Task< bool > | ConnectToHostAsync (CoreSDK.ManusHost p_Host) Connect to Manus Core host asynchronously. |
void | Destroy () Get communication hub ready to be collected by garbage collector. |
void | Disconnect () Set Communication hub to disconnect from Manus Core. |
void | FillSkeletonSendQueue () Fill skeleton queue to later resend to Manus Core when connection is lost. |
uint | FirstAvailableUser () Fetch first available user ID from Manus Core. |
List< CoreSDK.ManusHost > | GetAvailableHostsFound () Get available Manus Core hosts found. |
async Task< List< CoreSDK.ManusHost > > | GetAvailableHostsFoundAsync () Get available hosts found from previous search asynchronously. |
List< CoreSDK.ManusHost > | GetHosts () Fetch found hosts. |
bool | GetIsConnectedToCore () Get whether Manus SDK is connected toManus Core. |
async Task< bool > | GetIsConnectedToCoreAsync () Get whether Manus SDK is connected toManus Core asynchronously. |
uint | GetNumberOfAvailableHostsFound () Get number of available hosts found from previous search. |
async Task< uint > | GetNumberOfAvailableHostsFoundAsync () Get number of available hosts found from previous search asynchronously. |
bool | GetRawSkeletonNodeInfo (uint p_GloveId, out CoreSDK.NodeInfo[] p_NodesInfo) Get the node info for the raw skeleton of a glove. |
virtual bool | GetSkeletonData (Skeleton p_Skeleton, uint p_SklSetupIdx, uint p_SessionId) |
List< CoreSDK.TemporarySkeletonsInfoForSession > | GetTemporarySkeletons () Get all temporary skeletons from Manus Core. |
void | GoToState (State p_State) Set next state for communication hub. |
bool | HasLoadableSkeleton (uint p_TempIdx) Checks if the temporary skeleton has been updated in the tool. |
void | LoadSkeletonFromTool (Skeleton p_Skeleton, uint p_SklSetupIdx) Load in skeleton from development dashboard. |
bool | LoadTemporarySkeleton (Skeleton p_Skeleton, uint p_SklSetupIdx, uint p_SessionId) Load temporary skeleton from Manus Core to plugin skeleton. |
bool | LoadTemporarySkeletonFromFile (Skeleton p_Skeleton, string p_PathName) |
bool | LookForHosts (uint p_WaitSeconds=s_HostFetchWaitDelay, bool p_LocalHostOnly=false) Look for Manus Core hosts on the network. |
async Task< bool > | LookForHostsAsync (uint p_WaitSeconds=s_HostFetchWaitDelay, bool p_LoopbackOnly=false) Look for Manus Core hosts asynchronously. |
void | OnSystemUpdate (CoreSDK.SystemMessage p_SystemMessage) This function is being called when a temporary skeleton has been changed by the tool. |
void | OverwriteChain (Skeleton p_Skeleton, CoreSDK.ChainSetup p_ChainSetup) Overwrite a chain within Manus Core skeleton. |
bool | PrepareSkeleton (Skeleton p_Skeleton) Prepare skeleton. |
bool | RegisterCustomTracker (CustomTracker p_Tracker) Register custom tracker to keep track of and update. |
void | RegisterTrackedObject (TrackedObject p_TrackedObject) Register tracked object to keep track of and update. |
void | RemoveLoadableSkeleton (uint p_TempIdx) Remove temporary skeleton after it's been loaded. |
void | RequestState (State p_State) User requests a next state for communication hub. |
bool | SaveTemporarySkeleton (Skeleton p_Skeleton, bool p_IsSkeletonModified) Build a temporary skeleton and save to Manus Core. |
bool | SaveTemporarySkeleton (Skeleton p_Skeleton, List< MeshSetup > p_Meshes, bool p_IsSkeletonModified) Build a temporary skeleton and save to Manus Core. |
bool | SaveTemporarySkeletonToFile (Skeleton p_Skeleton, string p_PathName) |
async Task< bool > | SearchAndFetchHosts () Start searching for Manus Core hosts on network. |
void | SendHapticDataForSkeleton (uint p_SkeletonId, CoreSDK.Side p_HandType, float[] p_Powers) Activate haptics on specific hand given the skeleton id. |
void | SetupSkeleton (Skeleton p_Skeleton) Setup skeleton for Manus Core and load it. |
bool | SetupSkeletonTarget (Skeleton p_Skeleton) Setup skeleton targeting settings for Manus Core. |
void | UnloadSkeleton (Skeleton p_Skeleton) Unload a skeleton from Manus Core. |
void | UnregisterCustomTracker (CustomTracker p_Tracker) Unregister tracked object to stop updating. |
void | UnregisterTrackedObject (TrackedObject p_TrackedObject) Unregister tracked object to stop updating. |
void | UpdatePlayMode (bool p_PlayMode) Update whether playmode is active or not. |
void | VerifyUpdateLoop () Verify the update loop thread is running else restart it. |
Protected Attributes
Protected Static Attributes
Type | Name |
---|---|
bool | s_Active = = false |
const float | s_HostAutoFindInterval = = 10.0f |
const uint | s_HostFetchWaitDelay = = 1 |
Protected Functions
Type | Name |
---|---|
bool | BuildSkeletonSetup (Skeleton p_Skeleton, out uint p_SklSetupIdx, bool p_QueueForLater) Build skeleton setup for sending to Manus Core. |
async Task< bool > | FindConnection () Handle connection to Manus Core. |
virtual void | InitializeSDK () Initialize the Manus SDK and register needed callbacks. |
void | OnConnectedToCore (CoreSDK.ManusHost p_Host) This function gets called when connection to Manus Core is established. |
void | OnDisconnectedFromCore (CoreSDK.ManusHost p_Host) This function gets called when connection to Manus Core is lost. |
void | OnErgonomicsUpdate (CoreSDK.ErgonomicsStream p_Ergonomics) This function gets called when Ergonomics data is received. |
void | OnGestureUpdate (CoreSDK.GestureStream p_GestureStream) This function gets called when gesture data is received. |
void | OnRawSkeletonUpdate (CoreSDK.RawSkeletonStream p_SkeletonStream) This function gets called when raw skeleton data is received. |
void | OnSkeletonUpdate (CoreSDK.SkeletonStream p_SkeletonStream) This function gets called when skeleton data is received. |
void | OnTrackerUpdate (CoreSDK.TrackerStream p_TrackerStream) This function gets called when tracker data is received. |
virtual void | RegisterCallbacks () Register callbacks for the Manus SDK. |
virtual void | RestartSDK () Temp fix for Manus SDK lingering connection. TODO: Remove when fixed. |
void | RunUpdateLoop () Process the update loop. |
void | SendCustomTracker () Send custom trackers to Manus Core. |
void | ShutDown () Shut down update thread and Manus SDK. |
void | ShutDownSDK () Shuts down the Manus SDK. |
virtual void | StartUp () Starts up update thread and Manus SDK. |
Public Types Documentation
enum State
Public Attributes Documentation
variable onConnectedToCore
variable onDisconnectedFromCore
variable onErgonomicsData
variable onGestureData
variable onHostsFound
variable onLandscapeEvent
variable onRawSkeletonData
variable onSkeletonData
variable onSystemMessageEvent
variable onTrackerData
Public Properties Documentation
property currentHost
property currentState
Public Static Properties Documentation
property completeSkeletonIndex
property ergonomicsData
property landscape
Public Functions Documentation
function AddChain
Adds a manually created chain to Manus Core skeleton.
inline void Manus::CommunicationHub::AddChain (
Skeleton p_Skeleton,
CoreSDK.ChainSetup p_ChainSetup
)
Parameters:
p_Skeleton
Skeleton to add chain top_ChainSetup
Chain setup to add to skeleton
function AllocateChains
Setup chains on skeleton.
Parameters:
p_Skeleton
Skeleton to allocate chains for
function AutoConnect
function ChangeSettings
Change Manus Manager settings.
inline void Manus::CommunicationHub::ChangeSettings (
bool p_AutoConnect,
bool p_ConnectGRPC,
bool p_ConnectLocallyOnly
)
Parameters:
p_AutoConnect
Whether to auto connect on host foundp_ConnectGRPC
Whether to connect via GRPCp_ConnectLocallyOnly
Whether to search only local machine for Manus Core instances
function ClearAllTemporarySkeletons
function CommunicationHub
function Connect
Connect to a specific Manus Core host.
Parameters:
p_Host
Host to connect to
function ConnectGRPC
Connect to Manus Core via GRPC port.
Returns:
Whether action succeeded
function ConnectGRPCAsync
Connect to Manus Core via GRPC port asynchronously.
Returns:
Whether action succeeded
function ConnectToHost
Connect to Manus Core host.
Parameters:
p_Host
Manus Core host to connect to
Returns:
Whether action succeeded
function ConnectToHostAsync
Connect to Manus Core host asynchronously.
Parameters:
p_Host
Manus Core host to connect to
Returns:
Whether action succeeded
function Destroy
function Disconnect
function FillSkeletonSendQueue
function FirstAvailableUser
Fetch first available user ID from Manus Core.
Returns:
First available user id
function GetAvailableHostsFound
Get available Manus Core hosts found.
Returns:
List of hosts found
function GetAvailableHostsFoundAsync
Get available hosts found from previous search asynchronously.
inline async Task< List< CoreSDK.ManusHost > > Manus::CommunicationHub::GetAvailableHostsFoundAsync ()
Returns:
List of hosts found
function GetHosts
Fetch found hosts.
Returns:
Found hosts
function GetIsConnectedToCore
Get whether Manus SDK is connected toManus Core.
Returns:
Connected to core
function GetIsConnectedToCoreAsync
Get whether Manus SDK is connected toManus Core asynchronously.
Returns:
Connected to core
function GetNumberOfAvailableHostsFound
Get number of available hosts found from previous search.
Returns:
Number of available hosts found
function GetNumberOfAvailableHostsFoundAsync
Get number of available hosts found from previous search asynchronously.
Returns:
Number of available hosts found
function GetRawSkeletonNodeInfo
Get the node info for the raw skeleton of a glove.
inline bool Manus::CommunicationHub::GetRawSkeletonNodeInfo (
uint p_GloveId,
out CoreSDK.NodeInfo [] p_NodesInfo
)
Parameters:
p_GloveId
Glove idp_NodesInfo
Array of all the nodes and its parent
Returns:
function GetSkeletonData
inline virtual bool Manus::CommunicationHub::GetSkeletonData (
Skeleton p_Skeleton,
uint p_SklSetupIdx,
uint p_SessionId
)
function GetTemporarySkeletons
Get all temporary skeletons from Manus Core.
inline List< CoreSDK.TemporarySkeletonsInfoForSession > Manus::CommunicationHub::GetTemporarySkeletons ()
Returns:
All temporary skeletons in Manus Core
function GoToState
Set next state for communication hub.
Parameters:
p_State
Next state
function HasLoadableSkeleton
Checks if the temporary skeleton has been updated in the tool.
Parameters:
p_TempIdx
Returns:
function LoadSkeletonFromTool
Load in skeleton from development dashboard.
inline void Manus::CommunicationHub::LoadSkeletonFromTool (
Skeleton p_Skeleton,
uint p_SklSetupIdx
)
Parameters:
p_Skeleton
Skeleton to load top_SklSetupIdx
Skeleton setup index to load from
function LoadTemporarySkeleton
Load temporary skeleton from Manus Core to plugin skeleton.
inline bool Manus::CommunicationHub::LoadTemporarySkeleton (
Skeleton p_Skeleton,
uint p_SklSetupIdx,
uint p_SessionId
)
Parameters:
p_Skeleton
Skeleton to load top_SklSetupIdx
Skeleton setup index to load fromp_SessionId
Session ID to load from
Returns:
Whether action succeeded
function LoadTemporarySkeletonFromFile
inline bool Manus::CommunicationHub::LoadTemporarySkeletonFromFile (
Skeleton p_Skeleton,
string p_PathName
)
function LookForHosts
Look for Manus Core hosts on the network.
inline bool Manus::CommunicationHub::LookForHosts (
uint p_WaitSeconds=s_HostFetchWaitDelay,
bool p_LocalHostOnly=false
)
Parameters:
p_WaitSeconds
Amount of time to search for in secondsp_LocalHostOnly
Whether to check for only local Manus Core instances
Returns:
Whether action failed or not
function LookForHostsAsync
Look for Manus Core hosts asynchronously.
inline async Task< bool > Manus::CommunicationHub::LookForHostsAsync (
uint p_WaitSeconds=s_HostFetchWaitDelay,
bool p_LoopbackOnly=false
)
Parameters:
p_WaitSeconds
Amount of time to search for in secondsp_LoopbackOnly
Whether to check for only local Manus Core instances
Returns:
Whether action s
function OnSystemUpdate
This function is being called when a temporary skeleton has been changed by the tool.
Parameters:
p_SystemMessage
function OverwriteChain
Overwrite a chain within Manus Core skeleton.
inline void Manus::CommunicationHub::OverwriteChain (
Skeleton p_Skeleton,
CoreSDK.ChainSetup p_ChainSetup
)
Parameters:
p_Skeleton
Skeleton to modify chain inp_ChainSetup
Chain setup to add to skeleton
function PrepareSkeleton
Prepare skeleton.
Parameters:
p_Skeleton
Skeleton to allocate chains for
function RegisterCustomTracker
Register custom tracker to keep track of and update.
Parameters:
p_Tracker
Custom tracker to register
function RegisterTrackedObject
Register tracked object to keep track of and update.
Parameters:
p_TrackedObject
Tracked object to register
function RemoveLoadableSkeleton
Remove temporary skeleton after it's been loaded.
Parameters:
p_TempIdx
function RequestState
User requests a next state for communication hub.
Parameters:
p_State
Next state
function SaveTemporarySkeleton [1/2]
Build a temporary skeleton and save to Manus Core.
inline bool Manus::CommunicationHub::SaveTemporarySkeleton (
Skeleton p_Skeleton,
bool p_IsSkeletonModified
)
Parameters:
p_Skeleton
Skeleton to build and loadp_IsSkeletonModified
Whether skeleton has been modified
function SaveTemporarySkeleton [2/2]
Build a temporary skeleton and save to Manus Core.
inline bool Manus::CommunicationHub::SaveTemporarySkeleton (
Skeleton p_Skeleton,
List< MeshSetup > p_Meshes,
bool p_IsSkeletonModified
)
Parameters:
p_Skeleton
Skeleton to build and loadp_Meshes
Meshes that belong to the skeleton and you want to loadp_IsSkeletonModified
Whether skeleton has been modified
function SaveTemporarySkeletonToFile
inline bool Manus::CommunicationHub::SaveTemporarySkeletonToFile (
Skeleton p_Skeleton,
string p_PathName
)
function SearchAndFetchHosts
function SendHapticDataForSkeleton
Activate haptics on specific hand given the skeleton id.
inline void Manus::CommunicationHub::SendHapticDataForSkeleton (
uint p_SkeletonId,
CoreSDK.Side p_HandType,
float[] p_Powers
)
Parameters:
p_SkeletonId
Skeleton idp_HandType
Hand type to send top_Powers
Strength to send to hand
function SetupSkeleton
Setup skeleton for Manus Core and load it.
Parameters:
p_Skeleton
Skeleton to setup and load
function SetupSkeletonTarget
Setup skeleton targeting settings for Manus Core.
Parameters:
p_Skeleton
Skeleton to setup settings for
Returns:
Whether action succeeded
function UnloadSkeleton
Unload a skeleton from Manus Core.
Parameters:
p_Skeleton
Skeleton to unload
function UnregisterCustomTracker
Unregister tracked object to stop updating.
Parameters:
p_Tracker
function UnregisterTrackedObject
Unregister tracked object to stop updating.
Parameters:
p_TrackedObject
Tracked object to remove
function UpdatePlayMode
Update whether playmode is active or not.
Parameters:
p_PlayMode
Whether playmode is active
function VerifyUpdateLoop
Protected Attributes Documentation
variable m_CurrentHost
variable m_CustomTrackers
variable m_HandsChanged
variable m_HostsFound
variable m_LoadableSkeletons
variable m_NextState
variable m_PreviousHost
variable m_RawSkeletonData
variable m_RequestedNextState
variable m_SeachTimer
variable m_SearchingForHosts
variable m_SentTempSkeletons
variable m_SessionId
variable m_SkeletonData
variable m_SkeletonQueue
variable m_Skeletons
variable m_TrackedObjects
variable m_TrackedObjectsQueue
variable m_TrackerData
Protected Static Attributes Documentation
variable s_Active
variable s_HostAutoFindInterval
variable s_HostFetchWaitDelay
Protected Functions Documentation
function BuildSkeletonSetup
Build skeleton setup for sending to Manus Core.
inline bool Manus::CommunicationHub::BuildSkeletonSetup (
Skeleton p_Skeleton,
out uint p_SklSetupIdx,
bool p_QueueForLater
)
Parameters:
p_Skeleton
Skeleton to build setup forp_SklSetupIdx
Skeleton setup index was built forp_QueueForLater
Queue again for later on fail
Returns:
Whether action succeeded
function FindConnection
function InitializeSDK
function OnConnectedToCore
This function gets called when connection to Manus Core is established.
Parameters:
p_Host
Host connected to
function OnDisconnectedFromCore
This function gets called when connection to Manus Core is lost.
Parameters:
p_Host
Host disconnected from
function OnErgonomicsUpdate
This function gets called when Ergonomics data is received.
Parameters:
p_Ergonomics
Ergonomics data received
function OnGestureUpdate
This function gets called when gesture data is received.
Parameters:
p_GestureStream
Gesture data from Manus Core
function OnRawSkeletonUpdate
This function gets called when raw skeleton data is received.
inline void Manus::CommunicationHub::OnRawSkeletonUpdate (
CoreSDK.RawSkeletonStream p_SkeletonStream
)
Parameters:
p_SkeletonStream
Skeleton data from Manus Core
function OnSkeletonUpdate
This function gets called when skeleton data is received.
Parameters:
p_SkeletonStream
Skeleton data from Manus Core
function OnTrackerUpdate
This function gets called when tracker data is received.
Parameters:
p_TrackerStream
Tracker data from Manus Core
function RegisterCallbacks
function RestartSDK
function RunUpdateLoop
function SendCustomTracker
function ShutDown
function ShutDownSDK
function StartUp
The documentation for this class was generated from the following file api/unity-plugin/Scripts/Core/CommunicationHub.cs