Skip to content

ASUS Xtion Pro support with OpenNI2 #757

Closed
@mpp

Description

@mpp

I've just compiled from source enabling BUILD_OPENNI2 and WITH_OPENNI2 CMake variables.
I'm using the ASUS Xtion Pro with no RGB camera. When I create a pcl::io::openni2::OpenNI2DeviceManager object and I use its getAnyDevice() method my application crash because it is trying to perform this line of the file openni2_device.cpp: setColorVideoMode (getDefaultColorMode ())
I think that here there should be a check if the device support color or not.
Am I right?
here is a code sample:

#include <pcl\io\openni2_grabber.h>
#include <pcl\visualization\pcl_visualizer.h>
#include <pcl\visualization\boost.h>
#include <pcl\visualization\image_viewer.h>

#include <iostream>

int main (int argc, char** argv)
{
    std::cout << "hi" << std::endl;


    boost::shared_ptr<pcl::io::openni2::OpenNI2DeviceManager> 
    deviceManager = pcl::io::openni2::OpenNI2DeviceManager::getInstance ();

    if (deviceManager->getNumOfConnectedDevices () > 0)
    {
        boost::shared_ptr<pcl::io::openni2::OpenNI2Device> device = deviceManager->getAnyDevice ();
        cout << "Device ID not set, using default device: " << device->getStringID () << endl;
    }

    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: pr mergeSpecify why not closed/merged yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions