25 namespace perception {
41 int stat_len = xstep + ystep + zstep;
42 std::vector<int> stat_feat(stat_len, 0);
44 (max_pt_.
x - min_pt_.
x) / static_cast<float>(xstep) + 0.000001f;
46 (max_pt_.
y - min_pt_.
y) / static_cast<float>(ystep) + 0.000001f;
48 (max_pt_.
z - min_pt_.
z) / static_cast<float>(zstep) + 0.000001f;
50 int pt_num =
static_cast<int>(cloud_->
size());
51 for (
int i = 0; i < pt_num; ++i) {
53 ++stat_feat[
static_cast<int>((pt.
x - min_pt_.
x) / xsize)];
54 ++stat_feat[xstep +
static_cast<int>((pt.
y - min_pt_.
y) / ysize)];
55 ++stat_feat[xstep + ystep +
static_cast<int>((pt.
z - min_pt_.
z) / zsize)];
58 feature[0] = center_pt_.
x / 10.0f;
59 feature[1] = center_pt_.
y / 10.0f;
60 feature[2] = center_pt_.
z;
64 feature[6] =
static_cast<float>(pt_num);
65 for (
size_t i = 0; i < stat_feat.size(); ++i) {
67 static_cast<float>(stat_feat[i]) / static_cast<float>(pt_num);
72 void GetMinMaxCenter() {
76 min_pt_.
x = min_pt_.
y = min_pt_.
z = std::numeric_limits<float>::max();
77 max_pt_.
x = max_pt_.
y = max_pt_.
z = -std::numeric_limits<float>::max();
79 float pt_num =
static_cast<float>(cloud_->
size());
80 for (
int i = 0; i < static_cast<int>(pt_num); ++i) {
85 min_pt_.
x = std::min(min_pt_.
x, pt.
x);
86 max_pt_.
x = std::max(max_pt_.
x, pt.
x);
87 min_pt_.
y = std::min(min_pt_.
y, pt.
y);
88 max_pt_.
y = std::max(max_pt_.
y, pt.
y);
89 min_pt_.
z = std::min(min_pt_.
z, pt.
z);
90 max_pt_.
z = std::max(max_pt_.
z, pt.
z);
94 center_pt_.
x = xsum / pt_num;
95 center_pt_.
y = ysum / pt_num;
96 center_pt_.
z = zsum / pt_num;
~FeatureDescriptor()=default
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
T x
Definition: point.h:29
size_t size() const
Definition: point_cloud.h:83
T z
Definition: point.h:31
Definition: point_cloud.h:264
void ComputeHistogram(int bin_size, float *feature)
Definition: feature_descriptor.h:36
FeatureDescriptor(base::PointFCloud *cloud)
Definition: feature_descriptor.h:30
void SetCloud(base::PointFCloud *cloud)
Definition: feature_descriptor.h:34
Definition: feature_descriptor.h:28
FeatureDescriptor()
Definition: feature_descriptor.h:31
T y
Definition: point.h:30
const PointT * at(size_t col, size_t row) const
Definition: point_cloud.h:64