rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

Modifying the Signature Node SensorData

Open dagata-mining opened this issue 2 years ago • 3 comments

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?

dagata-mining avatar Oct 20 '21 16:10 dagata-mining

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

matlabbe avatar Oct 26 '21 11:10 matlabbe

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

dagata-mining avatar Oct 26 '21 13:10 dagata-mining

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:

  • Acquire SensorData "data"
  • Rtabmap::process(data, ...)
    • Memory::update(data, ...)
      • Memory::createSignature(data, ...) <- compressed in there
    • loop closure detection and graph optimization stuff...
    • Remove raw data
    • Publish latest data If you can modify the SensorData before it enters Rtabmap::process() that would be the best.

matlabbe avatar Nov 02 '21 14:11 matlabbe