示例#1
0
        /// <summary>
        /// Constructs the calibration parameters object.
        /// No calibration data is guaranteed until the DLL which supplies the data does.
        /// </summary>
        private void ConstructNodeLoader(MetaFactoryPackage package)
        {
            NodeLoaderModule pars = new NodeLoaderModule(new NodeLoaderApiProcessor());

            package.MetaContext.Add(pars);
            package.EventReceivers.Add(pars);
        }
示例#2
0
        private void ImportCameraModel()
        {
            NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>();

            if (pars.Profiles.ContainsKey(_key))                         //check if the dict has the key for the calibration you're after.
            {
                Plugin.CalibrationProfile profile = pars.Profiles[_key]; //get the calibration
                _cameraModel = profile.CameraModel;
                UpdateParameters();
            }
        }
示例#3
0
        /// <summary>
        /// Register when Calibration parameters are ready
        /// </summary>
        private void Start()
        {
            _poseMatrix = Matrix4x4.identity;
            //Get the module from the metaContext
            NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>();

            if (pars != null) //the metaContext may not have the module if it was not loaded correctly.
            {
                //Will be called when the parameters have been loaded.
                pars.OnParametersReady += CalibratePose;
            }
        }
示例#4
0
        /// <summary>
        /// Accesses the context and registers the parameter fetching delegate.
        /// </summary>
        private void Start()
        {
            SetOpenGLMatrix();

            //Get the module from the metaContext
            NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>();

            if (pars != null) //the metaContext may not have the module if it was not loaded correctly.
            {
                //Will be called when the parameters have been loaded.
                pars.OnParametersReady += ImportCameraModel;
            }
        }
示例#5
0
        /// <summary>
        /// Import the Pose from Calibration Parameters
        /// </summary>
        public void CalibratePose()
        {
            NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>();

            // Remove from event
            pars.OnParametersReady -= CalibratePose;

            if (pars.Profiles.ContainsKey(_key))                         //check if the dict has the key for the calibration you're after.
            {
                Plugin.CalibrationProfile profile = pars.Profiles[_key]; //get the calibration
                _poseMatrix = profile.RelativePose;
                UpdatePose();
            }
        }