copy_to() not working properly for PointFrame?

Hi! I’ve been pulling PointFrame data to draw a point cloud, and I think there’s a bug somewhere in astra_imageframe_copy_data(). Here’s what I see when using either of these lines… It only shows the top bit of the point cloud:

pointFrame.copy_to((astra::Vector3f*) cachedCoords.data());
memcpy(cachedCoords.data(), pointData, cachedCoords.size());

(cachedCoords is a vector<ofVec3f> which has the same structure as astra::Vector3f)

If I replace that line with…

memcpy(cachedCoords.data(), pointData, cachedCoords.size() * sizeof(ofVec3f));

then I get the full cloud

I got as far as here and then stopped digging, so maybe the wrong byteLength is getting passed to memcpy() in astra_imageframe_copy_data().

My code is up here: ofxOrbbecAstra (I made an OF addon!)

Hi Matt,

Awesome addon! That’s brilliant.

Yep, we’re busy fixing the bug you unfortunately ran into. And I’m making a note to use your addon to test the fix. :smile:

James

1 Like