# How to convert PointCloud2 message to a grid?

I'm using a Velodyne sensor which publishes on /velodyne_points topic, and its class type is PointCloud2.

Now I want to convert PointCloud2 message into a grid space (cylindrical) instead of spherical space. In other words, I want to maps/project Velodyne points (3D) to a grid/panoramic-view (2D) with a const resolution, which each grid cell has a range. Also, this grid's height is const too.