Apollo 11.0
自动驾驶开放平台
gpu_down_sample.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <limits>
20#include <string>
21#include <vector>
22
23#include "modules/perception/perception_plugin/lidar_detection/gpu_down_sample/proto/gpu_down_sample.pb.h"
24
25#include "cyber/common/file.h"
26#include "cyber/common/log.h"
31
32namespace apollo {
33namespace perception {
34namespace lidar {
35
37public:
38 GpuDownSample() = default;
39 virtual ~GpuDownSample() = default;
40
48 bool Init(const DownSampleInitOptions& options = DownSampleInitOptions()) override;
49
58 bool Process(const DownSampleOptions& options, base::PointFCloudPtr& cloud_ptr) override;
59
65 std::string Name() const override {
66 return "GpuDownSample";
67 }
68
69private:
70 void warmUpGPU();
71 int getNumberOfAvailableThreads();
72
73 bool downSample(
74 base::PointF* point_cloud,
75 int& point_cloud_size,
76 float resolution_x,
77 float resolution_y,
78 float resolution_z,
79 bool use_centroid_downsample);
80 VoxelDownSampleCuda* voxel_downSample_ptr;
81 double downsample_voxel_size_x_ = 0.09;
82 double downsample_voxel_size_y_ = 0.09;
83 double downsample_voxel_size_z_ = 0.09;
84 bool downsample_use_centroid;
85}; // class GpuDownSample
86
88
89} // namespace lidar
90} // namespace perception
91} // namespace apollo
std::string Name() const override
Name of GpuDownSample object
bool Init(const DownSampleInitOptions &options=DownSampleInitOptions()) override
Init of GpuDownSample object
bool Process(const DownSampleOptions &options, base::PointFCloudPtr &cloud_ptr) override
filter mark area objects
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
std::shared_ptr< PointFCloud > PointFCloudPtr
class register implement
Definition arena_queue.h:37