How to add RGB value to PointCloud2

asked 2021-03-07 12:44:30 -0500

dhman gravatar image

updated 2021-04-26 09:12:30 -0500

miura gravatar image

Dear forum, I am trying to visualize the position of blue and yellow points in Rviz. Therefore I am publishing a PointCloud2 wth the following fields:

  • x
  • y
  • z
  • classification
  • confidence

The classification determines if the object is yellow or blue ans is a float property of either 0 or 1.0

Now my question:

What is the most optimal way to color the points in Rviz2 accordingly? Should I add RGB values to the PointCloud2 and if so how can this be done? Or is there a simple setting in Rviz2 for that?

Thank you very much in advance.

edit retag flag offensive close merge delete