Merge pull request #1184 from mbreyer/bugfix-pybulletGetCameraImage

fix memcpy of depth and segmentation images to numpy arrays
This commit is contained in:
erwincoumans 2017-06-12 14:15:30 -07:00 committed by GitHub
commit e24dbec146

View File

@ -5178,9 +5178,9 @@ static PyObject* pybullet_getCameraImage(PyObject* self, PyObject* args, PyObjec
memcpy(PyArray_DATA(pyRGB), imageData.m_rgbColorData,
imageData.m_pixelHeight * imageData.m_pixelWidth * bytesPerPixel);
memcpy(PyArray_DATA(pyDep), imageData.m_depthValues,
imageData.m_pixelHeight * imageData.m_pixelWidth);
imageData.m_pixelHeight * imageData.m_pixelWidth * sizeof(float));
memcpy(PyArray_DATA(pySeg), imageData.m_segmentationMaskValues,
imageData.m_pixelHeight * imageData.m_pixelWidth);
imageData.m_pixelHeight * imageData.m_pixelWidth * sizeof(int));
PyTuple_SetItem(pyResultList, 2, pyRGB);
PyTuple_SetItem(pyResultList, 3, pyDep);