I'm trying to run a sample code with OpenNI 1.5 documentation. I imported the library to XnCppWrapper.h so that I can use C ++. In the code, there is only one error on a special variable "bshouldrun". I know that it should be declared as something, but since I am new on this and there is nothing above the main in the documentation, I do not know it declare..Please help !! And thanks in advance.
#include & lt; XnOpenNI.h & gt; # Include & lt; XnCppWrapper.h & gt; # Include & lt; Stdio.h & gt; Int main () {XnStatus nRetVal = XN_STATUS_OK; Xn :: Reference Reference; // Start the reference object nRetVal = context.Init (); // TODO: Check the error code // Create an in-depth node xn: Depth Intensity; NRetVal = Depth. Create (context); // TODO: Check the error code // start generating data nRetVal = context.StartGeneratingAll (); // TODO: Check the error code / main loop (bShouldRun) // & lt; ----------------------------- ** Error; BShouldRun Undefined ** {// Wait for new data to be available nRetVal = context.WaitOneUpdateAll (Depth); If (nRetVal! = XN_STATUS_OK) {printf ("Failed to update data:% s \ n", xnGetStatusString (nRetVal)); to continue; } // Current Depth Mapcast XnDepthPixel * pDepthMap = Depth GETDepthMap (); // TODO: Process Depth Map} // Clean-up Reference shut down (); What I did to run a sample from Visual Studio 2010 Express on Windows () (
< P> 8): - C: \ Program Files (x86) \ OpenNI \ samples \ Nesmillator
- To edit OpenNI.rc, edit the NiSimpleViewer. Vcxproj vs2010 project opened
line at line # 10 (maybe it can not be remembered because I'm using Express Edition, not sure. / Can not complain about the missing header file) - Enabled Devices & gt; Options & gt; Debugging & gt; Symbols & gt; Microsoft Signal Server (to get past missing PDFB files)
- Optionally edit
SAMPLE_XML_PATH to "SamplesConfig.xml" Do default "../../../ Data / SamplesConfig.xml" , otherwise you need to run the sample executable .. \ Bin \ Debug \ NiSimpleViewer.exe instead navigate there By using Ctrl + F5, then copy the sample config.exml file to your sample folder as you can see sub Here are some images to clarify some of the following steps: < P>
You can also compile the Nihdtrack samples, which looks close to what you need. So it tells setup for OpenNi 1.5, which is about your question.
I have seen your open ni2bb issue in comments. This should be a matter of linking against SimpleHandTracker.lib, which you can call Project Properties (right-click Project-> Properties) & gt; Linker & gt; Input & gt; Additional Dependency & gt; Edit it. I do not have OpenNI2 setup on this machine, but SimpleHandTracker.lib thinks OpenNI_INSTALL_FOLDER \ In Lib, if I'm wrong, try the file search.
No comments:
Post a Comment