27 namespace perception {
66 float confidence = 1.f;
67 float top_z = kDefaultTopZ;
68 size_t points_in_roi = 0;
71 points.reserve(kDefaultReserveSize);
72 point_ids.reserve(kDefaultReserveSize);
73 pixels.reserve(kDefaultReserveSize);
79 points.push_back(
SppPoint(point, height));
80 point_ids.push_back(point_id);
84 std::vector<int> indices(points.size(), 0);
85 std::iota(indices.begin(), indices.end(), 0);
86 std::sort(indices.begin(), indices.end(),
87 [&](
const int lhs,
const int rhs) {
88 return points[lhs].z < points[rhs].z;
90 std::vector<SppPoint> points_target(points.size());
91 std::vector<uint32_t> point_ids_target(points.size());
92 for (
size_t i = 0; i < points.size(); ++i) {
93 points_target[i] = points[indices[i]];
94 point_ids_target[i] = point_ids[indices[i]];
96 points.swap(points_target);
97 point_ids.swap(point_ids_target);
108 top_z = kDefaultTopZ;
114 for (
size_t i = 0; i < point_ids.size(); ++i) {
115 if (mask[point_ids[i]]) {
117 point_ids[valid] = point_ids[i];
118 points[valid] = points[i];
123 points.resize(valid);
124 point_ids.resize(valid);
127 static const size_t kDefaultReserveSize = 1000;
128 static constexpr
float kDefaultTopZ = 50.f;
void RemovePoints(const CloudMask &mask)
Definition: spp_cluster.h:112
std::vector< float > class_prob
Definition: spp_cluster.h:63
SppCluster()
Definition: spp_cluster.h:70
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void AddPointSample(const base::PointF &point, float height, uint32_t point_id)
Definition: spp_cluster.h:77
Definition: spp_cluster.h:56
SppClassType
Definition: spp_cluster.h:30
T x
Definition: point.h:29
void SortPoint()
Definition: spp_cluster.h:83
Definition: spp_cluster.h:40
SppPoint(const base::PointF &point, float height)
Definition: spp_cluster.h:48
Definition: cloud_mask.h:26
T z
Definition: point.h:31
std::shared_ptr< const SppCluster > SppClusterConstPtr
Definition: spp_cluster.h:132
void clear()
Definition: spp_cluster.h:100
std::shared_ptr< SppCluster > SppClusterPtr
Definition: spp_cluster.h:131
std::vector< uint32_t > pixels
Definition: spp_cluster.h:61
std::vector< uint32_t > point_ids
Definition: spp_cluster.h:59
T y
Definition: point.h:30
std::vector< SppPoint > points
Definition: spp_cluster.h:58