Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOException When Creating OpenNI2Grabber #3290

Closed
Archetype90 opened this issue Aug 13, 2019 · 6 comments
Closed

IOException When Creating OpenNI2Grabber #3290

Archetype90 opened this issue Aug 13, 2019 · 6 comments

Comments

@Archetype90
Copy link

Your Environment

  • Operating System and version: Windows 10
  • Compiler: Standalone Installer
  • PCL Version: 1.9.1

Context

Attempting to implement the OpenNI grabber tutorial, which can be found here:

http://pointclouds.org/documentation/tutorials/openni_grabber.php

Expected Behavior

I found three issues with the above tutorial.

  1. Line Fix compile error #1 must be

#include <pcl/io/openni2_grabber.h>

  1. Line fix the build of the recognition module on Windows #17 must be

pcl::Grabber* interface = new pcl::io::OpenNI2Grabber();

  1. Line Posniak #19 must be

boost::function<void(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr&)> f = [this](const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& cloud) { cloud_cb_(cloud); };

With the three changes above I was able to build the solution.

Current Behavior

When attempting to run the solution, I received the following exception:

Unhandled exception at 0x00007FFE416D9129 in Object Tracking.exe: Microsoft C++ exception: pcl::IOException at memory location 0x000000FF53B9EC78.

From the updated line #17 (above)

Code to Reproduce

The sample code from the above link with the specified changes.

Possible Solution

@taketwo
Copy link
Member

taketwo commented Aug 15, 2019

We have been transitioning from boost to std types in the recent months. As we update the codebase, we also change the tutorials to match. Unfortunately, our website only hosts a single (current) version of tutorials, which means that what you see online now is only compatible with the master version of PCL.

In other words, in case you use a released versions (e.g. 1.9.1), then your fix 3 is needed. If you use the master PCL then the tutorial should be good as is.

Speaking of changes 1 and 2, you are switching between OpenNI versions. Which version to use depends on which version PCL was compiled with, so it's not a bug in tutorial per se. That said, we should probably switch to OpenNI2 since standalone installer on Windows has OpenNI2.

@Archetype90
Copy link
Author

Thank you for the respone @taketwo! As you suggested, I am using the 1.9.1 release of PCL. I implemented fix #1 and #2 since the release version 1.9.1 of PCL installs OpenNI2. I do not currently have version 1 of OpenNI installed. So #1 and #2 were required for the library that was installed with the release, and fix #3 was required to address the boost to std change. It is still not clear to me where I am going wrong.

I suppose I could install version one of OpenNI and implement only fix number three?

@taketwo
Copy link
Member

taketwo commented Aug 15, 2019

Oh, I'm afraid I misread your report. I thought you are just listing the changes that you needed to make to a tutorial to compile it. Now I realized that you actually hit an error running the compiled app.

What does the exception say? Please surround it with try/catch and print the message contained inside.

@Archetype90
Copy link
Author

Unfortunately I believe I am missing the PDB -

<Information not available, no symbols loaded for pcl_io_debug.dll>

I am able to look at the exception using the debugger and see:

{file_name_=0x00007ffa1ac63e30 "C:\\pcl-1.9.1\\io\\src\\openni2_grabber.cpp" function_name_=0x00007ffa1ac63d50 "void __cdecl pcl::io::OpenNI2Grabber::setupDevice(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const pcl::io::OpenNI2Grabber::Mode &,const pcl::io::O... ...}

I am not sure if this is helpful, but it seems to be in the setupDevice() method. It did occur to me (which I should have included in my original report) that I am using the Kinect for Azure (their newest Kinect). I am curious if this is either not an OpenNI device (I just assumed it was since previous versions of Kinect were) or if there is something incompatible.

@taketwo
Copy link
Member

taketwo commented Aug 16, 2019

I have never used Kinect for Azure, but I am 99% sure it's not an OpenNI device since it's not based on PrimeSense technology.4

@Archetype90
Copy link
Author

I have never used Kinect for Azure, but I am 99% sure it's not an OpenNI device since it's not based on PrimeSense technology.4

My apologies than! Closing the issue, thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants