MapIV / pointcloud_divider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pointcloud_divider

(Updated 2023/03/27)

Dividing large PCD files into 2D grids.

Supported Data Format

Currently, only pcl::PointXYZI is supported. Any PCD will be loaded as pcl::PointXYZI .

This tool can be used with files that have data fields other than XYZI (e.g., XYZRGB) and files that only contain XYZ.

  • Data fields other than XYZI are ignored during loading.
  • When loading XYZ-only data, the intensity field is assigned 0.

Installation

$ git clone https://github.com/MapIV/pointcloud_divider.git
$ cd pointcloud_divider
$ mkdir build
$ cd build
$ cmake ..
$ make

Usage

  • Select directory, process all files found with find $INPUT_DIR -name "*.pcd".
$ ./scripts/pointcloud_divider.sh <INPUT_DIR> <OUTPUT_DIR> <PREFIX> <CONFIG>
  • Select individual files
$ ./scripts/divider_core.sh <PCD_0> ... <PCD_N> <OUTPUT_DIR> <PREFIX> <CONFIG>
Name Description
INPUT_DIR Directory that contains all PCD files
PCD_N Input PCD file name
OUTPUT_DIR Output directory name
PREFIX Prefix of output PCD file name
CONFIG Config file (default)

INPUT_DIR, PCD_N OUTPUT_DIR and CONFIG can be specified as both relative paths and absolute paths.

Parameter

  • use_large_grid

    Pack output PCD files in larger grid directory

  • merge_pcds

    Merge all grid into a single PCD

  • leaf_size

    leaf_size of voxel grid filter [m]

  • grid_size_x(/y)

    Size of grid [m]

Metadata YAML Format

The metadata file should be named metadata.yaml. It contains the following fields:

  • x_resolution: The resolution along the X-axis.
  • y_resolution: The resolution along the Y-axis.

Additionally, the file contains entries for individual point cloud files (.pcd files) and their corresponding grid coordinates. The key is the file name, and the value is a list containing the X and Y coordinates of the lower-left corner of the grid cell associated with that file. The grid cell's boundaries can be calculated using the x_resolution and y_resolution values.

For example:

x_resolution: 100.0
y_resolution: 150.0
A.pcd: [1200, 2500] # -> 1200 <= x <= 1300, 2500 <= y <= 2650
B.pcd: [1300, 2500] # -> 1300 <= x <= 1400, 2500 <= y <= 2650
C.pcd: [1200, 2650] # -> 1200 <= x <= 1300, 2650 <= y <= 2800
D.pcd: [1400, 2650] # -> 1400 <= x <= 1500, 2650 <= y <= 2800
...

LICENSE

This repository is under BSD-3-Clauses license

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C++ 78.5%Language:Shell 17.7%Language:CMake 3.8%