Nav2 provides Keepout Filter. 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.
- Python 3.10
- Open3D
- NumPy
- OpenCV
- Dear PyGui
python3 -m venv .venv/nav2-keepout-zone-map-creator
source .venv/nav2-keepout-zone-map-creator/bin/activate
pip install -r requirements.txt
You will need to generate a Occupancy Grid Map. As an example, we have prepared data/map.pgm. This data was generated using SLAM Toolbox.
You will need to generate a 3D point cloud map.
docker run -it --rm -v $HOME:$HOME introlab3it/rtabmap:22.04 bash
rtabmap-export rtabmap-export <RTABMAP database file>
As an example, we have prepared data/cloud.ply. This data was generated using RTAB-Map.
You will need to generate a BEV(Bird's Eye View) image.
python3 generate_bev_image.py --input=<PointCloud Map PATH>
As an example, we have prepared data/cloud.ply.
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 <filepath> |
path to PoindCloud Map | - | True |
--min_z <value> |
min_z | meter | False |
--max_z <value> |
max_z | meter | False |
--vis |
enable to visualize BEV image | - | False |
python3 generate_keepout_zone_map.py --map=<MAP IMAGE> --bev=<BEV IMAGE>
generate_keepout_zone_map.py
has the following option.
Option | Description | Unit | Required |
---|---|---|---|
--map <MAP IMAGE> |
path to Occupancy Grid Map | - | True |
--bev <BEV IMAGE> |
path to BEV image | - | True |
As an example, we have prepared data/map.pgm and data/cloud_birdseye.png.
python3 generate_keepout_zone_map.py --map=data/map.pgm --bev=data/cloud_birdseye.png
You can adjust the following parameters.
Parameter | Unit |
---|---|
alpha | - |
X shift | pixel |
Y shift | pixel |
rotation | deg |
scale | - |
You can specify keepout zone as polygon.
Operation | Description |
---|---|
Light Mouse Click | add vertices |
Push f key |
finish to add vertices |
Please push Save
button. <MAP_IMAGE_PREFIX>_keepout.pgm
is saved.
Please push q
key.