- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use PXCMSenseManager.Handler to detect when the RealSense camera is being connected or disconnected.
I do it like so:
// create sense manager
senseManager = PXCMSenseManager.CreateInstance();
// specify streams
senseManager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH, 320, 240, 60);
// create handler
PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler();
handler.onConnect += connectionChanged;
// init sensor
pxcmStatus = senseManager.Init(handler);
if (status != pxcmStatus.PXCM_STATUS_NO_ERROR) {
// some error
}
and then the connectionChanged function looks like this:
private pxcmStatus connectionChanged(PXCMCapture.Device device, bool connected) {
if (connected) {
// do stuff
} else {
// stop doing stuff
}
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
this code lets me know correctly when the sensor is being connected but it does not call connectionChanged when the sensor is disconnected mid streaming.
What should I change to make it work?
Thanks,
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page