Apollo 11.0
自动驾驶开放平台
apollo::perception::radar4d::RadarPreprocessor类 参考

#include <radar_preprocessor.h>

类 apollo::perception::radar4d::RadarPreprocessor 继承关系图:
apollo::perception::radar4d::RadarPreprocessor 的协作图:

Public 成员函数

 RadarPreprocessor ()
 
virtual ~RadarPreprocessor ()
 
bool Init (const PreprocessorInitOptions &options) override
 Init RadarPreprocessor config
 
bool Preprocess (const std::shared_ptr< apollo::drivers::OculiiPointCloud const > &message, const PreprocessorOptions &options, RadarFrame *frame) override
 Process radar point cloud.
 
std::string Name () const override
 The name of the RadarPreprocessor
 
- Public 成员函数 继承自 apollo::perception::radar4d::BasePreprocessor
 BasePreprocessor ()=default
 Construct a new Base Preprocessor object
 
virtual ~BasePreprocessor ()=default
 

详细描述

在文件 radar_preprocessor.h29 行定义.

构造及析构函数说明

◆ RadarPreprocessor()

apollo::perception::radar4d::RadarPreprocessor::RadarPreprocessor ( )
inline

在文件 radar_preprocessor.h31 行定义.

31: BasePreprocessor(), rcs_offset_(0.0) {}
BasePreprocessor()=default
Construct a new Base Preprocessor object

◆ ~RadarPreprocessor()

virtual apollo::perception::radar4d::RadarPreprocessor::~RadarPreprocessor ( )
inlinevirtual

在文件 radar_preprocessor.h32 行定义.

32{}

成员函数说明

◆ Init()

bool apollo::perception::radar4d::RadarPreprocessor::Init ( const PreprocessorInitOptions options)
overridevirtual

Init RadarPreprocessor config

参数
optionsinit options
返回
true
false

实现了 apollo::perception::radar4d::BasePreprocessor.

在文件 radar_preprocessor.cc33 行定义.

33 {
34 // load config file
35 std::string config_file =
36 GetConfigFile(options.config_path, options.config_file);
37
38 PreprocessorConfig config;
39 ACHECK(cyber::common::GetProtoFromFile(config_file, &config));
40
41 rcs_offset_ = config.rcs_offset();
42 return true;
43}
#define ACHECK(cond)
Definition log.h:80
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132
std::string GetConfigFile(const std::string &config_path, const std::string &config_file)
Definition util.cc:80

◆ Name()

std::string apollo::perception::radar4d::RadarPreprocessor::Name ( ) const
inlineoverridevirtual

The name of the RadarPreprocessor

返回
std::string

实现了 apollo::perception::radar4d::BasePreprocessor.

在文件 radar_preprocessor.h62 行定义.

62{ return "RadarPreprocessor"; }

◆ Preprocess()

bool apollo::perception::radar4d::RadarPreprocessor::Preprocess ( const std::shared_ptr< apollo::drivers::OculiiPointCloud const > &  message,
const PreprocessorOptions options,
RadarFrame frame 
)
overridevirtual

Process radar point cloud.

参数
messageraw data obtained from radar driver
optionspreprocess options
frameradar frame with preprocessed point cloud
返回
true
false

实现了 apollo::perception::radar4d::BasePreprocessor.

在文件 radar_preprocessor.cc45 行定义.

48 {
49 if (frame == nullptr) {
50 return false;
51 }
52 if (frame->cloud == nullptr) {
53 frame->cloud = base::RadarPointFCloudPool::Instance().Get();
54 }
55 if (frame->world_cloud == nullptr) {
56 frame->world_cloud = base::RadarPointDCloudPool::Instance().Get();
57 }
58
59 frame->cloud->set_timestamp(message->measurement_time());
60 if (message->point_size() > 0) {
61 frame->cloud->reserve(message->point_size());
63 for (int i = 0; i < message->point_size(); ++i) {
64 // original point cloud from driver message
65 const apollo::drivers::OculiiPointXYZIV& pt = message->point(i);
67 message->raw_pointclouds(i);
68 // filter abnormal points
69 if (filter_naninf_points_) {
70 if (std::isnan(pt.x()) || std::isnan(pt.y()) || std::isnan(pt.z())) {
71 continue;
72 }
73 if (fabs(pt.x()) > kPointInfThreshold ||
74 fabs(pt.y()) > kPointInfThreshold ||
75 fabs(pt.z()) > kPointInfThreshold) {
76 continue;
77 }
78 }
79 // filter points higher than the threshold
80 if (filter_high_z_points_ && pt.z() > z_threshold_) {
81 continue;
82 }
83 point.x = pt.x();
84 point.y = pt.y();
85 point.z = pt.z();
86 // rcs offset is set for different radars used for training and testing
87 point.rcs = static_cast<float>(pt.intensity() + rcs_offset_);
88 // doppler velocity is returned by radar
89 point.velocity = static_cast<float>(raw_pt.doppler());
90 // compensated velocity of each point needs to be calculated
91 point.comp_vel = CalCompensatedVelocity(point, options);
92 frame->cloud->push_back(point);
93 }
94 // transform the cloud point from local to world
95 TransformCloud(frame->cloud, frame->radar2world_pose, frame->world_cloud);
96 }
97 return true;
98}
RadarPoint< float > RadarPointF
Definition point.h:113

该类的文档由以下文件生成: