27#include "Eigen/Sparse"
159 bool IsValid()
const {
return (nr_support > 0); }
219 int Prune(
unsigned int min_nr_samples,
unsigned int max_nr_samples);
221 return static_cast<unsigned int>(
indices.size());
224 assert(i >= 0 && i <
indices.size());
228 assert(i >= 0 && i <
static_cast<int>(
indices.size()));
232 assert(i >= 0 && i <
indices.size());
236 assert(i >= 0 && i <
static_cast<int>(
indices.size()));
254 virtual bool Detect(
const float *point_cloud,
float *height_above_ground,
255 unsigned int nr_points,
256 unsigned int nr_point_elements) = 0;
264 static const int dim_point_ = 3;
271 bool Detect(
const float *point_cloud,
float *height_above_ground,
272 unsigned int nr_points,
unsigned int nr_point_elements);
273 void ResetParams(
float ori_z_lower,
float ori_z_upper);
274 void UpdateParams(
float parsing_ground_z,
float buffer,
double timestamp);
282 void Pc2Voxel(
float x,
float y,
float z,
int *row,
int *col);
293 unsigned int nr_point_element,
float dist_thre);
297 std::vector<std::pair<int, int>> *neighbors,
298 unsigned int nr_point_element);
301 unsigned int nr_points,
302 unsigned int nr_point_element,
float dist_thre);
304 std::vector<std::pair<int, int>> *neighbors);
306 const std::vector<std::pair<int, int>> &neighbors);
311 unsigned int nr_point_element);
320 int SmoothLine(
unsigned int up,
unsigned int r,
unsigned int dn);
328 int CompareZ(
const float *point_cloud,
const std::vector<int> &point_indices,
330 unsigned int nr_points,
unsigned int nr_point_element,
331 unsigned int nr_compares);
334 float *height_above_ground,
335 unsigned int nr_points,
336 unsigned int nr_point_elements);
341 float *height_above_ground,
unsigned int r,
342 unsigned int nr_points,
343 unsigned int nr_point_elements);
370 Eigen::SimplicialLDLT<Eigen::SparseMatrix<float>>
solver_;
BaseGroundDetector(PlaneFitGroundDetectorParam ¶m)
virtual bool Detect(const float *point_cloud, float *height_above_ground, unsigned int nr_points, unsigned int nr_point_elements)=0
PlaneFitGroundDetectorParam & param_
virtual ~BaseGroundDetector()
unsigned int GetGridDimX() const
int FitGrid(const float *point_cloud, PlaneFitPointCandIndices *candi, GroundPlaneLiDAR *groundplane, unsigned int nr_points, unsigned int nr_point_element, float dist_thre)
void SetGroundPlaneSpherParams(float *params)
Eigen::SparseMatrix< float > b_array_
unsigned int GetGridDimY() const
int SmoothLine(unsigned int up, unsigned int r, unsigned int dn)
float CalculateAngleDist(const GroundPlaneLiDAR &plane, const std::vector< std::pair< int, int > > &neighbors)
float * sampled_z_values_
const GroundPlaneLiDAR * GetGroundPlane(int r, int c) const
void GetInliers(int *inliers)
GroundPlaneLiDAR ** ground_planes_
~PlaneFitGroundDetector()
void UpdateParams(float parsing_ground_z, float buffer, double timestamp)
int FitLine(unsigned int r)
VoxelGridXY< float > * vg_fine_
unsigned int * map_fine_to_coarse_
bool Detect(const float *point_cloud, float *height_above_ground, unsigned int nr_points, unsigned int nr_point_elements)
void ComputeAdaptiveThreshold()
int CompleteGrid(const GroundPlaneSpherical <, const GroundPlaneSpherical &rt, const GroundPlaneSpherical &up, const GroundPlaneSpherical &dn, GroundPlaneSpherical *gp)
void ResetParams(float ori_z_lower, float ori_z_upper)
int FilterGrid(const Voxel< float > &vg, const float *point_cloud, PlaneFitPointCandIndices *candi, unsigned int nr_points, unsigned int nr_point_element)
void InitOrderTable(const VoxelGridXY< float > *vg, std::pair< int, int > *order)
Eigen::SimplicialLDLT< Eigen::SparseMatrix< float > > solver_
void ComputeSignedGroundHeight(const float *point_cloud, float *height_above_ground, unsigned int nr_points, unsigned int nr_point_elements)
int FitGridWithNeighbors(int r, int c, const float *point_cloud, GroundPlaneLiDAR *groundplane, unsigned int nr_points, unsigned int nr_point_element, float dist_thre)
std::vector< std::vector< unsigned int > > neighbors_
void GetNeighbors(int r, int c, int rows, int cols, std::vector< std::pair< int, int > > *neighbors)
std::pair< float, bool > ** ground_z_
const VoxelGridXY< float > * GetGrid() const
VoxelGridXY< float > * vg_coarse_
Eigen::SparseMatrix< float > a_array_
const char * GetLabel() const
int SmoothGrid(const GroundPlaneSpherical &g, const GroundPlaneSpherical <, const GroundPlaneSpherical &rt, const GroundPlaneSpherical &up, const GroundPlaneSpherical &dn, GroundPlaneSpherical *gp)
void GetGroundPlaneSpherParams(float *params)
PlaneFitPointCandIndices ** local_candis_
int FilterLine(unsigned int r)
GroundPlaneSpherical ** ground_planes_sphe_
int FilterCandidates(int r, int c, const float *point_cloud, PlaneFitPointCandIndices *candi, std::vector< std::pair< int, int > > *neighbors, unsigned int nr_point_element)
void ComputeSignedGroundHeightLine(const float *point_cloud, const GroundPlaneLiDAR *up, const GroundPlaneLiDAR *cn, const GroundPlaneLiDAR *dn, float *height_above_ground, unsigned int r, unsigned int nr_points, unsigned int nr_point_elements)
int CompareZ(const float *point_cloud, const std::vector< int > &point_indices, const float *z_values, PlaneFitPointCandIndices *candi, unsigned int nr_points, unsigned int nr_point_element, unsigned int nr_compares)
std::pair< int, int > * order_table_
void Pc2Voxel(float x, float y, float z, int *row, int *col)
PlaneFitPointCandIndices ** GetCandis() const
float IRadiansToDegree(float r)
void ICopy3(const T src[3], T dst[3])
void IPlaneEucliToSpher(const GroundPlaneLiDAR &src, GroundPlaneSpherical *dst)
T ISquaresum3(const T x[3])
void IScale3(T x[3], T sf)
void IPlaneSpherToEucli(const GroundPlaneSpherical &src, GroundPlaneLiDAR *dst)
void IScale4(T x[4], T sf)
void ICopy4(const T src[4], T dst[4])
void ForcePositiveNormalX()
void SetInvalidStatus(int flag)
void ForcePositiveNormalY()
void SetStatus(bool flag)
void SetOrigin(int origin)
GroundPlaneLiDAR & operator=(const GroundPlaneLiDAR &pi)
int GetInvalidStatus() const
float GetDegreeNormalToZ() const
float GetDegreeNormalToX() const
void ForcePositiveNormalZ()
void SetNrSupport(int nr)
float get_degree_normal_to_y() const
GroundPlaneSpherical & operator=(const GroundPlaneSpherical &pi)
void SetStatus(bool flag)
void SetNrSupport(int nr)
int nr_ransac_iter_threshold
unsigned int nr_samples_min_threshold
float planefit_dist_threshold_far
float termi_inlier_percen_threshold
unsigned int nr_grids_fine
unsigned int nr_z_comp_candis
unsigned int nr_inliers_min_threshold
float planefit_filter_threshold
PlaneFitGroundDetectorParam()
float sample_region_z_lower
unsigned int nr_points_max
float planefit_dist_threshold_near
unsigned int nr_grids_coarse
float planefit_orien_threshold
float candidate_filter_threshold
unsigned int nr_samples_max_threshold
unsigned int nr_z_comp_fail_threshold
float sample_region_z_upper
std::vector< int > indices
unsigned int Size() const
int Prune(unsigned int min_nr_samples, unsigned int max_nr_samples)
const int & operator[](unsigned int i) const
const int & operator[](int i) const
int & operator[](unsigned int i)
void Reserve(unsigned int size)
PlaneFitPointCandIndices()