DINO-Unity21
Sample Unity 2021 Project for HL2-DINO
Loading...
Searching...
No Matches
ResearchModeController Class Reference
Inheritance diagram for ResearchModeController:
[legend]
Collaboration diagram for ResearchModeController:
[legend]

Public Member Functions

void StopDepthSensor ()
 Function to flag a shutdown for the depth sensor loop on the DLL side.
 
void SwitchSensorDisplayOnOff ()
 Public toggle function to tell the DLL side if we should be stashing sensor images for display or not.
 
void FetchProfilerString ()
 Profiler data as recorded by the Shiny library on the C++ DLL.
 

Public Attributes

UnityToolManager ToolManagerScript
 Should be set from inspector. Class is responsible for using tool pose data obtained from the DLL to set GameObject transforms in Unity.
 
string JSONFilename = "toolConfig.json"
 

Private Member Functions

void Start ()
 
string ToolConfigJSONSetup ()
 Update class member vars to point to correct locations for where the tool config JSON file is.
 
void ResearchModeSetup (string toolsetString)
 Function which initialises DLL functions and instructs DLL which tools to track.
 
void ImageTexturesSetup ()
 Attaching Unity GameObjects to their corresponding textures used to visualise images passed out of the DLL.
 
void GrabLatestSensorImages ()
 Function for receving the latest set of processed sensor images from the HL2, purely for visualisation purposes. It should be noted the numeric values of these images have no meaningful physical information like depth info.
 
void GrabLatestToolDictionary ()
 Function for receiving tool pose matrices from the IR tracking class running on board the HL2.
 
void LateUpdate ()
 
void OnApplicationFocus (bool focus)
 

Private Attributes

string JSONStorageFolder = ""
 

Unity variables for visualising sensor images

GameObject depthPreviewPlane = null
 
GameObject abImagePreviewPlane = null
 
TMPro.TextMeshProUGUI ConsoleDebugTextMesh
 
Material depthMediaMaterial = null
 
Texture2D depthMediaTexture = null
 
byte[] depthFrameData = null
 
Material abImageMediaMaterial = null
 
Texture2D abMediaTexture = null
 
byte[] abFrameData = null
 
bool SensorImagesDisplaying = true
 Use to internally track if sensor images are updated, but also pass this into HL2ResearchMode to tell it if it should continue/stop processing sensor images for display purposes.
 

Member Function Documentation

◆ FetchProfilerString()

void ResearchModeController.FetchProfilerString ( )
inline

Profiler data as recorded by the Shiny library on the C++ DLL.

Proper thread safety has not been robustly tested, would suggest avoiding numerous calls from multiple sources, especially as you're dumping to a file.

◆ ResearchModeSetup()

void ResearchModeController.ResearchModeSetup ( string  toolsetString)
inlineprivate

Function which initialises DLL functions and instructs DLL which tools to track.

Parameters
toolsetStringIdeally a JSON-formatted string of marker/tool triplet locations

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