introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.79k stars 787 forks source link

Modifying the Signature Node SensorData #774

Open dagata-mining opened 3 years ago

dagata-mining commented 3 years ago

Hi,

I'm trying to create depth images from the point cloud, and project in to existing rgb images, so far so good, I managed to create something satisfying in the util3d.cpp projectCloudToCamerasImpl() method, however I'm trying to add the depth image (32FC1 format) into the corresponding node by this method :


  node.sensorData().setRGBDImage(rgb,rgbdStiched,node.sensorData().cameraModels(),false)

But it seems that the sensorData() created previously did not have the RGBD information. Any help or suggestion?

matlabbe commented 3 years ago

It depends when this happens. In the main loop, the raw data is cleared here: https://github.com/introlab/rtabmap/blob/8682026396bb6043b1a54194d5b69ca1192b46c1/corelib/src/Rtabmap.cpp#L3533

dagata-mining commented 3 years ago

So when I setRGBDImage my RGBDimage should be in CV_8UC1 type (compressed) therefore preventing from deleting.

matlabbe commented 3 years ago

If it is set before the memory is updated, it will be compressed by default and kept. It depends where you are currently doing the change. Here are the main steps: