Hello guan,
You can generate an octomap by connecting output of
rtabmap "cloud_map" to input of
octomap_server "cloud_in". Octomap will then publish the octomap. Example (you will need to install
octomap_server and
octomap_rviz_plugins):
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ roslaunch rtabmap_ros rgbd_mapping.launch rtabmapviz:=false rviz:=true
$ rosrun octomap_server octomap_server_node cloud_in:=/rtabmap/cloud_map
Then add in RVIZ the octomap_grid (3D) or octomap_map (2D) visualization and select topic "/octomap_full".
However, to increase speed of the octomap generation, you may want to modify cloud generation parameters ("cloud_voxel_size" and "cloud_output_voxelized") of rtabmap node. By default, the voxel size of the generated cloud is 0.05 m.
cheers