Skip to content

ROS2 stack for mapping with OctoMap, contains octomap_server package

Notifications You must be signed in to change notification settings

awesomericky/octomap_server2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OctoMap Server2

Implementation of octomap for ROS2.0

Port of the ROS1 octomap server for ROS2.0

# Install octomap
git clone https://github.com/OctoMap/octomap.git
cd octomap
mkdir build && cd build
cmake ..
make

# Set the built libraries in default path
cd /usr/lib/x86_64-linux-gnu/
mkdir octomap
sudo cp /PATH/TO/OCTOMAP/octomap/lib/cmake/octomap/* /usr/lib/x86_64-linux-gnu/octomap/.
sudo cp /PATH/TO/OCTOMAP/octomap/lib/liboctoma* /usr/lib/x86_64-linux-gnu/.

#############################################################

# Build raisin
mv src/octomap_* ../etc/.
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

# Build octomap
sudo mv /usr/local/include/eigen3 ~/yunho/etc/.  # remove eigen3.4.0 which crashes with eigen 3.3.7 when building octomap
mv ../etc/octomap_* src/.
colcon build --packages-select octomap_msgs octomap_server2 --cmake-args -DCMAKE_BUILD_TYPE=Release
sudo mv ~/yunho/etc/eigen3/ /usr/local/include/.  # move back eigen3.4.0 to where it was

#############################################################

# Run octomap
rs-enumerate-devices -s  # Check whether all three cameras are connected. If not, plug the disconnected camera in a different usb port.

ros2 launch raisin_sensor_ros head_launch.py  # Launch depth cameras
ros2 launch raisin_sensor_ros t265_launch.py  # Launch pose estimation
ros2 launch octomap_server2 octomap_server_launch.py  # Launch octomapping
ros2 launch raisin_sensor_ros rviz_launch.py  # Launch rviz visualization (remote PC) (Not recommended because the mapping process will be slower. Recommend to visualize offline using rosbag.)

ros2 topic hz /raibo_head_pcl2
ros2 topic hz /camera/odom/sample
ros2 topic hz /occupied_cells_vis_array  # 5 ~ 20 in 0.05m resolution

Installation

Firstly make sure you have octomap installed on your system

Next, clone this ros package to the appropriate ros2 workspace

$ git clone https://github.com/iKrishneel/octomap_server2.git

Clone the dependency repositories to the workspace

# will clone octomap_msgs to the workspace
$ vcs import . < deps.repos

Building

Use colcon to build the workspace

$ colcon build --symlink-install --packages-select octomap_msgs octomap_server2

Running

Launch the node with appropriate input on topic cloud_in

$ ros2 launch octomap_server2 octomap_server_launch.py

About

ROS2 stack for mapping with OctoMap, contains octomap_server package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.3%
  • CMake 2.5%
  • Python 2.2%