pointcloud2gazebo
is a package that allows you to create a Gazebo World from a 3D point cloud.
Input Point Cloud | Generated Mesh | Gazebo World |
---|---|---|
The following demo showcases a robot navigating a Gazebo World generated by this package.
pip install -r requirements.txt
If you use Docker for setup of this tool, please execute the following command.
docker build -t pointcloud2gazebo .
./launch_container.sh
You will need to generate a 3D point cloud map. As an example, we have prepared data/cloud.ply. This data was generated using RTAB-Map.
python3 generate_world.py --input=data/cloud.ply
If you enable to visualize mesh, please add --vis
option.
python3 generate_world.py --input=data/cloud.ply --vis
If you encounter the following error, please execute xhost +local:
before execute generate_world.py
.
$ python3 generate_world.py --input=data/cloud.ply --vis
No protocol specified
[Open3D WARNING] GLFW Error: X11: Failed to open display :0
[Open3D WARNING] Failed to initialize GLFW
[Open3D WARNING] [DrawGeometries] Failed creating OpenGL window.
GAZEBO_MODEL_PATH
mkdir -p ~/.gazebo/models
cp -r models/pointcloud2gazebo ~/.gazebo/models/
If you try to spawn Gazebo World generated by this package, you need to install Gazebo. Please read official document.
gazebo worlds/pointcloud2gazebo.world
You can customize the package using config/config.py.
Parameter | Description | Type | Unit |
---|---|---|---|
Crop.min_z | Minimum height of points to create Gazebo world. | float | meter |
Crop.max_z | Maximum height of points to create Gazebo world. | float | meter |
NoiseRemoval.nb_points | Number of points within the radius. Refer to open3d.geometry.PointCloud.remove_radius_outlier. | int | - |
NoiseRemoval.radius | Radius of the sphere. Refer to open3d.geometry.PointCloud.remove_radius_outlier. | float | meter |
VoxelDownSample.voxel_size | Voxel size to downsample into. Refer to open3d.geometry.PointCloud.voxel_down_sample. | float | meter |
TriangleMesh.alpha | Parameter to control the shape. A large value will yield a shape close to the convex hull. Refer to open3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape. | float | - |
The sample data (data/cloud.ply) was generated using RTAB-Map. The following parameters were set for this data:
c.Crop.min_z = -1.2
c.Crop.max_z = 1.0