Point Cloud without RGB color

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Point Cloud without RGB color

Machino29008
Hello,

I'm new with ROS, in my project I'm using rtabmap with Asus I want to get raw cloud points and color them with specific information from my project. But I do not know how to get raw points without rgb color.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Point Cloud without RGB color

matlabbe
Administrator
Hi,

It depends which cloud you are talking about. But in general, you can subscribe to a RGB point cloud and just convert it back to a regular point cloud. Example:
sensor_msgs::PointCloud2 rosCloud;
pcl::PointCloud<pcl::PointXYZ> pclCloud;
pcl::fromROSMsg(rosCloud, pclCloud);
To set colors you want, convert it to a pcl::PointXYZRGB type instead.

In RVIZ, you can change the color overlay if you want even if a point cloud has RGB colors.

cheers,
Mathieu