-
Notifications
You must be signed in to change notification settings - Fork 32
Global map creation
Here we report the commands on how to create an occupancy grid usable for global planning starting from a *.pcd
file created by the SLAM pipeline.
Notice that this pipeline is not fully automated yet, as some manual tuning and post-processing is necessary.
Instead, if you want to create an occupancy map for a Gazebo world, have a look at this repository.
A script to generate a global map from a *.pcd
file is given in this repository (in smb_path_planner/smb_navigation/script
).
These instructions show how to use the script with more control on the input and output arguments.
To generate a global map usable by move_base
, follow these steps:
-
Navigate to:
$ cd smb_path_planner/smb_navigation/script
-
Make the script exectuable:
$ chomod +x pcd_to_gridmap.sh
-
Set the right value for the parameters in
pcd_to_gridmap.sh
:-
resolution
: resolution of the output occupancy grid map (suggested range:0.15 - 0.25
); -
z_min
: minimum cut-off height of the input point cloud; -
z_max
: maximum cut-off height of the input point cloud.
-
-
Run the script giving the path to the input file and the path of the output folder (the optional flag
run_rviz
has to be eithertrue
orfalse
):
$ ./pcd_to_gridmap.sh <abs_path_to_pcd> <abs_path_output_folder> <run_rviz>
To print the usage of the script:$ ./pcd_to_gridmap.sh -h
-
Follow the instructions on the terminal.
-
After the script is done, a
*.pgm
and a*.yaml
files are created in the specified output folder. The files can be used for global planning. -
Check that the origin field in the
*.yaml
file contains NaNs. If so, replace them with zeros. -
Check that the path to the map (
*.pgm
file) is specified correctly in the*yaml
(relative paths work as well).
Once the map has been generated, it can be used for global planning. Refer to the "Run in simulation" section to know how to do that.
If the map generated by the package smb_slam
is to be used, it is possible to use the python script in smb_path_planner/smb_navigation/script
without the need to specify additional arguments.
Only the parameters in smb_path_planner/smb_navigation/script/pcd_to_gridmap.sh
have to be tuned.
In this case, the file compslam_map.pcd
generated in smb_common/smb_slam
will be used, while the output path is smb_path_planner/smb_navigation/data/test
.
-
Start a
roscore
on your machine. -
In a terminal, navigate to:
$ cd smb_path_planner/smb_navigation/script
-
Run:
$ python3 pcd_to_grid_map_default_paths.py
-
Follow the instructions on the terminal.
-
After the script is done, a
*.pgm
and a*.yaml
files are created in the foldersmb_path_planner/smb_navigation/data/test
. -
Check that the origin field in the
*.yaml
file contains NaNs. If so, replace them with zeros. -
Check that the path to the map (
*.pgm
file) is specified correctly in the*yaml
(relative paths work as well).
Once the map has been generated, it can be used for global planning. Refer to the "Run in simulation" section to know how to do that.
SMB Path Planner, V4RL