RGBDemo c++ question

83 views
Skip to first unread message

Suchet Bargoti

unread,
Sep 11, 2011, 11:10:09 AM9/11/11
to rgbdemo
Hey guys,

For those of you that haven't read any of my previous posts, I am
quiet new to coding in general so bear with me :).

I am trying to run the grab_mesh file where it acquires and saves
a .ply file of the environment. But on some instances it fails to
connect to the camera where I get the error message:

------------------------------------------------------------------------------------------------------------------------------------------------------------
[DBG] “Found device: vendor PrimeSense name Sensor Kinect”
[DBG] “[Kinect bfc6b340] connecting”
[DBG] “[ERROR] Create Device Node failed: USB transfer timeout!”
terminate called after throwing an instance of 'ntk::exception'
what(): void ntk::OpenniDriver::checkXnError(const XnStatus&, const
char*) const: Error in OpenniGrabber.
Aborted.
------------------------------------------------------------------------------------------------------------------------------------------------------------

or the obvious message when the camera is not connected:

------------------------------------------------------------------------------------------------------------------------------------------------------------
[DBG] "[Kinect bf8e94f0] connecting"
[DBG] "[ERROR] Cannot enumerate devices. failed: Can't create any node
of the requested type!
"
terminate called after throwing an instance of 'ntk::exception'
what(): void ntk::OpenniDriver::checkXnError(const XnStatus&, const
char*) const: Error in OpenniGrabber.
------------------------------------------------------------------------------------------------------------------------------------------------------------

I am calling the grab_cpp "main" function within my own file and I
want it to try access the camera and if it cant, either try again
(e.g. when we get the fist usb timeout error) or continue with the
rest of the code, all without aborting the actual program.

I am thinking it could be some sort of try catch statement where it
would go onto the the "catch" section if it is unable to connect?
Also how would I get it to retry if it was just a USB transfer
timeout?

Thanks

Suchet

Nicolas Burrus

unread,
Sep 12, 2011, 1:10:47 PM9/12/11
to rgb...@googlegroups.com
Hi,

Something like

try {
grabber->connectToDevice();
}
catch (const std::exception& e)
{
std::cerr << "Could not connect to any device. Is the camera
connected?" << std::endl;
exit(0);
}

should handle the connexion error nicely.

Cheers,
Nicolas

On 09/11/2011 05:10 PM, Suchet Bargoti wrote:
> Hey guys,
>
> For those of you that haven't read any of my previous posts, I am
> quiet new to coding in general so bear with me :).
>
> I am trying to run the grab_mesh file where it acquires and saves
> a .ply file of the environment. But on some instances it fails to
> connect to the camera where I get the error message:
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------

> [DBG] �Found device: vendor PrimeSense name Sensor Kinect�
> [DBG] �[Kinect bfc6b340] connecting�
> [DBG] �[ERROR] Create Device Node failed: USB transfer timeout!�

Reply all
Reply to author
Forward
0 new messages