Apollo  6.0
Open source self driving car software
base_preprocessor.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 // SAMPLE CODE:
17 //
18 // class DefaultPreprocessor : public BasePreprocessor {
19 // public:
20 // DefaultPreprocessor() : BasePreprocessor() {}
21 // virtual ~DefaultPreprocessor() {}
22 //
23 // virtual bool Init() override {
24 // // Do something.
25 // return true;
26 // }
27 //
28 // virtual bool Preprocess(
29 // const drivers::ContiRadar& raw_obstacles,
30 // const PreprocessorOptions& options,
31 // drivers::ContiRadar* corrected_obstacles) override {
32 // // Do something.
33 // return true;
34 // }
35 //
36 // virtual std::string Name() const override {
37 // return "DefaultPreprocessor";
38 // }
39 //
40 // };
41 //
42 // // Register plugin.
43 // PERCEPTION_REGISTER_PREPROCESSOR(DefaultPreprocessor);
45 // USING CODE:
46 //
47 // BasePreprocessor* preprocessor =
48 // BasePreprocessorRegisterer::GetInstanceByName("DefaultPreprocessor");
49 // using preprocessor to do somethings.
50 // ////////////////////////////////////////////////////
51 
52 #pragma once
53 
54 #include <string>
55 
56 #include "Eigen/Core"
57 
58 #include "cyber/common/log.h"
59 #include "cyber/common/macros.h"
60 
61 #include "modules/drivers/proto/conti_radar.pb.h"
66 
67 namespace apollo {
68 namespace perception {
69 namespace radar {
70 
72  // reserved
73 };
74 
76  public:
77  BasePreprocessor() = default;
78  virtual ~BasePreprocessor() = default;
79 
80  virtual bool Init() = 0;
81 
82  // @brief: correct radar raw obstacles.
83  // @param [in]: raw obstacles from radar driver.
84  // @param [in]: options.
85  // @param [out]: corrected radar obstacles
86  virtual bool Preprocess(const drivers::ContiRadar& raw_obstacles,
87  const PreprocessorOptions& options,
88  drivers::ContiRadar* corrected_obstacles) = 0;
89 
90  virtual std::string Name() const = 0;
91 
92  private:
94 };
95 
97 #define PERCEPTION_REGISTER_PREPROCESSOR(name) \
98  PERCEPTION_REGISTER_CLASS(BasePreprocessor, name)
99 
100 } // namespace radar
101 } // namespace perception
102 } // namespace apollo
Definition: base_preprocessor.h:75
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
PERCEPTION_REGISTER_REGISTERER(BaseDetector)
Definition: base_preprocessor.h:71
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition: macros.h:48
bool Init(const char *binary_name)