Generate and publish PointCloud2 in ros2?
What's the most convenient way to generate a bunch of points in a loop, assign xyz (and possibly rgb), and then publish as a PointCloud2? I'm interested in a full C++ code example mainly but python would be useful to have here also.
With and without pcl would be useful too. pcl_ros isn't available in crystal but there is pcl_conversions ros-crystal-pcl-conversions
. I encountered some oddities with linking to PCL in colcon/ament last time I tried, maybe that is better addressed in a separate question but CMakeLists.txt excerpts are additionally helpful.
Cross referencing https://github.com/lucasw/imgui_ros/i...