Skip to content

[ROS2 humble] Convert 3D LiDAR map to 2D Occupancy Grid Map

Notifications You must be signed in to change notification settings

Taeyoung96/OctoMap-ROS2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OctoMap-ROS2

This repository uses a part of the octomap_mapping ros2 branch.

I recommend utilizing docker to easily configure your environment setting.

Result

Test with custom data, the camera is for visualization purposes only.

FAST-LIO2-OctoMap-Result.mp4

How to use

Requirements

Environment setting

  • ROS2 humble
  • PCL
  • Eigen

Clone this repository. It doesn't matter if the path is not a ros2 workspace.

git clone https://github.com/Taeyoung96/OctoMap-ROS2.git

Make a docker image (For the docker user)

cd docker
docker build -t octomap-ros2:latest .

Make a docker container

When you create a docker container, you need several options to use the GUI and share folders.

First, you should enter the command below in the local terminal to enable docker to communicate with Xserver on the host.

xhost +local:docker

After that, make your own container with the command below.

sudo chmod -R 777 container_run.sh
./container_run.sh <container_name> <image_name:tag>

⚠️ You should change {container_name}, {docker image} to suit your environment.

For example,

 ./container_run.sh octomap_ros2 octomap-ros2:latest

If you have successfully created the docker container, the terminal output will be similar to the below.

output :

Current working directory: /home/taeyoung/Desktop/FAST_LIO_ROS2
================Octomap server ROS2 Docker Env Ready================
root@taeyoung-cilab:~/ros2_ws#

How to run

On /ros2_ws directory,

Build the packages with dependencies at first.

colcon build --packages-select octomap_msgs octomap_ros
source install/setup.bash

Then build all the packages.

colcon build
source install/setup.bash

You need to run the 3D Mapping package (ex. FAST_LIO_ROS2) at the same time.

On the FAST-LIO2 terminal,

ros2 launch fast_lio velodyne.launch.py

For this docker container,

ros2 launch octomap_server octomap_mapping.launch.xml

Map save

ros2 run nav2_map_server map_saver_cli -f ~/ros2_ws/src/ --ros-args --remap map:=/projected_map

About

[ROS2 humble] Convert 3D LiDAR map to 2D Occupancy Grid Map

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages