ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Yes @ierosodin, you are able to visualize RGB-Data in RVIZ. You already pointed out how to do that. Simply convert PointCloud type from PointXYZ to PointXYZRGB and use the Pointcloud2 message from ROS to publish it.

Im not sure but I think you are not able to visualize RGB data with the Pointcloud msg type. In order to use the color information, you have to use the Pointcloud2 msg type to publish your data. (At least that is how I got it working.)

Yes @ierosodin, you are able to visualize RGB-Data in RVIZ. You already pointed out how to do that. Simply convert PointCloud type from PointXYZ to PointXYZRGB and use the Pointcloud2 message from ROS to publish it.

Im not sure but I think you are not able to visualize RGB data with the Pointcloud msg type. In order to use the color information, you have to use the Pointcloud2 msg type to publish your data. (At least that is how I got it working.)

Here a little code snippet of how i got it running:

pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr final_cloud_smooth(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
sensor_msgs::PointCloud2

... some point cloud processing ...

pcl::toROSMsg(*final_cloud_smooth, output_ros_cloud);
pcl_pub.publish(output_ros_cloud)

Then as you already did, chose the Pointcloud2 message type in RVIZ and chose the topic you are publishing to.

Yes @ierosodin, you are able to visualize RGB-Data in RVIZ. You already pointed out how to do that. Simply convert PointCloud type from PointXYZ to (at least) PointXYZRGB and use the Pointcloud2 message from ROS to publish it.

Im not sure but I think you are not able to visualize RGB data with the Pointcloud msg type. In order to use the color information, you have to use the Pointcloud2 msg type to publish your data. (At least that is how I got it working.)

Here a little code snippet of how i got it running:

pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr final_cloud_smooth(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
sensor_msgs::PointCloud2

... some point cloud processing ...

pcl::toROSMsg(*final_cloud_smooth, output_ros_cloud);
pcl_pub.publish(output_ros_cloud)

Then as you already did, chose the Pointcloud2 message type in RVIZ and chose the topic you are publishing to.