示例#1
0
    void Start()
    {
        //Registering data for the specific hand
        _tipPosition = InputProvider.Device.RegisterDataHandle<Iisu.Data.Vector3>("CI.HAND" + HandNumber + ".TipPosition3D");
        _palmDirection = InputProvider.Device.RegisterDataHandle<Iisu.Data.Vector3>("CI.HAND" + HandNumber + ".PalmNormal3D");

        _palmPosition = InputProvider.Device.RegisterDataHandle<Iisu.Data.Vector3>("CI.HAND" + HandNumber + ".PalmPosition3D");

        _fingerTipPositions = InputProvider.Device.RegisterDataHandle<Iisu.Data.Vector3[]>("CI.HAND" + HandNumber + ".FingerTipPositions3D");

        _fingersStatus = InputProvider.Device.RegisterDataHandle<int[]>("CI.HAND" + HandNumber + ".FingerStatus");
        _handStatus = InputProvider.Device.RegisterDataHandle<int>("CI.HAND" + HandNumber + ".Status");
    }
示例#2
0
        /// <summary>
        /// Constructor Initializes Iisu and loads the input movie
        /// </summary>
        /// <param name="skvMoviePath">skv movie path</param>
        /// <exception cref="System.Exception">
        /// Can occur when Iisu cannot be properly initialized
        /// or when the input path is not valid.
        /// </exception>
        public IisuWrapper()
        {
            // We need to specify where is located the iisu dll and its configuration file.
            // in this sample we'll use the SDK's environment variable as resource to locate them
            // but you can use any mean you need.
            string libraryLocation = System.Environment.GetEnvironmentVariable("IISU_SDK_DIR");
            IHandleConfiguration config = Iisu.Iisu.Context.CreateHandleConfiguration();
            <<<<<<< HEAD

            =======
            >>>>>>> b8e918927be2a4af4732581fe5ad6d829df34356
            config.IisuBinDir = (libraryLocation + "/bin");
            config.ConfigFileName = "iisu_config.xml";

            // get iisu handle
            _iisuHandle = Iisu.Iisu.Context.CreateHandle(config);

            // create iisu device
            _device = _iisuHandle.InitializeDevice();

            // check if Mode DS325 is Enable
            string isCiEnabledString = "";
            _iisuHandle.GetConfigString("//CONFIG//PROCESSING//CI", out isCiEnabledString);
            bool isCiEnabled = isCiEnabledString.Equals("1");

            if (isCiEnabled != true)
            {
                Console.WriteLine("Hand Control will not be Ok");
            }

            //Envoi du fichier coincoin.iid dans le le moteur IIsi
            _device.CommandManager.SendCommand("IID.loadGraph", Directory.GetCurrentDirectory() +  "\\coincoin.iid");

            // register even listener
            _device.EventManager.RegisterEventListener("SYSTEM.Error", new OnErrorDelegate(onError));
            _Hand1Status = _device.RegisterDataHandle<int>("CI.HAND1.Status");
            _Hand1PosingGestureId = _device.RegisterDataHandle<int>("CI.HAND1.PosingGestureId");
            _Hand1PalmPosition = _device.RegisterDataHandle<Iisu.Data.Vector3>("CI.HAND1.PalmPosition3D");

            // enregistrement du la reconnaissance  CoinCoin

            _coincoin = _device.RegisterDataHandle<bool>("IID.Script.CoinCoin");
            _imetaInfo = _device.EventManager.GetMetaInfo("CI.HandPosingGesture");

            _device.Start();
        }
示例#3
0
    void Awake()
    {
        //this has to be done first. Inside the IisuUnityBehaviour object, iisu is initialized, and the update thread for the current device (camera, movie) is started
        _iisuUnity = GetComponent<IisuUnityBehaviour> ();
        _iisuUnity.Initialize ();

        //register iisu data needed to display the depthimage
        _depthImage = _iisuUnity.Device.RegisterDataHandle<Iisu.Data.IImageData> ("SOURCE.CAMERA.DEPTH.Image");

        _hand1ID = _iisuUnity.Device.RegisterDataHandle<int> ("CI.HAND1.Label");
        _hand2ID = _iisuUnity.Device.RegisterDataHandle<int> ("CI.HAND2.Label");
        _labelImage = _iisuUnity.Device.RegisterDataHandle<Iisu.Data.IImageData> ("CI.SceneLabelImage");

        _iisuUnity.Device.EventManager.RegisterEventListener("CI.HandPosingGesture", new OnPoseDelegate(OnPoseEvent));

        _poseIDsDetected = new List<uint>();
    }
示例#4
0
        private void registerIIDData()
        {
            if (m_valid)
            {
                return;
            }

            try
            {
                zoomStage = device.RegisterDataHandle<float>("IID.Script.zoomStage");
                hand1_closed = device.RegisterDataHandle<bool>("IID.Script.hand1_closed");
                hand2_closed = device.RegisterDataHandle<bool>("IID.Script.hand2_closed");

                h1x = device.RegisterDataHandle<float>("IID.Script.h1x");
                h1y = device.RegisterDataHandle<float>("IID.Script.h1y");
                h2x = device.RegisterDataHandle<float>("IID.Script.h2x");
                h2y = device.RegisterDataHandle<float>("IID.Script.h2y");

                m_valid =  zoomStage.Valid && hand1_closed.Valid && hand2_closed.Valid;
            }
            catch (Exception e)
            {
                error.Text = "Failed to register iisu data: " + e.Message;
            }
        }
    void Awake()
    {
        _iisuUnity = GetComponent<IisuUnityBehaviour>();
        _iisuUnity.Initialize("UnitySampleConfig.xml");

        //register a specific data from iisu to the datahandler
        _depthImage = _iisuUnity.Device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
        _labelImage = _iisuUnity.Device.RegisterDataHandle<Iisu.Data.IImageData>("SCENE.LabelImage");
        _userImageID = _iisuUnity.Device.RegisterDataHandle<int>("USER1.SceneObjectID");
        _uiPointer = _iisuUnity.Device.RegisterDataHandle<Iisu.Data.Vector3>("UI.CONTROLLER1.POINTER.NormalizedCoordinates");
        _uiStatus = _iisuUnity.Device.RegisterDataHandle<bool>("UI.CONTROLLER1.IsActive");
        _user1Active = _iisuUnity.Device.RegisterDataHandle<bool>("USER1.IsActive");

        //in case UI is disabled, we enable UI to be sure.
        IParameterHandle<bool> _uiEnabled = _iisuUnity.Device.RegisterParameterHandle<bool>("UI.Enabled");
        _uiEnabled.Value = true;
        //enable the circle activation gesture, in case it's disabled
        IParameterHandle<bool> _cirlceEnabled = _iisuUnity.Device.RegisterParameterHandle<bool>("UI.CONTROLLERS.GESTURES.CIRCLE.Enabled");
        _cirlceEnabled.Value = true;
    }