public RealsenseManager(bool isDataOnly) { sm = RS.SenseManager.CreateInstance(); if (!isDataOnly) { rgbReader = RS.SampleReader.Activate(sm); depthReader = RS.SampleReader.Activate(sm); rgbReader.EnableStream(RS.StreamType.STREAM_TYPE_COLOR); depthReader.EnableStream(RS.StreamType.STREAM_TYPE_DEPTH); rgbReader.SampleArrived += RgbReader_SampleArrived; depthReader.SampleArrived += DepthReader_SampleArrived; } // config hand handModule = HandModule.Activate(sm); handConfig = handModule.CreateActiveConfiguration(); handConfig.TrackedJointsEnabled = true; handConfig.StabilizerEnabled = true; handConfig.TrackingMode = TrackingModeType.TRACKING_MODE_FULL_HAND; handConfig.ApplyChanges(); handData = handModule.CreateOutput(); handModule.FrameProcessed += HandModule_FrameProcessed; }
// Setup Hand Configuration void SetupHandConfiguration() { handConfiguration = handModule.CreateActiveConfiguration(); if (handConfiguration == null) { throw new System.Exception("Failed Creating Hand Configuration"); } else { Debug.Log(TAG + "Successful Creating Hand Configuration"); CreateHandData(); } }
public void SetUpHandModule() { /* Set Module */ handModule = HandModule.Activate(manager.SenseManager); if (handModule == null) { manager.SetStatus("Failed Loading Module"); manager.Stop = true; return; } HandConfiguration = handModule.CreateActiveConfiguration(); if (HandConfiguration == null) { manager.SetStatus("Failed Create Configuration"); manager.Stop = true; return; } handData = handModule.CreateOutput(); if (handData == null) { manager.SetStatus("Failed Create Output"); HandConfiguration.Dispose(); manager.Stop = true; return; } HandConfiguration.TrackingMode = TrackingModeType.TRACKING_MODE_FULL_HAND; HandConfiguration.TrackedJointsEnabled = true; HandConfiguration.EnableJointSpeed(JointType.JOINT_INDEX_TIP, JointSpeedType.JOINT_SPEED_ABSOLUTE, 20); HandConfiguration.StabilizerEnabled = true; HandConfiguration.EnableAllAlerts(); HandConfiguration.SegmentationImageEnabled = false; HandConfiguration.SmoothingValue = 1; // The value is from 0(not smoothed) to 1(smoothed motion). HandConfiguration.ApplyChanges(); }