test_helpers.hpp
Go to the documentation of this file.
1 /*
2  * common.hpp
3  *
4  * Created on: Nov 8, 2019
5  * Author: Edo Jelavic
6  * Institute: ETH Zurich, Robotic Systems Lab
7  */
8 
9 #pragma once
10 
11 #include <pcl/common/common.h>
12 #include <ros/console.h>
13 #include <ros/package.h>
14 #include <Eigen/Core>
17 #include <random>
18 
19 namespace grid_map {
20 
21 class GridMapPclLoader;
22 
23 namespace grid_map_pcl_test {
24 
25 using Point = pcl::PointXYZ;
26 using Pointcloud = pcl::PointCloud<Point>;
27 
28 static const std::string layerName = "elevation";
29 static const bool savePointclouds = true;
30 extern std::mt19937 rndGenerator;
31 
32 std::string getConfigFilePath();
33 std::string getTestDataFolderPath();
34 Pointcloud::Ptr concatenate(Pointcloud::Ptr cloud1, Pointcloud::Ptr cloud2);
35 
36 std::vector<double> getNonNanElevationValues(const grid_map::GridMap& gridMap);
37 std::vector<Eigen::Vector3d> getNonNanElevationValuesWithCoordinates(const grid_map::GridMap& gridMap);
38 
39 Pointcloud::Ptr createNormallyDistributedBlobOfPoints(unsigned int nPoints, double mean, double stdDev, std::mt19937* generator);
40 Pointcloud::Ptr createNoisyPlanePointcloud(unsigned int nPoints, double minXY, double maxXY, double meanZ, double stdDevZ,
41  std::mt19937* generator);
42 Pointcloud::Ptr createPerfectPlane(unsigned int nPoints, double minXY, double maxXY, double desiredHeight, std::mt19937* generator);
43 
44 void runGridMapPclLoaderOnInputCloud(Pointcloud::ConstPtr inputCloud, grid_map::GridMapPclLoader* gridMapPclLoader);
45 void runGridMapPclLoaderOnInputCloudAndSavePointCloud(Pointcloud::ConstPtr inputCloud, grid_map::GridMapPclLoader* gridMapPclLoader,
46  const std::string& filename);
47 
48 Pointcloud::Ptr createStepTerrain(unsigned int nPoints, double minXY, double maxXY, double zHigh, double zLow, double stdDevZ,
49  std::mt19937* generator, double* center);
50 
52 std::string getTestPcdFilePath();
53 
54 } /* namespace grid_map_pcl_test */
55 } /* namespace grid_map*/
std::vector< Eigen::Vector3d > getNonNanElevationValuesWithCoordinates(const grid_map::GridMap &gridMap)
Pointcloud::Ptr createNoisyPlanePointcloud(unsigned int nPoints, double minXY, double maxXY, double meanZ, double stdDevZ, std::mt19937 *generator)
void runGridMapPclLoaderOnInputCloud(Pointcloud::ConstPtr inputCloud, grid_map::GridMapPclLoader *gridMapPclLoader)
void runGridMapPclLoaderOnInputCloudAndSavePointCloud(Pointcloud::ConstPtr inputCloud, grid_map::GridMapPclLoader *gridMapPclLoader, const std::string &filename)
std::vector< double > getNonNanElevationValues(const grid_map::GridMap &gridMap)
void setVerbosityLevel(ros::console::levels::Level level)
static const bool savePointclouds
static const std::string layerName
std::string getTestDataFolderPath()
Pointcloud::Ptr createStepTerrain(unsigned int nPoints, double minXY, double maxXY, double zHigh, double zLow, double stdDevZ, std::mt19937 *generator, double *center)
Pointcloud::Ptr concatenate(Pointcloud::Ptr cloud1, Pointcloud::Ptr cloud2)
Pointcloud::Ptr createNormallyDistributedBlobOfPoints(unsigned int nPoints, double mean, double stdDev, std::mt19937 *generator)
Pointcloud::Ptr createPerfectPlane(unsigned int nPoints, double minXY, double maxXY, double desiredHeight, std::mt19937 *generator)
pcl::PointCloud< Point > Pointcloud


grid_map_pcl
Author(s): Dominic Jud , Edo Jelavic
autogenerated on Tue Jun 1 2021 02:13:43