pal-robotics / realsense_gazebo_plugin

157 stars 134 forks source link

Fixed Pointcloud without color issue #48 #52

Open marko-zaric opened 1 year ago

marko-zaric commented 1 year ago

This for fixes the monochrome pointcloud issue #48 many users had with this package by checking the dimension of the sensor_msgs::Image imagemsg.

The problem was that the colored rgb data was always overwritten by the monochrome pointcloud before getting published. I worked around this issue by creating a copy of imagemsg called imagemsgs2 which stored the content of imagemsg into imagemsgs2 when the size of the data was not monochrome but 3 dimensional (line 66). Later I simply used this stored color information when ever the color encoding was called instead of the by then overwritten imagemsg.

emiraykin commented 8 months ago

It worked for me after I aligned the dimensions of all messages ( color , depth and infrared )

NakanishiKM commented 4 months ago

I tried incorporating your pull request commit. However, the point cloud color is only black. This time we are simulating using: https://github.com/rickstaa/realsense-ros-gazebo?tab=readme-ov-file Is there anything else I need to be careful about other than your commit part?

Paste the screenshots before and after apply your commit. Screenshot from 2024-03-07 15-15-57 Screenshot from 2024-03-07 14-59-08