Software Archive
Read-only legacy content
17061 Discussions

Touchless controller configuration settings

HexLord
Beginner
489 Views

Hi,

In the touchless controller sample , the following code is presented incorrectly.

Can anyone tell me the correct syntax.

PXCMTouchlessController.ProfileInfo pinfo;
tc.QueryProfile(out pinfo);
 
pinfo.config= [PXCMTouchlessController.ProfileInfo.Configuration.AllowZoom, PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Scroll_Horizontally];
tc.SetProfile(pinfo);

Thanks,

Shaleen

0 Kudos
2 Replies
Dagan_E_Intel
Employee
489 Views

Hi Shaleen,

did you have a look at the toucless control sample in C#?

RSSDK\framework\CSharp\touchless_listbox_sample.cs

there's a simple example for that

I think this should work for multiple values:

            pInfo.config = PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Scroll_Vertically | PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Allow_Zoom;

 

0 Kudos
HexLord
Beginner
489 Views

hi Dagan,

Thanks for the reply. It worked.

But I am not able get the cursor to follow the hand. Here's the code. Please let me know what is missed out.

 // Create a SenseManager instance.
            PXCMSenseManager sm = PXCMSenseManager.CreateInstance();

            // Enable the touchless controller feature.
            sm.EnableTouchlessController();

            // Initialize the pipeline
            sm.Init();

            // Get the module instance
            PXCMTouchlessController tc = sm.QueryTouchlessController();
PXCMTouchlessController tc = sm.QueryTouchlessController();
            PXCMTouchlessController.ProfileInfo pinfo;
            tc.QueryProfile(out pinfo);
            
            pinfo.config = pinfo.config = PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Scroll_Vertically | PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Allow_Zoom | PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Enable_Injection ;

            // register for the ux events
            // tc.SubscribeEvent(OnFiredUXEvent);
            tc.SetProfile(pinfo);
            // register for the ux events
            tc.SubscribeEvent(OnFiredUXEvent);
            tc.SubscribeEvent(UXEvent_CursorVisible);
            tc.SubscribeEvent(UXEvent_CursorMove);

            // Streaming data
            while (sm.AcquireFrame(true) >= pxcmStatus.PXCM_STATUS_NO_ERROR)
            {
                sm.ReleaseFrame();
            }

            // Clean up
            sm.Dispose();
        }

        private void UXEvent_CursorMove(PXCMTouchlessController.UXEventData data)
        {
            Point point = new Point();
            point.X =(int) Math.Max(Math.Min(0.9F, data.position.x), 0.1F);
            point.Y =(int) Math.Max(Math.Min(0.9F, data.position.y), 0.1F);
           ;

        }

        private void UXEvent_CursorVisible(PXCMTouchlessController.UXEventData data)
        {
            
            textBox1.AppendText(data.bodySide.ToString());
            
        }

        void OnFiredUXEvent(PXCMTouchlessController.UXEventData uxEventData) {
          //  textBox1.AppendText("UX Event");
}

 

0 Kudos
Reply