Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Combine-3D-Lidar-and-RGB-D-Camera-to-create-a-single-3D-point-cloud-sensor-fusion-tp10162p10493.html
It seems
color-point-cloud package returns a point cloud with RGB
and Intensity. Based on
rtabmap's conversion function, if they have both fields,
intensity is used and rgb ignored. Then when generating cloud_map, the
green/red color is added by default as the internal cloud doesn't have RGB (intensity instead).
To support that kind of point cloud, we would need to add new types (e.g., "kXYZRGBI", "kXYZRGBIT")
here. I created a
feature-request on github.
However, even if we implement this, the cloud_map would mix RGB and no-RGB points together, which would look like the mixed lidar/RGB points as above. What could be nice is that during
Voxel Filtering, if we could tell to mix color from only points having color set (ignoring 0,0,0 values). How the color is mixed right now boils down do these
accumulators. So in the
RGBA accumulator, that logic would have to be added (instead of average all colors, only average valid colors).
So, looks like generating two cloud_map and assembling in external node would be the simplest way to do it for now.
Small last note, beware that
color-point-cloud's returned cloud doesn't have timestamp field anymore, so that cloud cannot be deskewed. I guess for the coloring to work properly, the lidar should have been already deskewed (so it is why they may don't bother republishing the timestamps), otherwise color will be added to wrong points.
cheers,
Mathieu