How to read coordinates via pointcloud2
Sorry to bother! My sensor publisher publish pointcloud2 msg and I would like to cluster them and for that I need their XYZ coordinates and their intensity which I can see i rostopic echo of that topic but don't know how to read them in my program. My idea is to subscribe to that publisher and then make clustering with that dots. I would like to have them in struct array with xyz and intensity data and then write code for dbScan I tried various solutions from internet but won't work for me. Do you know maybe how can I read xyz and intensity from sensor_msgs::pointcloud2 in c++? Kind regards