27#include "Eigen/Sparse"
37 is_from_self =
"unknown";
38 invalid_status =
"invalid";
128 void SetOrigin(std::string origin) { is_from_self = origin; }
138 std::string is_from_self;
139 std::string invalid_status;
159 bool IsValid()
const {
return (nr_support > 0); }
221 int Prune(
unsigned int min_nr_samples,
unsigned int max_nr_samples);
223 return static_cast<unsigned int>(
indices.size());
226 assert(i >= 0 && i <
indices.size());
230 assert(i >= 0 && i <
static_cast<int>(
indices.size()));
234 assert(i >= 0 && i <
indices.size());
238 assert(i >= 0 && i <
static_cast<int>(
indices.size()));
330 virtual bool Detect(
const float *point_cloud,
const int* semantic_value,
331 float *height_above_ground,
unsigned int nr_points,
332 unsigned int nr_point_elements) = 0;
340 static const int dim_point_ = 3;
347 bool Detect(
const float *point_cloud,
const int* semantic_value,
348 float *height_above_ground,
349 unsigned int nr_points,
unsigned int nr_point_elements);
350 void ResetParams(
float ori_z_lower,
float ori_z_upper);
351 void UpdateParams(
float parsing_ground_z,
float buffer,
double timestamp);
359 void Pc2Voxel(
float x,
float y,
float z,
int *row,
int *col);
370 unsigned int nr_point_element,
float dist_thre);
374 std::vector<std::pair<int, int>> *neighbors,
375 unsigned int nr_point_element);
378 unsigned int nr_points,
379 unsigned int nr_point_element,
float dist_thre);
381 std::vector<std::pair<int, int>> *neighbors);
383 const std::vector<std::pair<int, int>> &neighbors);
385 const int *semantic_list,
const std::vector<int> &indices,
387 unsigned int nr_point_element);
389 const int *semantic_list,
const std::vector<int> &indices,
396 unsigned int nr_point_element);
405 int SmoothLine(
unsigned int up,
unsigned int r,
unsigned int dn);
413 int CompareZ(
const float *point_cloud,
const std::vector<int> &point_indices,
415 unsigned int nr_points,
unsigned int nr_point_element,
416 unsigned int nr_compares);
419 float *height_above_ground,
420 unsigned int nr_points,
421 unsigned int nr_point_elements);
426 float *height_above_ground,
unsigned int r,
427 unsigned int nr_points,
428 unsigned int nr_point_elements);
456 Eigen::SimplicialLDLT<Eigen::SparseMatrix<float>>
solver_;
BaseGroundDetector(PlaneFitGroundDetectorParam ¶m)
virtual bool Detect(const float *point_cloud, const int *semantic_value, 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)
void SelectGroundCandidate(const float *point_cloud, const int *semantic_list, const std::vector< int > &indices, PlaneFitPointCandIndices *candi, GroundCandidateIndices *ground_candi, unsigned int nr_point_element)
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)
bool Detect(const float *point_cloud, const int *semantic_value, float *height_above_ground, unsigned int nr_points, unsigned int nr_point_elements)
int FitLine(unsigned int r)
VoxelGridXY< float > * vg_fine_
unsigned int * map_fine_to_coarse_
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
GroundCandidateIndices ** ground_candidates_
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)
int NeighborGroundCandidate(int row, int col, const float *point_cloud, const int *semantic_list, const std::vector< int > &indices, PlaneFitPointCandIndices *candi, unsigned int nr_point_element)
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 SetGroundFlag(bool flag)
void SetGroundCount(int value)
void SetGroundHeight(float value)
void SetValidCount(int value)
void Resize(int size, bool flag)
std::vector< bool > visited
void SetValidFlag(bool flag)
bool GetIndicesVisitedFlag(int indice)
void SetVisitedTrue(int index)
void SetValidHeight(float value)
void ForcePositiveNormalX()
std::string GetInvalidStatus() const
void ForcePositiveNormalY()
void SetStatus(bool flag)
GroundPlaneLiDAR & operator=(const GroundPlaneLiDAR &pi)
std::string GetOrigin() const
float GetDegreeNormalToZ() const
void SetOrigin(std::string origin)
float GetDegreeNormalToX() const
void ForcePositiveNormalZ()
void SetInvalidStatus(std::string flag)
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
int semantic_ground_value
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()