When the device started,the infrared lamp donot light. This problem happend accidentally. I wonder is there something wrong with the usb ports.
2.Another problem is with the following code, there is 10M memory leak when initialized and closed the device one time, is there any bug in my code.
Version, Platform, and Hardware Bug Found:
git log -1 --oneline
uname -a
lsusb -t
lspci -nn
Steps to Reproduce:
Actual Results:
Expected Results:
Reproducibility:
Additional Information:
/// Initializes the default Kinect sensor
bool CBodyTracking::InitializeKinectSensors()
{
//KinectCount=2
if (freenect2.enumerateDevices() < KinectCount)
{
std::cout << "no enough device connected!" << std::endl;
return false;
}
for (int i = 0; i < KinectCount; i++)
{
//find device1-----------------------------------------------------
serial[i] = "";
serial[i] = freenect2.getDeviceSerialNumber(i);
if (serial[i] == "")
{
std::cout << "failure to get the serials! " << i << std::endl;
CloseKinectSensors();
return false;
}
/*libfreenect2::PacketPipeline *pipeline = NULL;
pipeline = new libfreenect2::OpenGLPacketPipeline();
if (pipeline)
devices[i] = freenect2.openDevice(serial[i], pipeline);
else
devices[i] = freenect2.openDevice(serial[i]);*/
devices[i] = freenect2.openDevice(serial[i]);
if (devices[i])
{
int types = 0;
types |= libfreenect2::Frame::Color | libfreenect2::Frame::Ir | libfreenect2::Frame::Depth;
listeners[i] = new libfreenect2::SyncMultiFrameListener(types);
devices[i]->setColorFrameListener(listeners[i]);
devices[i]->setIrAndDepthFrameListener(listeners[i]);
if (!devices[i]->start())
{
std::cout << "failure start device!" << i << std::endl;
CloseKinectSensors();
return false;
}
}
else
{
std::cout << "failure opening device" << i << std::endl;
CloseKinectSensors();
return false;
}
depthPars[i] = devices[i]->getIrCameraParams();
colorPars[i] = devices[i]->getColorCameraParams();
registrations[i] = new libfreenect2::Registration(depthPars[i], colorPars[i]);
}
return true;
}
void CBodyTracking::CloseKinectSensors()
{
//! [stop]
for (int i = 0; i < KinectCount; i++)
{
if (devices[i])
{
devices[i]->stop() ;
devices[i]->close();
delete devices[i];
devices[i] = NULL;
}
if (listeners[i])
{
delete listeners[i];
listeners[i] = NULL;
}
if (registrations[i])
{
delete registrations[i];
registrations[i] = NULL;
}
}
}
Overview Description:
Version, Platform, and Hardware Bug Found:
git log -1 --oneline
uname -a
lsusb -t
lspci -nn
Steps to Reproduce:
Actual Results:
Expected Results:
Reproducibility:
Additional Information: