pixelnerve / BlockOpenNI

A c++ wrapper for OpenNI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error initializing BlockOpenNISkeleton and MultipleKinects samples

glowa opened this issue · comments

While running BlockOpenNISkeleton with XML file everything works fine, when I try to create device with

_device0 = _manager->createDevice( V::NODE_TYPE_IMAGE | V::NODE_TYPE_DEPTH | V::NODE_TYPE_USER );

I get runtime error (EXC_BAD_ACCESS) in gen->GetMapOutputMode( mode ); (in OpenNIDevice::setResolution)

so I've decided to use xml file for this example, but now I am trying to run MultipleKinects and I get the same error in GetMapOutputMode. I was trying to init kinects from XML files

mDevice0 = mManager->createDevice( "configIR1.xml", true );
mDevice1 = mManager->createDevice( "configIR2.xml", true );

and it seems first kinect is initializing properly but on second I get :

(Device)  Error!  XN_STATUS_USB_SET_INTERFACE_FAILED
[OpenNIDeviceManager]  Couldn't create device from xml
[OpenNIDeviceManager]  Device '1' is not available

any help on this one??

The manual init should be fixed by now! There was a problem when using USER parameter.

As for multiple kinects there is only a method that does it. This should be the future method to enable the kinects. you should use createDevices() instead of createDevice(). It also only works with the flags, no xml files yet.

I updated my repository but unfortunately I have problems building the project. I have bunch of errors (85). Maybe it's some stupid problem with build settings but I did everything what I did with previous code (which succeded to build). It seems something is wrong with VOpenNINetwork, I paste build log below maybe it could lead to some solution

In file included from ../../../../../blocks/BlockOpenNI/include/VOpenNIHeaders.h:5, from /Developer/Cinder/blocks/BlockOpenNI/samples/MultipleKinects/xcode/../src/MultipleKinectsApp.cpp:5: ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:8:2: error: #error "Unknown platform" In file included from ../../../../../blocks/BlockOpenNI/include/VOpenNIHeaders.h:5, from /Developer/Cinder/blocks/BlockOpenNI/samples/MultipleKinects/xcode/../src/MultipleKinectsApp.cpp:5: ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:282: error: 'SOCKET' does not name a type ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In constructor 'V::OpenNINetwork::OpenNINetwork(const std::string&, uint16_t, bool)': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:24: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:24: error: 'INVALID_SOCKET' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:25: error: 'SOCK_STREAM' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'void V::OpenNINetwork::Init()': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:37: error: 'WSADATA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:37: error: expected ;' before 'data'
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:38: error: 'MAKEWORD' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:38: error: 'data' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:38: error: 'WSAStartup' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:40: error: 'mSocketId' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:40: error: '::socket' has not been declared
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:40: error: 'AF_INET' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:40: error: 'IPPROTO_TCP' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:41: error: 'INVALID_SOCKET' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:43: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:47: error: aggregate 'V::sockaddr_in dest_addr' has incomplete type and cannot be defined
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:50: error: 'inet_addr' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:53: error: '::bind' has not been declared
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:53: error: invalid application of 'sizeof' to incomplete type 'V::sockaddr_in'
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:53: error: 'SOCKET_ERROR' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:55: error: 'closesocket' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:56: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:63: error: '::listen' has not been declared
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:63: error: 'SOCKET_ERROR' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:65: error: 'WSAGetLastError' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:66: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:65: warning: unused variable 'res'
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:71: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:83: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'void V::OpenNINetwork::InitClient()':
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:89: error: 'WSADATA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:89: error: expected ;' before 'data' ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:90: error: 'MAKEWORD' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:90: error: 'data' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:90: error: 'WSAStartup' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:92: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:92: error: '::socket' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:92: error: 'AF_INET' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:92: error: 'IPPROTO_TCP' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:93: error: 'INVALID_SOCKET' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:95: error: 'OutputDebugStringA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:99: error: aggregate 'V::sockaddr_in dest_addr' has incomplete type and cannot be defined ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:102: error: 'inet_addr' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:105: error: '::connect' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:105: error: invalid application of 'sizeof' to incomplete type 'V::sockaddr_in' ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:105: error: 'SOCKET_ERROR' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:107: error: 'closesocket' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:108: error: 'OutputDebugStringA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:114: error: 'OutputDebugStringA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'void V::OpenNINetwork::Release()': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:130: error: '::closesocket' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:130: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:131: error: '::WSACleanup' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'int V::OpenNINetwork::Send(char*)': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:136: error: '::send' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:136: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'int V::OpenNINetwork::Send(const float*, int)': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:150: error: '::send' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:150: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:151: error: 'WSAGetLastError' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:151: warning: unused variable 'error' ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'int V::OpenNINetwork::Receive()': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:166: error: '::recv' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:166: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:167: error: 'WSAGetLastError' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:173: error: 'OutputDebugStringA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'int V::OpenNINetwork::ReceiveFloatBuffer(int)': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:184: error: '::recv' has not been declared ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:184: error: 'mSocketId' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:185: error: 'WSAGetLastError' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:191: error: 'OutputDebugStringA' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'void V::OpenNINetwork::run()': ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:201: error: 'SOCKET' was not declared in this scope ../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:201: error: expected ;' before 'AcceptSocket'
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:206: error: 'AcceptSocket' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:206: error: 'SOCKET_ERROR' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:210: error: 'mSocketId' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:210: error: 'accept' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:218: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:219: error: 'mSocketId' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h: In member function 'void V::OpenNINetwork::checkStatus(int)':
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:231: error: 'WSANOTINITIALISED' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:233: error: 'OutputDebugStringA' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:235: error: 'WSAENETDOWN' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:239: error: 'WSAEACCES' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:243: error: 'WSAEINTR' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:247: error: 'WSAEINPROGRESS' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:251: error: 'WSAEFAULT' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:255: error: 'WSAENETRESET' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:259: error: 'WSAENOBUFS' was not declared in this scope
../../../../../blocks/BlockOpenNI/include/VOpenNINetwork.h:263: error: 'WSAEMSGSIZE' was not declared in this scope
In file included from ../../../../../blocks/BlockOpenNI/include/VOpenNIHeaders.h:7,
from /Developer/Cinder/blocks/BlockOpenNI/samples/MultipleKinects/xcode/../src/MultipleKinectsApp.cpp:5:
../../../../../blocks/BlockOpenNI/include/VOpenNIDevice.h: At global scope:
../../../../../blocks/BlockOpenNI/include/VOpenNIDevice.h:548: error: ISO C++ forbids declaration of 'shared_ptr' with no type
../../../../../blocks/BlockOpenNI/include/VOpenNIDevice.h:548: error: typedef name may not be a nested-name-specifier
../../../../../blocks/BlockOpenNI/include/VOpenNIDevice.h:548: error: expected ';' before '<' token`

Ah yes, something i forgot to mention and need to deal with. Network is windows OS only. Fastest way for the moment is to to remove/comment it. I'll take care of that when i find the time.