Here’s some recent code where I needed to create an occupancy grid map based on obstacles detected via LIDAR.

 

The algorithm is a fork from jack-oquin / velodyne_height_map where obstacles are detected in a pointcloud via a height map. My fork just adds another node that publishes the obstacle pointcloud as an ROS occupancy grid map.

Note that this should work on any type of 3D LIDAR (such as Ouster 16), and the intensity value is not required. I am currently using this node to generate an occupancy grid map in CARLA.

Source on GitHub