Software Archive
Read-only legacy content
17061 Discussions

Touchless Controller in C++

Yubo_X_
Beginner
628 Views

Hi, 

I am trying to write a test touchless program in c++, but It appeared some problems.

code as follows:

class UXEventHandler : public PXCTouchlessController::UXEventHandler {

public:


 virtual void PXCAPI OnFiredUXEvent(const PXCTouchlessController::UXEventData *uxEventData) {

  switch (uxEventData->type) {

  case PXCTouchlessController::UXEventData::UXEvent_StartZoom:

   // handle start zoom


   break;

  case PXCTouchlessController::UXEventData::UXEvent_Zoom:

   // handle continued zoom


   break;

  case PXCTouchlessController::UXEventData::UXEvent_EndZoom:

   // handle end zoom


   break;

   // handle all events

  }

 }

};


struct ProfileInfo : public PXCTouchlessController::ProfileInfo{

 PXCHandModule *handModule;

 Configuration  config;

};


// Initialize the Sense Manager

PXCSenseManager *senseManager = PXCSenseManager::CreateInstance();



// Enable hand analysis in the multimodal pipeline

senseManager->EnableTouchlessController();



// Initialize the pipeline

senseManager->Init();



// Get an instance of Touchless Controller

PXCTouchlessController *touchlessController = senseManager->QueryTouchlessController();



// register fozr ux events

UXEventHandler eventHandler;

touchlessController->SubscribeEvent(&eventHandler);



// Configure Touchless Controller

ProfileInfo profInfo;

touchlessController->QueryProfile(&profInfo);

profInfo |= (PXCTouchlessController::ProfileInfo::Configuration_Allow_Selection | PXCTouchlessController::ProfileInfo::Configuration_Enable_Injection);

touchlessController->SetProfile(&profInfo);



// main processing loop

while (senseManager->AcquireFrame(true) >= PXC_STATUS_NO_ERROR) {

 senseManager->ReleaseFrame();

}



// Release resources

senseManager->Release();

But this place has errors:
no matches for "|=" operators Operands of type: Profieinfo |= int

profInfo |= (PXCTouchlessController::ProfileInfo::Configuration_Allow_Selection | PXCTouchlessController::ProfileInfo::Configuration_Enable_Injection);

 

0 Kudos
2 Replies
Xusheng_L_Intel
Employee
628 Views

Have you looked at touchless C# sample code? You can find it @C:\Program Files (x86)\Intel\RSSDK\framework\CSharp\FF_TouchlessControllerViewer.cs and C:\Program Files (x86)\Intel\RSSDK\framework\CSharp\FF_TouchlessListBox.cs. Thanks!

0 Kudos
Yubo_X_
Beginner
628 Views
Can  TouchlessController be  implemented by mfc?
I met with difficulties with SDK
0 Kudos
Reply