This code won't be maintained, and likely will not work anymore. I'm leaving this on GitHub in case anyone still finds value in it.
This project was used to create a demonstrator of using YDLIDAR X2 with Google Cartographer as described in this blog post.
git clone git@github.com:msadowski/x2_cartographer.git
git submodule update --init
rosdep install --from-paths src --ignore-src --rosdistro melodic -r -y
from your workspacesource devel/setup.bash
roslaunch carto_mapper mapper.launch
The files in this repository are provided as is. No support is guaranteed but if you find ways to improve it feel free to open a pull request.