In ROS1 there was a script called point_cloud2.py
that was accessible as a module in the sensor_msgs
package. I.e. by running from sensor_msgs import point_cloud2
. It provided various functions for creating PointCloud2
messages from lists, and vice versa.
I have "ported" it to ROS2 and submitted a PR, but it is currently under review: ros2/common_interfaces#128
I've decided to also place it here to make it more visible and accessible (if the google search algorithms work).