ROS stack for mapping with OctoMap, contains the octomap_server package.
The main branch for ROS1 Kinetic, Melodic, and Noetic is kinetic-devel.
The main branch for ROS2 Foxy and newer is ros2.
ros2 run octomap_server octomap_saver_node --ros-args -p octomap_path:=(path for saving octomap)
Note: The extension of octomap path should be .bt or .ot