Build a grid map from pointcloud2
I want to create my own map from the laser scan my robot publishes from the lidar. so far i transformed the scan points to the poincloud2 format and used a tf transformation to publish them all in a global ccordinate frame. This leaves me with a high amount of data points in the space. I want to put this data to a global grid. And count how many points of the lidar are present in each cell. I tried using the grid_map package. But from the tutorials I could only find how to publish a grid after I assigned values manually. What I am trying to figure out how to match the values from my pointcloud to the grid. Thanks!