Autoware.Auto
ray_ground_classifier.hpp
Go to the documentation of this file.
1 // Copyright 2017-2020 the Autoware Foundation, Arm Limited
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
19 
20 #ifndef RAY_GROUND_CLASSIFIER__RAY_GROUND_CLASSIFIER_HPP_
21 #define RAY_GROUND_CLASSIFIER__RAY_GROUND_CLASSIFIER_HPP_
22 
24 #include <common/types.hpp>
26 
27 namespace autoware
28 {
29 namespace perception
30 {
31 namespace filters
32 {
33 namespace ray_ground_classifier
34 {
35 
39 
41 class RAY_GROUND_CLASSIFIER_PUBLIC RayGroundClassifier
42 {
43 public:
46  explicit RayGroundClassifier(const Config & cfg);
48  explicit RayGroundClassifier(const RayGroundClassifier & original);
49 
54  void insert(const PointXYZIF * pt);
59  void insert(const PointXYZIFR & pt);
60 
65  bool8_t can_fit_result(
66  const PointPtrBlock & ground_block,
67  const PointPtrBlock & nonground_block) const;
73  bool8_t can_fit_result(
74  const Ray & ray,
75  const PointPtrBlock & ground_block,
76  const PointPtrBlock & nonground_block) const;
77 
88  void partition(
89  PointPtrBlock & ground_block,
90  PointPtrBlock & nonground_block,
91  const bool8_t presorted);
92 
101  void structured_partition(
102  const PointPtrBlock & raw_block,
103  PointPtrBlock & ground_block,
104  PointPtrBlock & nonground_block);
105 
112  void partition(
113  const Ray & ray,
114  PointPtrBlock & ground_block,
115  PointPtrBlock & nonground_block);
116 
117 private:
119  RAY_GROUND_CLASSIFIER_LOCAL void sort_ray();
121  RAY_GROUND_CLASSIFIER_LOCAL static void insert(PointPtrBlock & block, const PointXYZIF * pt);
126  RAY_GROUND_CLASSIFIER_LOCAL void segment_ray(
127  PointPtrBlock & ground_block,
128  PointPtrBlock & nonground_block);
129 
131  Ray m_sort_array;
132 
135 
137  RayGroundPointClassifier m_point_classifier;
138 }; // class RayGroundClassifier
139 } // namespace ray_ground_classifier
140 } // namespace filters
141 } // namespace perception
142 } // namespace autoware
143 
144 #endif // RAY_GROUND_CLASSIFIER__RAY_GROUND_CLASSIFIER_HPP_
algorithm.hpp
This file provides includes all common algorithms.
autoware::perception::filters::ray_ground_classifier::Ray
std::vector< PointXYZIFR > Ray
Definition: ray_ground_point_classifier.hpp:167
autoware::common::types::PointPtrBlock
std::vector< const PointXYZIF * > PointPtrBlock
Definition: types.hpp:124
types.hpp
This file includes common type definition.
autoware::common::algorithm::QuickSorter< Ray >
autoware::common::types::PointXYZIF
Definition: types.hpp:56
autoware::common::types::bool8_t
bool bool8_t
Definition: types.hpp:39
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
ray_ground_point_classifier.hpp
This file defines the computational core of the ray ground filter algorithm.
autoware::perception::filters::ray_ground_classifier::RayGroundClassifier
Given a ray, partitions into ground and nonground points.
Definition: ray_ground_classifier.hpp:41
autoware::common::types::float32_t
float float32_t
Definition: types.hpp:45
autoware::perception::filters::ray_ground_classifier::PointXYZIFR
This is a simplified point view of a ray. The only information needed is height and projected radial ...
Definition: ray_ground_point_classifier.hpp:129
autoware::perception::filters::ray_ground_classifier::Config
A struct that holds configuration parameters for the ground filter.
Definition: ray_ground_point_classifier.hpp:69
autoware::perception::filters::ray_ground_classifier::RayGroundPointClassifier
Simple stateful implementation of ray ground filter: https://github.com/CPFL/Autoware/blob/develop/ro...
Definition: ray_ground_point_classifier.hpp:172