Next time try to do a search before ask, please!
here you have the package http://wiki.ros.org/octomap_server.
sudo apt-get install ros-melodic-octomap ros-melodic-octomap-server ros-melodic-octomap-mapping ros-melodic-octomap-ros ros-melodic-octomap-msgs
then just run:
roslaunch octomap_server octomap_mapping.launch
btw your pointcloud has to be named cloud_in, or do a remap to change it's name to /narrow_stereo/points_filtered2. so, in you launch file you should add:
<remap from="cloud_name" to="/narrow_stereo/points_filtered2" />
And you have to define the global frame as a parameter (check the wiki) by default is /map but maybe is not your case.
You have to publish also a transform between this frame and the sensor data frame if you don't know how, here you have tutorial (http://wiki.ros.org/tf/Tutorials).
I think that's all! Hope it works
Originally posted by Solrac3589 with karma: 187 on 2020-09-22
This answer was ACCEPTED on the original site
Post score: 2
Comment by hesham on 2021-12-06:
Thanks for answering the question and also for asking it! Its page http://wiki.ros.org/octomap_server isn't detailed enough like that.