Pointcloud transform issue
I have a setup where I am fusing PointCloud2 and cameras to get XYZIRGB cloud.
pcl::PointCloud<XYZIRGB> points_front, points_back;
Both points_back
and points_front
come from a different lidar-camera pair. I want to publish one stream of cloud instead of two. For that I am concatenating them, but them I have to publish it with a single frame_id and that is messing where my points should show up on rviz.
points_front.insert(points_front.end(), points_back.begin(), points_back.end());
points_front.header.frame_id = "cam_front";
This will show all the points wrt front camera. Does someone have any idea for workaround this thing?
I also think that it's an issue with not transforming the points into a single frame before concatenating them. Just concatenating and putting the same
header.frame_id
won't work.