Software Archive
Read-only legacy content
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Touchless Controller in C++

Yubo_X_
Débutant
663 Visites

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 Compliments
2 Réponses
Xusheng_L_Intel
Employé
663 Visites

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 Compliments
Yubo_X_
Débutant
663 Visites
Can  TouchlessController be  implemented by mfc?
I met with difficulties with SDK
0 Compliments
Répondre