Hermes SDK Documentation
Public Member Functions | List of all members
HermesSDK::CareTaker Class Reference

Public Member Functions

 CareTaker (const std::string &clientName, const std::string &clientInfo, filterSetupCallback &_onFilterSetup, deviceDataCallback &_onDeviceData, deviceLandscapeCallback &_onDeviceLandscape, polygonDataCallback &_onPolygonData, trackingDataCallback &_onTrackingData, errorMessageCallback &onError, connectedToCoreCallback &_onConnectedToCore, disconnectedFromCoreCallback &_onDisconnectedFromCore)
 
void Connect (const Hermes::Protocol::ServiceRoute &_coordinatorRoute)
 
void Stop ()
 
bool Rumble (uint32_t deviceId, float unitStrength, uint16_t durationInMilliseconds)
 
bool SendHapticData (uint32_t _dongleId, Hermes::Protocol::HandType _handType, const std::array< float, 5 > &_powers)
 
bool GetFilterInventory (Hermes::Protocol::FilterInventory &inventory) const
 
Hermes::Protocol::PipelineGetActivePipeline ()
 
bool SetPipeline (Hermes::Protocol::Pipeline *pipeline)
 
bool IsRunning ()
 
bool GetCoreVersion (Hermes::Protocol::Version &version)
 
bool GetAllUsers (Hermes::Protocol::UserCollection &UserCollection)
 
bool UpdateTrackers (const Hermes::Protocol::TrackerData &TrackerData)
 
bool AddSkeleton (Hermes::Protocol::Polygon::Skeleton &Skeleton)
 
bool RemoveSkeleton (Hermes::Protocol::Polygon::RemoveSkeletonArgs &_Args)
 
bool SetSkeletonTarget (Hermes::Protocol::Polygon::SetTargetArgs &_Args)
 
bool SetSkeletonSettings (Hermes::Protocol::Polygon::Retargeting::SettingsArgs &_Args)
 
bool AddTargetSkeleton (Hermes::Protocol::Polygon::TargetSkeleton &_Skeleton)
 
bool RemoveTargetSkeleton (std::string &_Name)
 
void UpdateTargetSkeleton (Hermes::Protocol::Polygon::TargetSkeleton &_Skeleton)
 
Hermes::Protocol::Polygon::Version GetCompatiblePolygonVersion ()
 
Hermes::Protocol::ServiceRouteGetGRPCPresetPort ()
 
int GetHivePort ()
 

Constructor & Destructor Documentation

◆ CareTaker()

HermesSDK::CareTaker::CareTaker ( const std::string &  _clientName,
const std::string &  _clientInfo,
filterSetupCallback _onFilterSetup,
deviceDataCallback _onDeviceData,
deviceLandscapeCallback _onDeviceLandscape,
polygonDataCallback _onPolygonData,
trackingDataCallback _onTrackingData,
errorMessageCallback _onError,
connectedToCoreCallback _onConnectedToCoreCallback,
disconnectedFromCoreCallback _onDisconnectedFromCoreCallback 
)

Caretaker constructor.

Parameters
_clientNameThe client name that will be advertised to the Hermes host
_clientInfoThe client description that will be advertised to the Hermes host
_onFilterSetupCallback that will be called when setting up the filters
_onDeviceDataCallback that will be called when devicedata is available
_onDeviceLandscapeCallback that will be called when landscape (connected devices) data is available
_onPolygonDataCallback that will be called when Polygon data is available
_onTrackingDataCallback that will be called when tracking data is available
_onErrorCallback that will be called when there is an error encountered

Member Function Documentation

◆ Connect()

void HermesSDK::CareTaker::Connect ( const Hermes::Protocol::ServiceRoute _coordinatorRoute)

Connects to a Hermes instance using the specificied service route. Logs in, starts a session, and sets up a filter pipeline based on the Filter Pipeline Callback. Then spawns threads to handle incoming device data, incoming landscape data, and keep-alive communication with Hermes.

Parameters
_coordinatorRouteA ServiceRoute to a Hermes Instance

◆ GetActivePipeline()

Hermes::Protocol::Pipeline * HermesSDK::CareTaker::GetActivePipeline ( )

Gets the currently active filter pipeline.

Returns
A pointer to a Pipeline object detailing the pipeline that is currently active.

◆ GetFilterInventory()

bool HermesSDK::CareTaker::GetFilterInventory ( Hermes::Protocol::FilterInventory _inventory) const

Gets the list of available filters to apply. This is the list of filters currently available to Hermes, filled in to the provided inventory. From here you can add them to your filter pipeline by name.

Parameters
_inventoryInventory to fill with all available filters
Returns
True on a succesful fetch, or false otherwise.

◆ IsRunning()

bool HermesSDK::CareTaker::IsRunning ( )

Gets the current running state of the CareTaker

Returns
True if the CareTaker is running, false otherwise

◆ Rumble()

bool HermesSDK::CareTaker::Rumble ( uint32_t  _deviceId,
float  _unitStrength,
uint16_t  _durationInMilliseconds 
)

Sends a rumble command to the specified glove. Note that this is the wrist actuator - Prime Haptics modules use a different interface for more precise feedback.

Parameters
_deviceIdThe device id of the glove to rumble
_unitStrengthStrength of the rumble, from 0.0 to 1.0
_durationInMillisecondsDuration to rumble the glove for
Returns
True on a successful send, or false otherwise.

◆ SendHapticData()

bool HermesSDK::CareTaker::SendHapticData ( uint32_t  _dongleId,
Hermes::Protocol::HandType  _handType,
const std::array< float, 5 > &  _powers 
)

Sends haptic data to the specified haptics module Internally, this opens a socket (if one is not open already) to communicate with Hermes for extra responsiveness.

Parameters
_dongleIdThe id of the haptics dongle to send the data to.
_handTypeLeft, right, or unknown (which will send data to both hands)
_powersAn array of 5 floats [0.0, 1.0], thumb to pinky, with the strength of vibration for each actuator
Returns
True on a successful send, or false otherwise

◆ SetPipeline()

bool HermesSDK::CareTaker::SetPipeline ( Hermes::Protocol::Pipeline _pipeline)

Sets the currently active pipeline.

Parameters
_pipelinePointer to a Pipeline object to commit.
Returns
True on a successful commit, or false otherwise

◆ Stop()

void HermesSDK::CareTaker::Stop ( )

Stops caretaker. Joins all threads, then logs out of its session with Hermes.


The documentation for this class was generated from the following files: