Beispiel #1
0
        /// <summary>
        /// Init VIO service.
        /// </summary>
        /// <param name="operationMode">Operation Mode.</param>
        /// <param name="sparseMapPath">Sparse map path.
        /// If it's null, the application will run in loop closure mode.</param>
        public static void Init(Mode operationMode, string sparseMapPath)
        {
            int withSparseMapping =
                (operationMode == Mode.VisualIntertialNavigationAndMapping) ? 1 : 0;

            Common.RetCodes retCode = (Common.RetCodes)TangoVIOAPI.VIOInitialize(TangoApplication.Instance.Handle,
                                                                                 withSparseMapping,
                                                                                 sparseMapPath);
            if (retCode != Common.RetCodes.kCAPISuccess)
            {
                Debug.Log("VIO initialization failed: " + retCode);
            }
            else
            {
                m_isInit = true;
            }
        }
Beispiel #2
0
        void Start()
        {
                        #if (UNITY_EDITOR)
            DebugLogger.WriteToLog(DebugLogger.EDebugLevel.DEBUG_INFO, typeof(Camera).Name + " : Adding input controls to run in editor.");
            gameObject.AddComponent <TangoFlyCam>();
                        #elif (UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_ANDROID)
                        #else
                        #error platform is not supported
                        #endif

            Synchronizer sync = gameObject.GetComponent <Synchronizer>();
            int          withSparseMapping = (operationMode == Mode.VisualIntertialNavigaitionAndMapping)?1:0;
            mVIOHandler = TangoVIOAPI.VIOInitialize(sync.handler, withSparseMapping, sparseMapPath);
            if (mVIOHandler == System.IntPtr.Zero)
            {
                ErrorHandler.instance.presentErrorMessage("VIO initialization failed");
            }
        }