https://github.com/cyberagentailab/nav2-keepout-zone-map-creator
nav2-keepout-zone-map-creator is a tool that allows you to create a Keepout Zone map from an Occupancy Grid Map and 3D point cloud.
https://github.com/cyberagentailab/nav2-keepout-zone-map-creator
Last synced: 8 months ago
JSON representation
nav2-keepout-zone-map-creator is a tool that allows you to create a Keepout Zone map from an Occupancy Grid Map and 3D point cloud.
- Host: GitHub
- URL: https://github.com/cyberagentailab/nav2-keepout-zone-map-creator
- Owner: CyberAgentAILab
- License: apache-2.0
- Created: 2024-04-18T01:59:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T04:02:57.000Z (about 2 years ago)
- Last Synced: 2025-09-10T07:42:51.807Z (9 months ago)
- Language: Python
- Homepage:
- Size: 28.8 MB
- Stars: 26
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nav2-keepout-zone-map-creator
## Introduction
[Nav2](https://navigation.ros.org/) provides [Keepout Filter](https://navigation.ros.org/tutorials/docs/navigation2_with_keepout_filter.html). But, it is difficult to create **Keepout Zone** map using only Occupancy Grid Map. `nav2-keepout-zone-map-creator` is a tool that allows you to create a keepout zone map from an Occupancy Grid Map and 3D point cloud.
## Demo

## Requirements
- Python 3.10
- Open3D
- NumPy
- OpenCV
- Dear PyGui
## Preparation
### Installing the Package
```shell
python3 -m venv .venv/nav2-keepout-zone-map-creator
source .venv/nav2-keepout-zone-map-creator/bin/activate
pip install -r requirements.txt
```
### Generating Occupancy Grid Map
You will need to generate a Occupancy Grid Map. As an example, we have prepared [data/map.pgm](data/map.pgm). This data was generated using [SLAM Toolbox](https://github.com/SteveMacenski/slam_toolbox).
### Generating 3D Point Cloud Map
You will need to generate a 3D point cloud map.
```shell
docker run -it --rm -v $HOME:$HOME introlab3it/rtabmap:22.04 bash
```
```shell
rtabmap-export rtabmap-export
```
As an example, we have prepared [data/cloud.ply](data/cloud.ply). This data was generated using [RTAB-Map](https://apps.apple.com/td/app/rtab-map-3d-lidar-scanner/id1564774365).
### Generating BEV(Bird's Eye View) image
You will need to generate a **BEV(Bird's Eye View)** image.
```shell
python3 generate_bev_image.py --input=
```
As an example, we have prepared [data/cloud.ply](data/cloud.ply).
```shell
python3 generate_bev_image.py --input=data/cloud.ply
```
|Input Point Cloud|Generated BEV image|
|:---:|:---:|
|||
And, `generate_bev_image.py` has the following option.
|Option|Description|Unit|Required|
|:---|:---|:---:|:---|
|`--input `|path to PoindCloud Map|-|True|
|`--min_z `|min_z|meter|False|
|`--max_z `|max_z|meter|False|
|`--vis`|enable to visualize BEV image|-|False|
## Usage
```shell
python3 generate_keepout_zone_map.py --map= --bev=
```
`generate_keepout_zone_map.py` has the following option.
|Option|Description|Unit|Required|
|:---|:---|:---:|:---|
|`--map `|path to Occupancy Grid Map|-|True|
|`--bev `|path to BEV image|-|True|
As an example, we have prepared [data/map.pgm](data/map.pgm) and [data/cloud_birdseye.png](data/cloud_birdseye.png).
```shell
python3 generate_keepout_zone_map.py --map=data/map.pgm --bev=data/cloud_birdseye.png
```

### Adjust parameters
You can adjust the following parameters.
|Parameter|Unit|
|:---|:---:|
|alpha|-|
|X shift|pixel|
|Y shift|pixel|
|rotation|deg|
|scale|-|
### Specify keepout zone
You can specify keepout zone as polygon.
|Operation|Description|
|:---|:---|
|Light Mouse Click|add vertices|
|Push `f` key|finish to add vertices|
### Save keepout zone map
Please push `Save` button. `_keepout.pgm` is saved.
### Exit application
Please push `q` key.
## Reference
-