#include <GridMapPclLoader.hpp>
Definition at line 35 of file GridMapPclLoader.hpp.
grid_map::GridMapPclLoader::GridMapPclLoader |
( |
| ) |
|
|
default |
grid_map::GridMapPclLoader::~GridMapPclLoader |
( |
| ) |
|
|
default |
void grid_map::GridMapPclLoader::addLayerFromInputCloud |
( |
const std::string & |
layer | ) |
|
Adds a layer in the grid map. The algorithm is described above.
- Parameters
-
[in] | Layer | name that will be added |
Definition at line 99 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::allocateSpaceForCloudsInsideCells |
( |
| ) |
|
|
protected |
Allocates space for the point clouds. These point clouds are then filled by dispatchWorkingCloudToGridMapCells function.
Definition at line 177 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::calculateElevationFromPointsInsideGridMapCell |
( |
Pointcloud::ConstPtr |
cloud, |
|
|
std::vector< float > & |
heights |
|
) |
| const |
|
protected |
Given a point cloud it computes the elevation from it. The algorithm is suited for 2.5 D maps. Function finds all the clusters and for each of them it computes a mean of point positions. Then it looks at z value of the means and takes the lowest one.
- Parameters
-
[in] | point | cloud that is entirely contained inside a grid map cell |
- Returns
- elevation value computed from the input point cloud. It will return NaN if no clusters have been found or an empty cloud is passed in.
Definition at line 142 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::dispatchWorkingCloudToGridMapCells |
( |
| ) |
|
|
protected |
Makes a matrix of empty point clouds where each cell in the matrix corresponds to a cell in the grid map. The functions iterates over the working point cloud, checks for each point which cell in the grid map it falls within and then adds that point to the correct point cloud in the matrix of point clouds. The decision which cell in the matrix point cloud a point belongs to or not is made by looking at the xy coordinates of the point in the input point cloud and x-y borders of the cell in the grid map.
Definition at line 196 of file GridMapPclLoader.cpp.
const std::vector<std::vector<std::vector<float> > >& grid_map::GridMapPclLoader::getClusterHeightsWithingGridMapCell |
( |
| ) |
const |
|
inline |
- Returns
- A const reference to the internal multiple heights representation.
Definition at line 102 of file GridMapPclLoader.hpp.
GridMapPclLoader::Pointcloud::Ptr grid_map::GridMapPclLoader::getPointcloudInsideGridMapCellBorder |
( |
const grid_map::Index & |
index | ) |
const |
|
protected |
- Parameters
-
[in] | index | of a cell in the grid map |
- Returns
- Point cloud made from points in the working point cloud that fall within the requested cell in the grid map.
Definition at line 159 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::initializeGridMapGeometryFromInputCloud |
( |
| ) |
|
Initializes the geometry of a grid map from an input cloud. This will set the center of the map and the dimensions in x and y direction. This method will clear any layers that the working grid map might have had.
Definition at line 73 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::loadCloudFromPcdFile |
( |
const std::string & |
filename | ) |
|
Loads the point cloud into memory
- Parameters
-
[in] | fullpath | to the point cloud. |
Definition at line 29 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::loadParameters |
( |
const std::string & |
filename | ) |
|
Load algorithm's parameters.
- Parameters
-
[in] | full | path to the config file with parameters |
Definition at line 163 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::preprocessGridMapCells |
( |
| ) |
|
|
protected |
Allocates space for the point clouds and dispatches points to the right location in the point cloud matrix. The function merely calls allocateSpaceForCloudsInsideCells and dispatchWorkingCloudToGridMapCells.
Definition at line 172 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::preProcessInputCloud |
( |
| ) |
|
Preprocessing of the input cloud. It removes the outliers, downsamples the cloud and applies a rigid body transform. Parameters are specified in the config file.
Definition at line 54 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::processGridMapCell |
( |
const unsigned int |
linearGridMapIndex, |
|
|
grid_map::Matrix * |
gridMapData |
|
) |
| |
|
protected |
Calculates the elevation at the linear index. The algorithm is applied for each cell after the pre-processing has been done. This function is designed such that it can be called in a parallel for loop. There are no race conditions since each thread processed different set of grid map cells.
- Parameters
-
[in] | linear | index of a grid map cell currently being processed |
[out] | matrix | of elevation values which need to be computed |
Definition at line 120 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::savePointCloudAsPcdFile |
( |
const std::string & |
filename | ) |
const |
Saves a point cloud to a pcd file.
- Parameters
-
[in] | full | path to the output cloud |
Definition at line 168 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::setInputCloud |
( |
Pointcloud::ConstPtr |
inputCloud | ) |
|
Allows the user to set the input cloud
- Parameters
-
[in] | pointer | to the input point cloud. |
Definition at line 35 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::setRawInputCloud |
( |
Pointcloud::ConstPtr |
rawInputCloud | ) |
|
|
protected |
Copies the input cloud in to the memory. This cloud will not change. Should you need to do any other operations where you want to have the access to the raw point cloud (before applying filters) you can use use the corresponding variable in the class.
- Parameters
-
[in] | pointer | to the pcl point cloud |
Definition at line 40 of file GridMapPclLoader.cpp.
void grid_map::GridMapPclLoader::setWorkingCloud |
( |
Pointcloud::ConstPtr |
workingCloud | ) |
|
|
protected |
Copies the input cloud into the memory. This cloud is expected to be changed if you run the pcl filters. For example if you run the statistical outlier removal, it will remove some points from the cloud
- Parameters
-
[in] | pointer | to the pcl point cloud |
Definition at line 47 of file GridMapPclLoader.cpp.
friend class grid_map_pcl_test::GridMapPclLoaderTest_CalculateElevation_Test |
|
friend |
std::vector<std::vector<std::vector<float> > > grid_map::GridMapPclLoader::clusterHeightsWithingGridMapCell_ |
|
protected |
std::vector<std::vector<Pointcloud::Ptr> > grid_map::GridMapPclLoader::pointcloudWithinGridMapCell_ |
|
protected |
Pointcloud::Ptr grid_map::GridMapPclLoader::rawInputCloud_ |
|
protected |
Pointcloud::Ptr grid_map::GridMapPclLoader::workingCloud_ |
|
protected |
The documentation for this class was generated from the following files: