/// <summary>
        /// Checks if the depth sensor is working.
        /// </summary>
        /// <returns></returns>
        private bool DepthSensorWorking()
        {
            bool depthSensorConnected;
            bool depthSensorInitialized;

            MetaSensors.GetSensorConnectionInfo(SensorType.IMU, 0, out depthSensorConnected, out depthSensorInitialized);
            return(depthSensorConnected && depthSensorInitialized);
        }
Ejemplo n.º 2
0
 ///<summary>
 ///Worker function for fetching the RGB in a separate thread.
 ///</summary>
 private void FetchRgb()
 {
     while (_fetchFlag)
     {
         // Get the RGB data every second frame.
         _waitHandle.WaitOne();
         if (_fetchFlag)         // Don't do it if we are shutting down
         {
             MetaSensors.GetRGB(_rgbBuffer);
             _fetched = true;
         }
     }
 }
        /// <summary>
        /// Check if the important sensors have been initialized
        /// </summary>
        /// <returns></returns>
        private bool SensorsInitialized()
        {
            bool rightImuInitialized  = false;
            bool leftMonoInitialized  = false;
            bool rightMonoInitialized = false;
            bool unused = false;

            MetaSensors.GetSensorConnectionInfo(SensorType.IMU, 0, out unused, out rightImuInitialized);
            MetaSensors.GetSensorConnectionInfo(SensorType.Monochrome, 0, out unused, out rightMonoInitialized);
            MetaSensors.GetSensorConnectionInfo(SensorType.Monochrome, 1, out unused, out leftMonoInitialized);

            return(rightImuInitialized && leftMonoInitialized && rightMonoInitialized);
        }
Ejemplo n.º 4
0
        private void ConstructSensors(MetaFactoryPackage package)
        {
            var deviceInfo = new DeviceInfo();

            deviceInfo.imuModel    = IMUModel.MPU9150Serial;
            deviceInfo.cameraModel = CameraModel.DS325;
            deviceInfo.depthFps    = 60;
            deviceInfo.depthHeight = 240;
            deviceInfo.depthWidth  = 320;
            deviceInfo.colorFps    = 30;
            deviceInfo.colorHeight = 720;
            deviceInfo.colorWidth  = 1280;

            var metaSensors = new MetaSensors(deviceInfo, _dataAcquisitionSystem, _sensorPlaybackPath);

            package.EventReceivers.Add(metaSensors);

            //Sensor Messages
            MetaSensorFailureMessages messages = new MetaSensorFailureMessages();

            package.EventReceivers.Add(messages);
            package.MetaContext.Add(messages);
        }