Publishing multiple messages on same topic at same time
I need to publish a several messages containing point clouds from a sensor at different viewpoints. Each of these point clouds is expressed locally so I was hoping I could just publish all of them individually on the same topic, with the same stamp and then it would work, i.e.
stamp = ros::Time::now();
for (const auto &cloud : point_clouds) {
cloud.header.stamp = stamp;
pub_cloud.publish(cloud);
}
This would save me the work of transforming them myself or from creating a topic for each point cloud. This, however doesn't really seem to be possible, as only the last message is shown in rviz, though they are all printed with rosecho.
Is this actually possible?